[ExecuTorch][WebGPU] Test: rms_norm workgroup size is runtime-configurable#20956
Conversation
🔗 Helpful Links🧪 See artifacts and rendered test results at hud.pytorch.org/pr/pytorch/executorch/20956
Note: Links to docs will display an error until the docs builds have been completed. ✅ No FailuresAs of commit 0caed86 with merge base e500fee ( This comment was automatically generated by Dr. CI and updates every 15 minutes. |
This PR needs a
|
…rable Pull Request resolved: #20956 Add a native gtest that locks the wg-size configurability guarantee: the same rms_norm WGSL, run at override `wg_size` 64 and 128, must produce the same output. `Module::forward` always uses the handler-clamped size (64), so the test builds the compute pipeline directly and sets `wg_size` via a `WGPUConstantEntry`, mirroring the runtime pipeline setup + `WebGPUGraph::copy_outputs` readback. Key changes: - `test/test_webgpu_native.cpp` — `run_rms_norm_at_wg()` standalone-pipeline helper + `RmsNormWorkgroupSizeConfigurable` test (element-wise agree within abs 1e-4 / rel 1e-3, plus a non-zero sanity guard). Self-contained (no `.pte`/export), so it runs inside `webgpu_native_test` under `test_webgpu_native_ci.sh` with no new wiring. Absolute rms_norm correctness stays covered by the model-driven golden tests; this adds the "128 matches 64" guarantee. Co-authored-with: Claude Code. ghstack-source-id: 403097259 @exported-using-ghexport Differential Revision: [D112060302](https://our.internmc.facebook.com/intern/diff/D112060302/)
digantdesai
left a comment
There was a problem hiding this comment.
Review automatically exported from Phabricator review in Meta.
…rable Pull Request resolved: #20956 Add a native gtest that locks the wg-size configurability guarantee: the same rms_norm WGSL, run at override `wg_size` 64 and 128, must produce the same output. `Module::forward` always uses the handler-clamped size (64), so the test builds the compute pipeline directly and sets `wg_size` via a `WGPUConstantEntry`, mirroring the runtime pipeline setup + `WebGPUGraph::copy_outputs` readback. Key changes: - `test/test_webgpu_native.cpp` — `run_rms_norm_at_wg()` standalone-pipeline helper + `RmsNormWorkgroupSizeConfigurable` test (element-wise agree within abs 1e-4 / rel 1e-3, plus a non-zero sanity guard). Self-contained (no `.pte`/export), so it runs inside `webgpu_native_test` under `test_webgpu_native_ci.sh` with no new wiring. Absolute rms_norm correctness stays covered by the model-driven golden tests; this adds the "128 matches 64" guarantee. Co-authored-with: Claude Code. ghstack-source-id: 403097259 @exported-using-ghexport Differential Revision: [D112060302](https://our.internmc.facebook.com/intern/diff/D112060302/)
…rable Pull Request resolved: #20956 Add a native gtest that locks the wg-size configurability guarantee: the same rms_norm WGSL, run at override `wg_size` 64 and 128, must produce the same output. `Module::forward` always uses the handler-clamped size (64), so the test builds the compute pipeline directly and sets `wg_size` via a `WGPUConstantEntry`, mirroring the runtime pipeline setup + `WebGPUGraph::copy_outputs` readback. Key changes: - `test/test_webgpu_native.cpp` — `run_rms_norm_at_wg()` standalone-pipeline helper + `RmsNormWorkgroupSizeConfigurable` test (element-wise agree within abs 1e-4 / rel 1e-3, plus a non-zero sanity guard). Self-contained (no `.pte`/export), so it runs inside `webgpu_native_test` under `test_webgpu_native_ci.sh` with no new wiring. Absolute rms_norm correctness stays covered by the model-driven golden tests; this adds the "128 matches 64" guarantee. Co-authored-with: Claude Code. ghstack-source-id: 403097259 @exported-using-ghexport Differential Revision: [D112060302](https://our.internmc.facebook.com/intern/diff/D112060302/)
Stack from ghstack (oldest at bottom):
Add a native gtest that locks the wg-size configurability guarantee: the same rms_norm WGSL, run at override
wg_size64 and 128, must produce the same output.Module::forwardalways uses the handler-clamped size (64), so the test builds the compute pipeline directly and setswg_sizevia aWGPUConstantEntry, mirroring the runtime pipeline setup +WebGPUGraph::copy_outputsreadback.Key changes:
test/test_webgpu_native.cpp—run_rms_norm_at_wg()standalone-pipeline helper +RmsNormWorkgroupSizeConfigurabletest (element-wise agree within abs 1e-4 / rel 1e-3, plus a non-zero sanity guard).Self-contained (no
.pte/export), so it runs insidewebgpu_native_testundertest_webgpu_native_ci.shwith no new wiring. Absolute rms_norm correctness stays covered by the model-driven golden tests; this adds the "128 matches 64" guarantee.Co-authored-with: Claude Code.
@exported-using-ghexport
Differential Revision: D112060302
Differential Revision: D112060302