onnxruntime
6eb43036 - [CPU] Prevent QLinearSoftmax fusion with non-positive input scale (#33568)

Commit
2 days ago
[CPU] Prevent QLinearSoftmax fusion with non-positive input scale (#33568) Prevent CPU QLinearSoftmax from silently returning incorrect results for a non-positive input scale. - **Decline the QDQ fusion** (`DQ -> Softmax -> Q`): Softmax now requires a positive constant input scale via `IsQOrDQScalePositiveConstantScalar` (same policy as #21182 for MaxPool/ReduceMax/ReduceMin). - **Guard the kernel**: `Compute` returns an error for `x_scale <= 0` instead of building an inverted lookup table and silently returning zeros. ### Motivation and Context Fixes #33438. `QlinearBuildLookupTableUint32` centers its exp table on the max quantized value 255, which is only the max real logit for a positive scale. With `x_scale = -1`, `table[0] = exp(338) = inf`, so `vsum = inf` and the output collapses from `[0.99609375, 0]` to `[0, 0]`. The unfused graph is correct; only the fusion corrupts it. Same bug class as #21176/#21182.
Author
Parents
Loading