[ExecuTorch][WebGPU] Add q8ta_pixel_shuffle op (int8 pixel_shuffle)#21195
Open
JCNTH wants to merge 1 commit into
Open
[ExecuTorch][WebGPU] Add q8ta_pixel_shuffle op (int8 pixel_shuffle)#21195JCNTH wants to merge 1 commit into
JCNTH wants to merge 1 commit into
Conversation
🔗 Helpful Links🧪 See artifacts and rendered test results at hud.pytorch.org/pr/pytorch/executorch/21195
Note: Links to docs will display an error until the docs builds have been completed. ❗ 1 Active SEVsThere are 1 currently active SEVs. If your PR is affected, please view them below: ❌ 34 New Failures, 3 Unrelated FailuresAs of commit 72f40ab with merge base 266e0dc ( NEW FAILURES - The following jobs have failed:
FLAKY - The following jobs failed but were likely due to flakiness present on trunk:
BROKEN TRUNK - The following job 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 was referenced Jul 22, 2026
This was referenced Jul 22, 2026
psiddh
approved these changes
Jul 23, 2026
psiddh
left a comment
Contributor
There was a problem hiding this comment.
Approving full WebGPU stack
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Stack from ghstack (oldest at bottom):
Problem: The WebGPU delegate has no quantized pixel_shuffle — the last C1 q8ta elementwise/shape op on the int8 path C0 established.
Solution: Port
et_vk.q8ta_pixel_shuffle(int8[N, C*r*r, H, W]-> int8[N, C, H*r, W*r]): gather via the pixel_shuffle inverse, then dequantize -> requantize per element. Reuses the landed fp32pixel_shufflegather index math + the C0/q8ta_addint8 pack/unpack + requant.Implementation:
Q8taPixelShuffle.cppregisterset_vk.q8ta_pixel_shuffle.default(out = args.back()); one thread per packed output word gathers 4 int8 elements from arbitrary input positions (c_in = c_out*r*r + (h_out%r)*r + (w_out%r),h_in = h_out/r,w_in = w_out/r), eachclamp(round(input_scale*(q - input_zero_point) * output_inv_scale) + output_zero_point, -128, 127). Guards int8 in/out + equalnumel+numel % 4 == 0+in_c % (r*r) == 0, fail-loud; a resize hook (supports_resize=True) recomputes shape/numel/dispatch + rewrites the UBO. Mirrors Vulkanq8ta_pixel_shuffle.glsl.Constraints / divergences: (1) the schema's 4th arg is
output_inv_scale(already1/output_scale) — passed straight, NOT re-inverted (unlikeq8ta_relu/q8ta_add). (2) Vulkan uses a channels-packedint8x4layout; this port uses the backend's flat NCHW buffer (always-buffer design) with a re-derived gather — logically identical for a per-tensor-quantized rearrange (byte-exact vs the eager op). (3) Vulkan's same-qparams passthrough fast-path is omitted; the general dequant->requant is byte-identical there (round((q-zp)*s*(1/s))+zp == q).Differential Revision: D112257587