[Mlir-commits] [mlir] Fix the lowering of `arith.truncf : f32 to bf16`. (PR #83180)

Benoit Jacob llvmlistbot at llvm.org
Thu Feb 29 15:38:43 PST 2024


bjacob wrote:

Thanks @joker-eph for the fix!  Regarding it, note that 1.0156 and 1.01562 are close enough that they clearly are two different printings of the *same* bfloat16 value (with 7 bit mantissa, the distance between consecutive representable values just above 1.0 is ~= 1/128 ~= 0.0078, larger than the 0.00002 difference here).

This means that there is no numerical difference at all between Windows and Linux here (so, no numerical bug) and instead, what we are dealing with here seems to be merely a difference in the number of decimals printed on Windows vs Linux. That seems like a gratuitous complication that we would benefit from removing --- whichever printing function used here should use the same explicit number of decimals on all platforms, no?

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


More information about the Mlir-commits mailing list