onnxruntime
cfaf942c - WebGPU: Add HardSwish support (#29828)

Commit
33 days ago
WebGPU: Add HardSwish support (#29828) ### Description `HardSwish` currently falls off the WebGPU partition because the EP has no native kernel and no decomposition pass rewrites it into WebGPU-supported ops. This change adds direct WebGPU support so `HardSwish` stays on device for f32/f16 models. ### Motivation and Context - `HardSwish` is common in mobile and vision models, such as MobileNet V3 and [MediaPipe's Selfie Segmenter](https://developers.google.com/edge/mediapipe/solutions/vision/image_segmenter#models); without native WebGPU support it falls back to CPU, introducing avoidable GPU↔CPU transfers. - This change closes that gap by keeping `HardSwish` execution on WebGPU with the same fixed semantics as the ONNX operator. Fix #29756 --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Author
Parents
Loading