Skip to content

[ExecuTorch][WebGPU] Op-tests for linear_qcs4w#21212

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

[ExecuTorch][WebGPU] Op-tests for linear_qcs4w#21212
JCNTH wants to merge 2 commits into
gh/JCNTH/172/basefrom
gh/JCNTH/172/head

Conversation

@JCNTH

@JCNTH JCNTH commented Jul 22, 2026

Copy link
Copy Markdown
Contributor

Stack from ghstack (oldest at bottom):

Problem: The new et_vk.linear_qcs4w op needs golden coverage — and, being a quantized op reachable only through a specific quantizer, a test that actually produces the op and validates the fake-quant numerics.

Solution: make_qcs4w_linear_module runs a plain nn.Linear through the VulkanQuantizer weight-only 4-bit path (get_symmetric_quantization_config(is_dynamic=False, weight_bits=4) -> prepare_pt2e -> calibrate -> convert_pt2e), and the op-test module_factory returns the CONVERTED module, so the WebGPU output is goldened against the converted eager (fp32 per-channel fake-quant reference). This exercises the int4 unpack + per-channel dequant end-to-end. bias=False keeps the golden focused on qcs4w (a Linear bias lowers to a separate aten.add).

Implementation: cases.py registers linear_qcs4w with basic (4x32x16), gemv (M=1 decode shape), k64 (2x64x8), n32 (3x32x32) — all with K even (2 nibbles/byte) and N*ceil(K/2) % 4 == 0 (u32-packed weight); test_linear_qcs4w.py holds the module + a delegation smoke test asserting et_vk.linear_qcs4w is absorbed into the VulkanBackend delegate.
@exported-using-ghexport

Differential Revision: D112257668

Differential Revision: D112257668

[ghstack-poisoned]
@pytorch-bot

pytorch-bot Bot commented Jul 22, 2026

Copy link
Copy Markdown

🔗 Helpful Links

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

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

⏳ 13 Pending, 2 Unrelated Failures

As of commit 866e358 with merge base 4a26c64 (image):

FLAKY - The following jobs failed but were likely due to flakiness present on trunk:

This comment was automatically generated by Dr. CI and updates every 15 minutes.

This was referenced Jul 22, 2026
This was referenced Jul 22, 2026
@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 22, 2026
@JCNTH
JCNTH requested a review from psiddh July 23, 2026 02:01

@psiddh psiddh left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approving full WebGPU stack

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

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