onnxruntime
2d2ba6b4 - [MLAS/CPU EP] Improve performance of Silu activation path within the QuickGelu CPU kernel (#26753)

Commit
175 days ago
[MLAS/CPU EP] Improve performance of Silu activation path within the QuickGelu CPU kernel (#26753) ### Description The `Silu` activation is basically the same as `QuickGelu` but with the scaling factor (`alpha`) as 1. In cusomer models containing `Silu`, the graph optimizer suite correctly fuses the nodes into a QuickGelu with alpha = 1. This optimizes the implementation of QuickGelu when alpha = 1 by avoiding the scaling and vectorizes the subsequent elementwise multiplication. **Tests:** There are already tests for QuickGelu with alpha = 1 and there are no new tests necessary (https://github.com/microsoft/onnxruntime/blob/f98c756b45b81520c6e2a09c370575a013f02cce/onnxruntime/test/contrib_ops/activation_op_test.cc#L126) **Performance improvements measured:** Gives about 2.5% throughput boost for a customer model that has a lot of Silu activations. ### Motivation and Context Some low hanging fruit perf improvements that give instant easy perf wins --------- Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Author
Parents
Loading