[Mlir-commits] [mlir] [mlir][linalg] Use maximumf with a finite neutral element in softmax decomposition (PR #213797)

Charitha Saumya llvmlistbot at llvm.org
Thu Aug 6 11:55:48 PDT 2026


charithaintc wrote:

> The previous PR did not explain what was being folded or where, and `maxnumf` really isn't the best choice for softmax.
> 
> The PR also references the difference between decomposition and generalization, but did not argue that the decomposition was wrong, and not the generalization.
> 
> I'm guessing the folding was in IREE and not MLIR upstream, which makes it the wrong fix. Upstream softmax should decompose and generalize to `maximumf`, and downstream projects can update their own folding.
> 
> Did you make sure that both decomposition AND generalization agree on the form? We should have LIT tests for a round trip.

It looks like softmax does not implement the interface required for `structured.generalize` (probably because there is no way to represent it using a single generic op?). So only way to lower it down to generics is using `decompose_interface` which the PR addresses.  

https://github.com/llvm/llvm-project/pull/213797


More information about the Mlir-commits mailing list