[ExecuTorch][WebGPU] Add dequantize_per_tensor op (int8 buffer path)#21188
[ExecuTorch][WebGPU] Add dequantize_per_tensor op (int8 buffer path)#21188JCNTH wants to merge 1 commit into
Conversation
🔗 Helpful Links🧪 See artifacts and rendered test results at hud.pytorch.org/pr/pytorch/executorch/21188
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: ❌ 1 New Failure, 1 Unrelated FailureAs of commit bfdc3e2 with merge base 266e0dc ( NEW FAILURE - The following job has failed:
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 per-tensor dequantization — the int8 -> fp32 half of the C0 quant gate, needed at the fp32 boundaries of a quantized graph.
Solution: Port
quantized_decomposed.dequantize_per_tensor.default(int8 -> fp32). The int8 input is read asarray<u32>(4 elements per word), each byte sign-extended, matching the layoutquantize_per_tensorwrites.Implementation:
DequantizePerTensor.cppregisters only.default, takesout = args.back()(robust to the extraout_dtypekwarg this overload carries), and guards int8 input (is_int8) /numel % 4 == 0/ fp32 output / non-null buffers, fail-loud.dequantize_per_tensor.wgslunpacks each byte, sign-extends via(b ^ 0x80) - 128, and computes(q - zero_point) * scale. Mirrors Vulkanruntime/graph/ops/glsl/q8ta_dequantize.glsl+impl/QuantizeDequantize.cpp.Differential Revision: D112257669