[ExecuTorch][WebGPU] Add leaky_relu op#20989
Conversation
🔗 Helpful Links🧪 See artifacts and rendered test results at hud.pytorch.org/pr/pytorch/executorch/20989
Note: Links to docs will display an error until the docs builds have been completed. ❌ 128 New Failures, 3 Unrelated Failures, 7 Unclassified FailuresAs of commit 5ab70af with merge base c2b273e ( NEW FAILURES - The following jobs have failed:
UNCLASSIFIED FAILURES - DrCI could not classify the following jobs because the workflow did not run on the merge base. The failures may be pre-existing on trunk or introduced by this PR:
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
|
Stack from ghstack (oldest at bottom):
Add
aten.leaky_relu.defaultto the WebGPU backend — the SRVGGNetCompact body activation in Real-ESRGAN x4plus super-resolution, so that model can fully delegate to the GPU.Problem: The WebGPU delegate had no
leaky_reluhandler, so a model using it could not produce a fully-delegated.pte.Solution: A scalar-parameter elementwise fp32 kernel computing
x >= 0 ? x : negative_slope * x, withnegative_slopecarried in the uniform and a 2D-spill dispatch for tensors exceeding the 1D workgroup-count limit.Implementation:
runtime/ops/leaky_relu/{LeakyRelu.cpp,leaky_relu.wgsl,leaky_relu_wgsl.h}registeringaten.leaky_relu.default; usesutils::make_compute_pipeline+utils::compute_dispatch_grid.leaky_relu.defaultdelegate (scalar-in-uniform, likepow.Tensor_Scalar).WEBGPU_SRCSentry.Constraints: fp32-only — throws on non-fp32 or input/output size mismatch (fail-loud, never a silent zero output); no change to existing ops.
Differential Revision: D112417289