[ExecuTorch][WebGPU] Port flip#21166
Conversation
🔗 Helpful Links🧪 See artifacts and rendered test results at hud.pytorch.org/pr/pytorch/executorch/21166
Note: Links to docs will display an error until the docs builds have been completed. ❗ 1 Active SEVsThere are 1 currently active SEVs. If your PR is affected, please view them below: ✅ You can merge normally! (1 Unrelated Failure)As of commit 2c8f8af with merge base 266e0dc ( BROKEN TRUNK - The following job failed but were present on the merge base:👉 Rebase onto the `viable/strict` branch to avoid these failures
This comment was automatically generated by Dr. CI and updates every 15 minutes. |
This PR needs a
|
psiddh
left a comment
There was a problem hiding this comment.
Approving full WebGPU stack
Stack from ghstack (oldest at bottom):
Ports
aten.flip.defaultas a per-element index-transform, mirroring the landedpermuteop (same dual-TensorMeta+ 5-binding bind group). flip is pure data movement, so it reverses the coord along each flagged dim and copies — no fp compute.Key changes:
runtime/ops/flip/{Flip.cpp, flip.wgsl}(+ generatedflip_wgsl.h) — per out flat idx: unravel viaout_meta.strides,in_coord = select(coord, sizes[d]-1-coord, flip[d]==1), ravel viain_meta.strides,output[out] = input[in];Params { flip: vec4<u32> }bitmap built from the normalizeddimsarg; registeredaten.flip.default.CMakeLists.txt—runtime/ops/flip/Flip.cppinWEBGPU_SRCS.Matches Vulkan
impl/Flip.cpp(create_whcn_bitmapnormalizes/flags dims; reversalsize-1-coord). No int dtype-guard (unlike clamp/minimum which do fp arithmetic): flip is bit-preserving movement, so any 4-byte dtype is correct; thenbytes != numel*4guard rejects int64/fp16. 2D-folded dispatch lifts the 65535 cap.outis the last arg (this backend's convention).Differential Revision: D112257643