Skip to content

[ExecuTorch][WebGPU] Remove the orphan q4gsw_linear_coop4 shader#20955

Open
JCNTH wants to merge 2 commits into
gh/JCNTH/87/basefrom
gh/JCNTH/87/head
Open

[ExecuTorch][WebGPU] Remove the orphan q4gsw_linear_coop4 shader#20955
JCNTH wants to merge 2 commits into
gh/JCNTH/87/basefrom
gh/JCNTH/87/head

Conversation

@JCNTH

@JCNTH JCNTH commented Jul 15, 2026

Copy link
Copy Markdown

Stack from ghstack (oldest at bottom):

q4gsw_linear_coop4.wgsl is an unwired dead shader: no handler #includes its generated q4gsw_linear_coop4_wgsl.h, and it is superseded by q4gsw_linear_coop4_bicol.wgsl (the live GEMV decode kernel that QuantizedLinear.cpp uses). Remove the shader and its generated header.

Key changes:

  • Deleted q4gsw_linear_coop4.wgsl and q4gsw_linear_coop4_wgsl.h.
  • Dropped a stale reference to the removed kernel in test_quantized_linear.py and test_webgpu_native.cpp comments.

No build/CMake change: WEBGPU_SRCS lists only .cpp, and shaders wire via the gen_wgsl_headers.py glob (no static list), so removing both files leaves codegen drift-clean.

Co-authored-with: Claude Code.
@exported-using-ghexport

Differential Revision: D112060303

Differential Revision: D112060303

[ghstack-poisoned]
@pytorch-bot

pytorch-bot Bot commented Jul 15, 2026

Copy link
Copy Markdown

🔗 Helpful Links

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

Note: Links to docs will display an error until the docs builds have been completed.

❌ 1 New Failure

As of commit 741c146 with merge base e500fee (image):

NEW FAILURE - The following job has failed:

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 Jul 15, 2026
@github-actions

Copy link
Copy Markdown

This PR needs a release notes: label

If your change should be included in the release notes (i.e. would users of this library care about this change?), please use a label starting with release notes:. This helps us keep track and include your important work in the next release notes.

To add a label, you can comment to pytorchbot, for example
@pytorchbot label "release notes: none"

For more information, see
https://github.com/pytorch/pytorch/wiki/PyTorch-AutoLabel-Bot#why-categorize-for-release-notes-and-how-does-it-work.

@JCNTH

JCNTH commented Jul 15, 2026

Copy link
Copy Markdown
Author

@claude Review this PR

@claude

claude Bot commented Jul 15, 2026

Copy link
Copy Markdown

Claude finished @JCNTH's task in 59s —— View job


Review — Remove orphan q4gsw_linear_coop4 shader

  • Gather context (PR diff, base branch)
  • Verify the shader is truly orphaned (no #include of generated header)
  • Verify the superseding kernel (_bicol) is the live one
  • Check test comment / native test edits
  • Confirm codegen wiring (glob, not static list)

Verdict: LGTM. This is a clean, correct dead-code removal. Every claim in the PR description is verifiable.

What I verified

  1. The shader is genuinely orphaned. Grepping the whole tree for q4gsw_linear_coop4_wgsl.h (the generated header for the deleted shader) returns zero includes. Nothing consumes it.

  2. _bicol is the live kernel. QuantizedLinear.cpp:13 includes q4gsw_linear_coop4_bicol_wgsl.h — a distinct file that is not touched by this PR. The naming is close enough to be a footgun, but they are two separate shaders and only the non-_bicol one is removed. Good.

  3. Codegen wiring is glob-based, so no static list to update. gen_wgsl_headers.py:496 discovers shaders via (BACKEND_ROOT / "runtime/ops").glob("**/*.wgsl") — no hardcoded manifest. CMakeLists.txt:28 WEBGPU_SRCS lists only .cpp files, and the --check step (line 64) verifies committed _wgsl.h match their .wgsl. Deleting both the .wgsl and its _wgsl.h together keeps the drift check clean, as the description states.

  4. Comment edits are accurate. Both test_quantized_linear.py and test_webgpu_native.cpp just drop the parenthetical "(mirrors coop4's general-N robustness)" from the bicol odd-N guard comment. The surrounding sentence still reads correctly and the guard behavior it describes is unchanged.

Notes

  • The test_webgpu_native.cpp edit isn't mentioned in the PR description's "Key changes" list (which only cites the .py comment), but the change itself is the same benign comment cleanup, so no action needed — just worth flagging for the description.
  • The reported CI failure (pull / android / run-emulator) is unrelated to this change — no Android or emulator surface is touched by deleting a WebGPU compute shader.

Nice tightly-scoped cleanup.
· branch gh/JCNTH/87/head

[ghstack-poisoned]
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. meta-exported

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants