[ExecuTorch][WebGPU] Add slice_copy op (aten.slice_copy.Tensor)#20394
[ExecuTorch][WebGPU] Add slice_copy op (aten.slice_copy.Tensor)#20394JulianCloudNTH wants to merge 2 commits into
Conversation
🔗 Helpful Links🧪 See artifacts and rendered test results at hud.pytorch.org/pr/pytorch/executorch/20394
Note: Links to docs will display an error until the docs builds have been completed. ❌ 2 New Failures, 1 Cancelled Job, 5 Unrelated FailuresAs of commit 92bf354 with merge base 0e65ba6 ( NEW FAILURES - The following jobs have failed:
CANCELLED JOB - The following job was cancelled. Please retry:
BROKEN TRUNK - The following jobs 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
|
|
@claude review |
|
Claude finished @JulianCloudNTH's task in 2m 27s —— View job Code Review:
|
Stack from ghstack (oldest at bottom):
Adds
aten.slice_copy.Tensorto the WebGPU delegate as a gather: each output element is mapped back to its source input element along the sliced dim viastart + coord * step.Composition (single compute dispatch):
runtime/ops/slice/Slice.cpp— readsargs = [self, dim, start, end, step, out]viaread_scalar(staticInt/Null-sentinel default; throws on dynamicSymInt); normalizes negativedim/start, clampsstartto[0, in_size]; builds twoTensorMetaUBOs + aSliceParams{dim, start, step}uniform; guards fp32; dispatches overcompute_1d_workgroup_count(out.numel)withoverride wg_size; releases all uniforms after the bind group.runtime/ops/slice/slice.wgsl— delinearizes the output index over the contiguous output strides, maps the sliced-dim coordinate back to the input (start + coord*step), relinearizes over the input strides.@exported-using-ghexport
Differential Revision: D108793168
Differential Revision: D108793168