[ExecuTorch][WebGPU] Add q8ta_add op (int8 elementwise add)#21191
Conversation
🔗 Helpful Links🧪 See artifacts and rendered test results at hud.pytorch.org/pr/pytorch/executorch/21191
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: ❌ 22 New Failures, 3 Unrelated FailuresAs of commit f2e0a24 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 PR needs a
|
psiddh
left a comment
There was a problem hiding this comment.
Approving full WebGPU stack
Stack from ghstack (oldest at bottom):
Problem: The WebGPU delegate has no quantized elementwise add — the first C1 q8ta op, on the int8 activation path C0 established.
Solution: Port
et_vk.q8ta_add(two int8 tensors + per-tensor qparams -> int8): dequantize both, computea + alpha*b, requantize. Reuses the C0 int8 buffer path (array<u32>pack/unpack,is_int8guard, multiply-by-inv_scale).Implementation:
Q8taAdd.cppregisterset_vk.q8ta_add.default(out = args.back()), guards all three tensors int8 + equalnumel+numel % 4 == 0, fail-loud;q8ta_add.wgslunpacks 4 int8/word, dequantizesscale*(q - zero_point), formsa + alpha*b, and requantizesclamp(round(v * inv_output_scale) + zero_point, -128, 127). Mirrors Vulkanq8ta_binary.glsl+common.glslh, with one deliberate divergence: the Vulkan glsl buffer kernel dropsalpha(computesa + b), so this port implements the fulla + alpha*bto match the CPU reference for anyalpha(surfaced in the handler comment).Constraints: same-shape only (no broadcast — the equal-
numelguard rejects it, matching theaddop baseline);supports_resize=False(no resize hook), mirroring the partitioner.Differential Revision: D112257597