Skip to content

[XPU] Harden fused GDN recurrent state updates - #570

Open
gc-fu wants to merge 1 commit into
mainfrom
pr/gdn-recurrent-state-hardening
Open

[XPU] Harden fused GDN recurrent state updates#570
gc-fu wants to merge 1 commit into
mainfrom
pr/gdn-recurrent-state-hardening

Conversation

@gc-fu

@gc-fu gc-fu commented Jul 27, 2026

Copy link
Copy Markdown
Contributor

Summary

  • validate fused GDN tensor devices, dtypes, shapes, strides, dimensions, and state indices before launch
  • replace bounds-unsafe aligned 16-element scalar loads with true scalar transactions
  • remove the inline conv_state shift that can race across HV work-groups
  • always run the state shift after the main kernel with an explicit SYCL event dependency, including graph replay
  • annotate all mutated state/output tensors in the Torch operator schemas
  • update the end-to-end sequential GDN test for the current metadata API

Correctness and performance tradeoff

The prior small-grid shortcut could update conv_state while another work-group was still reading the old state. This PR always uses a second state-shift kernel to make ordering correct. Small workloads therefore gain one kernel submission; larger workloads already used a separate shift kernel. The dependency is explicit rather than relying on queue ordering.

Scope

This is a kernel-only hardening stage following #569. The operator names and call signatures are unchanged, so no framework PR is required.

Testing

Not run as part of PR creation.

Validate tensor contracts and state indices, remove the cross-work-group inline shift race, encode the shift dependency explicitly, use bounds-safe scalar loads, and correct operator mutation schemas.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant