[ExecuTorch][WebGPU] Add q8ta_relu op (int8 relu)#21193
Conversation
🔗 Helpful Links🧪 See artifacts and rendered test results at hud.pytorch.org/pr/pytorch/executorch/21193
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: ❌ 32 New Failures, 4 Unrelated FailuresAs of commit 9f24dd4 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 relu — a C1 q8ta activation on the int8 path C0 established.
Solution: Port
et_vk.q8ta_relu(int8 -> int8): dequantize,max(x, 0), requantize. Reuses the C0 int8 buffer path (array<u32>pack/unpack,is_int8guard, multiply-by-inv_scale), likeq8ta_add.Implementation:
Q8taRelu.cppregisterset_vk.q8ta_relu.default(out = args.back()), guards in/out int8 + equalnumel+numel % 4 == 0, fail-loud;q8ta_relu.wgslcomputesclamp(round(max(input_scale*(q - input_zero_point), 0) * inv_output_scale) + output_zero_point, -128, 127), packed 4 int8/word. Mirrors Vulkanq8ta_unary.glsl(OPERATOR = max(X, 0)) +common.glslh. Unlikeq8ta_add, the partitioner setssupports_resize=True, so a resize hook recomputesnumel+ dispatch + rewrites the UBO on dynamic shapes (re-applying thenumel % 4guard), mirroring the landed elementwise hooks.Differential Revision: D112257646