Skip to content

[ExecuTorch][WebGPU] Coordinate dynamic dispatch routes - #21128

Open
JCNTH wants to merge 7 commits into
gh/JCNTH/104/basefrom
gh/JCNTH/104/head
Open

[ExecuTorch][WebGPU] Coordinate dynamic dispatch routes#21128
JCNTH wants to merge 7 commits into
gh/JCNTH/104/basefrom
gh/JCNTH/104/head

Conversation

@JCNTH

@JCNTH JCNTH commented Jul 22, 2026

Copy link
Copy Markdown
Contributor

Stack from ghstack (oldest at bottom):

Centralize dynamic dispatch routing, resize hooks, and workgroup-grid ownership

Quantized-linear and attention optimizations select specialized dispatch ranges from live sequence lengths, but the original handlers duplicated resize bookkeeping and exposed dispatch indices. This change centralizes route coordination and dynamic-grid ownership in WebGPUGraph.

Key changes:

  • WebGPUUtils.h — register mutually exclusive routes and validate their ranges.
  • WebGPUGraph.{h,cpp} — add typed named resize hooks, descriptor-driven compute construction, graph-owned parameter buffers and dynamic grids, staged grid updates, and exception-safe retry.
  • QuantizedLinear.cpp, Sdpa.cpp, and SdpaFdDecode.{h,cpp} — select specialized ranges through the shared route registry.
  • test_compute_dispatch.cpp — cover invalid triggers, route overlap, rollback/retry, ownership, and repeated transitions.

The route registry is WebGPU-specific. Graph-owned grid recomputation mirrors Vulkan's DynamicDispatchNode lifecycle without introducing a Vulkan-style node hierarchy.

Co-authored-with: Claude Code.
@exported-using-ghexport

Differential Revision: D113171748

Differential Revision: D113171748

[ghstack-poisoned]
@pytorch-bot

pytorch-bot Bot commented Jul 22, 2026

Copy link
Copy Markdown

🔗 Helpful Links

🧪 See artifacts and rendered test results at hud.pytorch.org/pr/pytorch/executorch/21128

Note: Links to docs will display an error until the docs builds have been completed.

✅ No Failures

As of commit 8bdee7c with merge base 8200b9e (image):
💚 Looks good so far! There are no failures yet. 💚

This comment was automatically generated by Dr. CI and updates every 15 minutes.

@github-actions

Copy link
Copy Markdown

This PR needs a release notes: label

If your change should be included in the release notes (i.e. would users of this library care about this change?), please use a label starting with release notes:. This helps us keep track and include your important work in the next release notes.

To add a label, you can comment to pytorchbot, for example
@pytorchbot label "release notes: none"

For more information, see
https://github.com/pytorch/pytorch/wiki/PyTorch-AutoLabel-Bot#why-categorize-for-release-notes-and-how-does-it-work.

[ghstack-poisoned]
[ghstack-poisoned]
[ghstack-poisoned]
[ghstack-poisoned]
@JCNTH
JCNTH requested a review from larryliu0820 as a code owner July 23, 2026 02:11
[ghstack-poisoned]
[ghstack-poisoned]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. meta-exported

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant