[CPU] Handle ONNX domain Gelu and HardSigmoid activations in the NCHWc transformer suite#27821
Conversation
There was a problem hiding this comment.
Pull request overview
Extends the CPU NCHWc transformer pipeline to treat HardSigmoid like the other supported elementwise activations, enabling both (a) reorder-free passthrough in NCHWc subgraphs and (b) fusion into an upstream NCHWc Conv when eligible.
Changes:
- Add
HardSigmoidhandling inNchwcTransformerImpl::TransformActivation, including passingalpha/betaviaactivation_paramswhen fusing into NCHWcConv. - Recognize
HardSigmoidnodes in the transformer dispatch list (opset since versions 6 and 22). - Add/extend optimizer tests to cover both “no extra reorder” behavior and single-consumer Conv+Activation fusion (including
alpha/betaattribute propagation).
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| onnxruntime/test/optimizer/nchwc_optimizer_test.cc | Adds HardSigmoid coverage for reorder-avoidance and Conv+activation fusion (including activation_params validation). |
| onnxruntime/core/optimizer/nchwc_transformer.cc | Enables HardSigmoid as a supported activation and fuses it into NCHWc Conv with correct default/custom alpha/beta handling. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Optimizer Tests (
|
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Description
As title
Motivation and Context
Tiny continuation to #27691