onnxruntime
dededdcc - Fix GeluFusion for unsupported CPU dtypes (#32431)

Commit
49 days ago
Fix GeluFusion for unsupported CPU dtypes (#32431) ### Description Fixes #32386. For opsets below 20, `GeluFusion` replaces the standard Erf-based GELU decomposition with `com.microsoft::Gelu(1)`. On CPU that contrib kernel is registered only for `tensor(float)`, but the fusion currently accepts `tensor(float16)` and `tensor(double)`. On Linux ARM64 an fp16 graph can therefore become a fused node with no compatible CPU kernel and session initialization fails. This change makes `GeluFusion` validate the CPU dtype against the operator domain it will emit: - `com.microsoft::Gelu` CPU fusion is limited to `float`. - ONNX `Gelu(20)` CPU fusion continues to support `float` and `float16`. - Other execution providers retain their existing behavior. ### Tests Adds graph-level regression coverage confirming that an opset-17 CPU float graph still fuses while the same CPU float16 graph remains as the valid standard ONNX decomposition. --------- Signed-off-by: Sylvester Kaczmarek <sylvesterkaczmarek@users.noreply.github.com> Co-authored-by: Sylvester Kaczmarek <sylvesterkaczmarek@users.noreply.github.com>
Parents
Loading