You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
(Nit: there is also certain inconsistency with the naming of the scalar and vector reduction non-NaN propagating intrinsics. ‘llvm.minnum.*’ and ‘llvm.maxnum.*’ are used for the scalar ones and fmin/fmax suffixed are used for both the predicated and non-predicated vector reduction versions. We should consider renaming them all to minnum/maxnum or fmin/fmax.)
…eductions
This patch is part of a larger initiative aimed at fixing floating-point `max` and `min` operations in MLIR: https://discourse.llvm.org/t/rfc-fix-floating-point-max-and-min-operations-in-mlir/72671.
Within LLVM, there are no masked reduction counterparts for vector reductions such as `fmaximum` and `fminimum`.
More information can be found here: #64940 (comment).
To address this issue in MLIR, where we need to generate appropriate lowerings for these cases, we employ regular non-masked intrinsics.
However, we modify the input vector using the `arith.select` operation to effectively deactivate undesired elements using a "neutral mask value".
The neutral mask value is the smallest possible value for the `fmaximum` reduction and the largest possible value for the `fminimum` reduction.
Depends on D158618
Reviewed By: dcaballe
Differential Revision: https://reviews.llvm.org/D158773
ZijunZhaoCCK
pushed a commit
to ZijunZhaoCCK/llvm-project
that referenced
this issue
Sep 19, 2023
…eductions
This patch is part of a larger initiative aimed at fixing floating-point `max` and `min` operations in MLIR: https://discourse.llvm.org/t/rfc-fix-floating-point-max-and-min-operations-in-mlir/72671.
Within LLVM, there are no masked reduction counterparts for vector reductions such as `fmaximum` and `fminimum`.
More information can be found here: llvm#64940 (comment).
To address this issue in MLIR, where we need to generate appropriate lowerings for these cases, we employ regular non-masked intrinsics.
However, we modify the input vector using the `arith.select` operation to effectively deactivate undesired elements using a "neutral mask value".
The neutral mask value is the smallest possible value for the `fmaximum` reduction and the largest possible value for the `fminimum` reduction.
Depends on D158618
Reviewed By: dcaballe
Differential Revision: https://reviews.llvm.org/D158773
‘llvm.vector.reduce.fminimum.*’ and ‘llvm.vector.reduce.fmaximum.*’ have been recently added to the IR. However, there is no masked variant for them. It would be great if they could be added.
(Nit: there is also certain inconsistency with the naming of the scalar and vector reduction non-NaN propagating intrinsics. ‘llvm.minnum.*’ and ‘llvm.maxnum.*’ are used for the scalar ones and
fmin
/fmax
suffixed are used for both the predicated and non-predicated vector reduction versions. We should consider renaming them all tominnum
/maxnum
orfmin
/fmax
.)CC: @simoll, @rofirrim, @topperc, @unterumarmung
The text was updated successfully, but these errors were encountered: