Skip to content

[ExecuTorch][WebGPU] SymInt live-scalar mechanism + et_vk.select_as_symint#20206

Merged
JulianCloudNTH merged 1 commit into
gh/JulianCloudNTH/17/origfrom
gh/JulianCloudNTH/18/orig
Jun 10, 2026
Merged

[ExecuTorch][WebGPU] SymInt live-scalar mechanism + et_vk.select_as_symint#20206
JulianCloudNTH merged 1 commit into
gh/JulianCloudNTH/17/origfrom
gh/JulianCloudNTH/18/orig

Conversation

@pytorchbot

Copy link
Copy Markdown
Collaborator

This PR was created by the merge bot to help merge the original PR into the main branch.
ghstack PR number: #20085 by @JulianCloudNTH
^ Please use this as the source of truth for the PR details, comments, and reviews
ghstack PR base: https://github.com/pytorch/executorch/tree/gh/JulianCloudNTH/18/base
ghstack PR head: https://github.com/pytorch/executorch/tree/gh/JulianCloudNTH/18/head
Merge bot PR base: https://github.com/pytorch/executorch/tree/gh/JulianCloudNTH/17/orig
Merge bot PR head: https://github.com/pytorch/executorch/tree/gh/JulianCloudNTH/18/orig

@diff-train-skip-merge

…ymint

Pull Request resolved: #20085

Adds the dynamic-scalar (SymInt) mechanism to the WebGPU graph as a standalone enabler, ahead of the SDPA op that consumes it. Mirrors the Vulkan delegate's SymInt = live uniform-buffer design: a `ValueType::SymInt` backed by a 16-byte `Uniform|CopyDst` buffer, `set_symint`/`read_symint`/`symint_buffer` accessors with dirty-tracking, a `SymIntSource` + `add_symint_source`/`update_symints_from_inputs` host-read path, and an `add_resize_hook`/`propagate_resize`/`dispatch_at` recompute plumbing. `WebGPUBackend::execute` calls `propagate_resize` after refreshing the SymInts from the runtime inputs. The `et_vk.select_as_symint` op handler records `out SymInt = x[index]` along a dim at build time.

This diff has no in-graph consumer yet — the SDPA op (stacked above) reads the SymInt value via `read_symint()` for dynamic `input_pos`. Building it as its own diff keeps the enabler separate from the op, matching the update_cache → mechanism → SDPA layering.

Authored with assistance from Claude.
ghstack-source-id: 391979584
@exported-using-ghexport

Differential Revision: [D107584280](https://our.internmc.facebook.com/intern/diff/D107584280/)
@pytorch-bot

pytorch-bot Bot commented Jun 10, 2026

Copy link
Copy Markdown

🔗 Helpful Links

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

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

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

@meta-cla meta-cla Bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label Jun 10, 2026
@JulianCloudNTH JulianCloudNTH self-requested a review June 10, 2026 21:27
@JulianCloudNTH JulianCloudNTH merged commit 674e95e into gh/JulianCloudNTH/17/orig Jun 10, 2026
166 of 168 checks passed
@JulianCloudNTH JulianCloudNTH deleted the gh/JulianCloudNTH/18/orig branch June 10, 2026 21:29
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