[all-commits] [llvm/llvm-project] 36c346: [mlir][linalg] Fix neutral elt for softmax (#118952)

Clément Fournier via All-commits all-commits at lists.llvm.org
Sun Jan 12 23:21:28 PST 2025


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 36c3466aef6c8bfde0ddc736b8403e2c45f5e1c6
      https://github.com/llvm/llvm-project/commit/36c3466aef6c8bfde0ddc736b8403e2c45f5e1c6
  Author: Clément Fournier <clement.fournier at tu-dresden.de>
  Date:   2025-01-13 (Mon, 13 Jan 2025)

  Changed paths:
    M mlir/lib/Dialect/Linalg/IR/LinalgOps.cpp
    M mlir/test/Dialect/Linalg/transform-op-decompose.mlir

  Log Message:
  -----------
  [mlir][linalg] Fix neutral elt for softmax (#118952)

The decomposition of `linalg.softmax` uses `maxnumf`, but the identity
element that is used in the generated code is the one for `maximumf`.
They are not the same, as the identity for `maxnumf` is `NaN`, while the
one of `maximumf` is `-Infty`. This is wrong and prevents the maxnumf
from being folded.

Related to #114595, which fixed the folder for maxnumf.



To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications


More information about the All-commits mailing list