mirror of
https://github.com/ROCm/jax.git
synced 2025-04-16 11:56:07 +00:00
[MOSAIC] Accept kernels for a compatibility window with MAXNUMF instead of MAXIMUMF
PiperOrigin-RevId: 605436599
This commit is contained in:
parent
8139e58e02
commit
d29c86eb52
@ -2437,10 +2437,12 @@ LogicalResult vector_multi_reduction_rule(RewriteContext &ctx, Operation &op,
|
||||
case vector::CombiningKind::ADD:
|
||||
neutral = builder.getF32FloatAttr(0);
|
||||
break;
|
||||
case vector::CombiningKind::MAXNUMF:
|
||||
case vector::CombiningKind::MAXIMUMF: {
|
||||
// TODO(b/322836633): The semantics of maximumf don't match the lowering
|
||||
// for older TPU versions because older TPU versions don't respect the
|
||||
// -0.0 vs +0.0 ordering.
|
||||
// -0.0 vs +0.0 ordering. Keeping MAXNUMF for backward compatibility of
|
||||
// serialized artifacts.
|
||||
neutral = builder.getFloatAttr(
|
||||
builder.getF32Type(),
|
||||
APFloat::getInf(APFloat::IEEEsingle(), /*Negative=*/true));
|
||||
@ -2532,6 +2534,7 @@ LogicalResult vector_multi_reduction_rule(RewriteContext &ctx, Operation &op,
|
||||
case vector::CombiningKind::ADD:
|
||||
tpu_kind = tpu::ReductionKind::SUM;
|
||||
break;
|
||||
case vector::CombiningKind::MAXNUMF:
|
||||
case vector::CombiningKind::MAXIMUMF:
|
||||
tpu_kind = tpu::ReductionKind::MAX;
|
||||
break;
|
||||
|
Loading…
x
Reference in New Issue
Block a user