Skip to content

[ExecuTorch][WebGPU] view_copy op test suite (cases.py op-test framework)#20530

Merged
JulianCloudNTH merged 7 commits into
gh/JulianCloudNTH/35/origfrom
gh/JulianCloudNTH/36/orig
Jun 26, 2026
Merged

[ExecuTorch][WebGPU] view_copy op test suite (cases.py op-test framework)#20530
JulianCloudNTH merged 7 commits into
gh/JulianCloudNTH/35/origfrom
gh/JulianCloudNTH/36/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: #20361 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/36/base
ghstack PR head: https://github.com/pytorch/executorch/tree/gh/JulianCloudNTH/36/head
Merge bot PR base: https://github.com/pytorch/executorch/tree/gh/JulianCloudNTH/35/orig
Merge bot PR head: https://github.com/pytorch/executorch/tree/gh/JulianCloudNTH/36/orig

@diff-train-skip-merge

…ork)

Pull Request resolved: #20361

Registers `aten.view_copy.default` in the `cases.py` op-test framework: a `_view_copy_suite` of 3 configs (rank-reducing reshape `(2,3,4)->(6,4)`, flatten `->(-1,)`, rank-increasing reshape `->(1,2,3,4)`) that `generate_op_tests` exports via `VulkanPartitioner` and compares to a torch golden on Dawn. Also adds `test/ops/view_copy/test_view_copy.py` (`ViewModule` + `CONFIGS` + export-delegation/eager smoke test) and the `aten.view_copy.default` partitioner-allowlist entry in `tester.py`.
ghstack-source-id: 397026501
@exported-using-ghexport

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

pytorch-bot Bot commented Jun 26, 2026

Copy link
Copy Markdown

🔗 Helpful Links

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

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 26, 2026
Pull Request resolved: #20362

Adds `aten.select_copy.int` to the WebGPU delegate as a gather: picks a fixed index along one dim, producing an output of rank (input rank - 1).

Composition (single dispatch):
- `select/Select.cpp` — reads `[self, dim, index, out]` (static `Int` via `read_scalar`; throws on dynamic `SymInt`), normalizes + bounds-checks dim/index, builds 2 `TensorMeta` UBOs + a `SelectParams{dim,index}`, fp32 guard, 1D-dispatch over `numel`, releases uniforms after the bind group.
- `select/select.wgsl` — seeds the input offset with `index * in.strides[dim]`, delinearizes the output index, maps each out dim to its in dim (shifted past the selected dim), relinearizes on input strides.
ghstack-source-id: 397026510
@exported-using-ghexport

Differential Revision: [D108793166](https://our.internmc.facebook.com/intern/diff/D108793166/)
…ework)

Pull Request resolved: #20363

Registers `aten.select_copy.int` in the `cases.py` op-test framework: a `_select_suite` of 4 configs (leading/middle/last dim + negative index) that `generate_op_tests` exports and compares to a torch golden on Dawn. Also adds `test/ops/select/test_select.py` (`SelectModule` + `CONFIGS` + an export-delegation/eager smoke test) and the `aten.select_copy.int` partitioner-allowlist entry in `tester.py`.
ghstack-source-id: 397026513
@exported-using-ghexport

Differential Revision: [D108793161](https://our.internmc.facebook.com/intern/diff/D108793161/)
Pull Request resolved: #20390

Adds `aten.sigmoid.default` to the WebGPU delegate: element-wise `1/(1+exp(-x))` over a flat fp32 buffer. On the Llama critical path (`F.silu` -> `sigmoid` + `mul`).

Composition (single dispatch):
- `sigmoid/UnaryOp.cpp` — binds input (storage, read-only) + output (storage) + a `Params{num_elements}` uniform, 1D-dispatches over `num_elements` with `override wg_size` (clamped to the device limit); mirrors the `add` op (uniform mapped-at-creation, released after the bind group).
- `sigmoid/sigmoid.wgsl` — guards `idx >= num_elements` and writes the logistic of each element.
ghstack-source-id: 397026515
@exported-using-ghexport

Differential Revision: [D108793157](https://our.internmc.facebook.com/intern/diff/D108793157/)
Pull Request resolved: #20391

Registers `aten.sigmoid.default` in the `cases.py` op-test framework: a `_sigmoid_suite` (hard-coded shapes + a saturation case over a `linspace(-12, 12)` input) that `generate_op_tests` exports and compares to an fp64 torch golden on Dawn. Also adds `test/ops/sigmoid/test_sigmoid.py` (`SigmoidModule` + `N` + `_det_input` + an export-delegation/eager smoke test) and the `aten.sigmoid.default` partitioner-allowlist entry in `tester.py`.
ghstack-source-id: 397026520
@exported-using-ghexport

Differential Revision: [D108793159](https://our.internmc.facebook.com/intern/diff/D108793159/)
Pull Request resolved: #20392

Adds `aten.squeeze_copy.dims` and `aten.unsqueeze_copy.default` to the WebGPU delegate. Both are numel-preserving shape ops; on a dense row-major buffer backend they are the same flat copy as `view_copy` — only the shape metadata differs (mirrors the Vulkan delegate, which routes both through `add_view_copy_node`).

Composition (no new kernel):
- `squeeze/Squeeze.cpp` — reads `args = [self, dims, out]`, ignores the AOT-fixed `dims`, calls `add_flat_copy(graph, in, out)` from `runtime/ops/view_copy/view_copy.h`.
- `unsqueeze/Unsqueeze.cpp` — reads `args = [self, dim, out]`, ignores the AOT-fixed `dim`, calls `add_flat_copy(graph, in, out)`.
ghstack-source-id: 397026523
@exported-using-ghexport

Differential Revision: [D108793153](https://our.internmc.facebook.com/intern/diff/D108793153/)
….py op-test framework)

Pull Request resolved: #20393

Registers `aten.squeeze_copy.dims` and `aten.unsqueeze_copy.default` in the `cases.py` op-test framework: a `_squeeze_suite` of 3 configs (squeeze leading/middle/multiple size-1 dims) and a `_unsqueeze_suite` of 3 configs (insert dim at front/middle/last) that `generate_op_tests` exports via `VulkanPartitioner` and compares to a torch golden on Dawn. Also adds `test/ops/squeeze/test_squeeze.py` (`SqueezeModule` + `CONFIGS` + `_op_delegated` smoke test), `test/ops/unsqueeze/test_unsqueeze.py` (`UnsqueezeModule` + `CONFIGS` + `_op_delegated` smoke test), and the two partitioner-allowlist entries in `tester.py`.
ghstack-source-id: 397026525
@exported-using-ghexport

Differential Revision: [D108793152](https://our.internmc.facebook.com/intern/diff/D108793152/)
@JulianCloudNTH JulianCloudNTH merged commit ae8e7e8 into gh/JulianCloudNTH/35/orig Jun 26, 2026
147 of 153 checks passed
@JulianCloudNTH JulianCloudNTH deleted the gh/JulianCloudNTH/36/orig branch June 26, 2026 15:35
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