{{ message }}
[ExecuTorch][WebGPU] Dynamic resize hook for slice_copy (dynamic start/end)#20581
Open
JulianCloudNTH wants to merge 6 commits into
Open
[ExecuTorch][WebGPU] Dynamic resize hook for slice_copy (dynamic start/end)#20581JulianCloudNTH wants to merge 6 commits into
JulianCloudNTH wants to merge 6 commits into
Conversation
This was referenced Jun 28, 2026
This PR needs a
|
Contributor
Author
|
@claude review and check for any areas or opportunities for modularization |
SS-JIA
approved these changes
Jul 2, 2026
SS-JIA
left a comment
Contributor
There was a problem hiding this comment.
Review automatically exported from Phabricator review in Meta.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Stack from ghstack (oldest at bottom):
Make
slice_copysupport a dynamic gather range so the RoPE-freqs slice[input_pos : input_pos + S]works under one dynamic graph.Problem: the static slice handler read
startvia a scalar reader that throws on a SymInt and ignoredend(output length baked AOT). The RoPE-freqs slice uses a SymIntinput_posfor start and a live S for the range, so the static op could neither build nor resize for it.Solution: read start/end as possibly-dynamic SymInts and add a resize hook that recomputes the gather offset and live output length each step.
startis a static scalar (SymInt throws);endignored; output length fixed at the serialized max.start/endread via a SymInt-aware reader; a hook recomputesout[dim] = (end - start + step - 1) / step, rewritesout_meta/in_meta/paramsUBOs + the dispatch count, and sets the outputcur_dims.Implementation:
start/endvalue-ids when they are SymInts and on the input tensor always (inert until resized, so a static slice is byte-identical).TensorMetarebuilt from live dims;dim/stepstay static.own_uniform_bufferso the hook can rewrite them.resize_slice_copy_node.Constraints: fp32-only;
dim/stepstatic; numerics + layout unchanged; inert on a static graph.NOTE (stacking): this diff sits on top of the in-review
slice_copyop (D108793168); rebase onto it once that op lands on master.Co-authored-with: Claude Code.
@exported-using-ghexport
Differential Revision: D109906092
Differential Revision: D109906092