[Mlir-commits] [mlir] [mlir][linalg] Add 'compute_element_type' to linalg.elementwise op. (PR #190566)
Renato Golin
llvmlistbot at llvm.org
Thu Apr 9 08:01:58 PDT 2026
rengolin wrote:
> 1. I think you mean that if input is f16 and output is f32 then 'current implementation' is broken and I should fix that.
Broken is pushing a bit. I'm saying other operations have this semantics and element-wise should have, too. For the up-cast, there is no loss of precision.
> 2. What if input is f32 and output is f16?
This ends up in lost precision, but it's still the "agreed" semantics. To overcome that, we can either split into `ew+cast` or indeed add a compute type. But the latter will need a new round of RFCs because there wasn't a clear case for it before.
> 3. when input and output are f16 but compute needs to happen in f32 --> we dont care and not support that
What would it be the case for this in element-wise operations?
_Technically_, an operation that has temporary storage/state that the compiler cannot see, doesn't need to be represented in IR. But I guess it depends on the case.
https://github.com/llvm/llvm-project/pull/190566
More information about the Mlir-commits
mailing list