Skip to content

[ExecuTorch][WebGPU] Migrate multi-dispatch ops to make_compute_pipeline#20869

Open
JCNTH wants to merge 1 commit into
gh/JCNTH/44/basefrom
gh/JCNTH/44/head
Open

[ExecuTorch][WebGPU] Migrate multi-dispatch ops to make_compute_pipeline#20869
JCNTH wants to merge 1 commit into
gh/JCNTH/44/basefrom
gh/JCNTH/44/head

Conversation

@JCNTH

@JCNTH JCNTH commented Jul 10, 2026

Copy link
Copy Markdown

Stack from ghstack (oldest at bottom):

Route the multi-dispatch ops through utils::make_compute_pipeline (layout:"auto"), extending the dedup to the remaining pipeline-building ops:

  • rope: its two dispatches (xq, xk) now each build their own pipeline via the helper, so the shared bind-group-layout + its double-free guard are removed.
  • cat: the per-input dispatch loop builds a bundle per input via the helper.
  • sdpa / sdpa_fd_decode: the internal build_dispatch helper builds each pass via the helper; the hand-ordered read_write-vs-read-only binding count is now derived from the shader by the driver.

This trades one amortized shader module for a per-call shader compile in these ops — build-time only, zero runtime cost. Byte-behavior preserved: same passes, binding indices/types/buffers/sizes, dispatch counts, uniforms, own_uniform_buffer, resize hooks, and validations. sdpa's softmax pass (wg_size==0) passes constant_count=0, matching the prior null-constants path.

Differential Revision: D110836676

[ghstack-poisoned]
@pytorch-bot

pytorch-bot Bot commented Jul 10, 2026

Copy link
Copy Markdown

🔗 Helpful Links

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

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

❌ 1 Cancelled Job

As of commit aa943fc with merge base aceeb40 (image):

CANCELLED JOB - The following job was cancelled. Please retry:

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.

This was referenced Jul 10, 2026
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.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants