onnxruntime
8d399fe7 - Fix QuickGelu fusion for unsupported CPU dtypes (#32427)

Commit
6 days ago
Fix QuickGelu fusion for unsupported CPU dtypes (#32427) ### Description Fixes #32421. `QuickGeluFusion` can replace a valid CPU `Mul -> Sigmoid -> Mul` QuickGELU decomposition with `com.microsoft::QuickGelu` for `tensor(double)`. The CPU QuickGelu kernel is registered only for `tensor(float)`, so enabling extended graph optimizations can turn a runnable model into one that fails during session initialization. The fusion now checks the execution provider and only creates QuickGelu for CPU inputs supported by the CPU kernel. Other execution providers keep their existing behavior; in particular, CUDA continues to support `double`. Regression coverage verifies that CPU `float` graphs are still fused and CPU `double` graphs remain unfused. ### Motivation and Context Graph optimizations must preserve model executability. This keeps the standard ONNX decomposition when fusing it would create a contrib op for which the selected CPU execution provider has no compatible kernel.
Parents
Loading