[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 2 commits 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. ⏳ No Failures, 116 PendingAs of commit edf8938 with merge base 4a26c64 ( 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.@exported-using-ghexport
Differential Revision: D112257637
Differential Revision: D112257637