[ExecuTorch][WebGPU] Port 10 unary activations to the WebGPU backend#21154
[ExecuTorch][WebGPU] Port 10 unary activations to the WebGPU backend#21154JCNTH wants to merge 1 commit into
Conversation
🔗 Helpful Links🧪 See artifacts and rendered test results at hud.pytorch.org/pr/pytorch/executorch/21154
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, 2 Unrelated FailuresAs of commit 510a256 with merge base 266e0dc ( NEW FAILURE - The following job has failed:
FLAKY - The following job failed but was likely due to flakiness present on trunk:
BROKEN TRUNK - The following job failed but was 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):
Ports the Vulkan delegate's no-param unary activations —
abs,exp,sqrt,rsqrt,sin,cos,tanh,round,neg,hardswish— built on the sharedadd_unary_ophelper. Each is a per-op.wgsl(2D-fold dispatch,wg_size=256) whose body mirrors the Vulkan formula inbackends/vulkan/runtime/graph/ops/glsl/unary_op.yaml+activations.hverbatim, registered throughruntime/ops/unary/Activations.cpp.Key changes:
runtime/ops/unary/{abs,exp,sqrt,rsqrt,sin,cos,tanh,round,neg,hardswish}.wgsl(+ generated_wgsl.h) —output[idx] = <vulkan-math>; notablyrsqrt=1.0 / sqrt(x),tanh=tanh(clamp(x, -15.0, 15.0)),hardswish= the piecewiseselect.runtime/ops/unary/Activations.cpp— registersaten.<op>.defaultfor the 10 ops, each calling the sharedadd_unary_op.CMakeLists.txt—runtime/ops/unary/Activations.cppinWEBGPU_SRCS.tanandhardsigmoidare intentionally excluded: the Vulkan partitioner (backends/vulkan/op_registry.py) does not tag them, so they cannot be delegated to this backend without a separate partitioner change.Differential Revision: D112257637