onnxruntime
0f3cf6cc - [WebGPU] Add transpose-optimizer handlers for Elu and the contrib GELU variants (#32118)

Commit
21 days ago
[WebGPU] Add transpose-optimizer handlers for Elu and the contrib GELU variants (#32118) ### Description `OrtExtendedHandlers()` had no entries for `com.microsoft.Gelu`, `FastGelu` and `QuickGelu`, and the ONNX map was missing `Elu`, so layout propagation stopped at the activation and left a transpose wedged between the NHWC Conv and the activation where `ConvActivationFusion` never saw them adjacent. Results stayed correct, the fusion just silently did not fire. `FastGelu` needs a bespoke handler rather than a table entry because its optional bias is pinned to the last dimension, and `broadcast_node_handler` would rank-normalize it into a rank-4 bias that fails `bias_gelu_helper::CheckInputs` outright, so the handler pushes the transpose only when there is no bias. `Elu` lives here rather than in #32117 because the transpose optimizer is shared cross-EP infrastructure, not WebGPU code. This also registers `FastGeluFusion` for WebGPU, which was cpu, cuda and dml only, since `GeluFusion` and `BiasGeluFusion` already landed in #32053. Covered by 6 fusion tests and 5 transpose-optimizer tests, including a negative test that `FastGelu` with a bias is left alone. ### Motivation and Context Models often already contain contrib GELU nodes, since `QuickGeluFusion` and `GeluFusion` run before layout transformation, so without these handlers the Conv activation fusion never fires on exactly the models most likely to benefit. #32117 adds the WebGPU side of the same work and needs these handlers to fuse end to end. --------- Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Co-authored-by: Ananya Anand <t-anaanand@microsoft.com>
Author
Parents
Loading