[Mlir-commits] [mlir] [MLIR][Arith] Add denormal attribute to binary/unary operations (PR #112700)
Renato Golin
llvmlistbot at llvm.org
Mon Dec 9 03:00:51 PST 2024
rengolin wrote:
It seems I have missed the discussion here. Some points...
> Agreed, per operation makes more sense in the context of NEON. Though, admittedly, the only official doc that I could find for this covers ArmV7 and we are in ArmV9 era
Indeed. I mention this because, while LLVM has a definite set of targets, MLIR is more broad and widely adopted by a lot of accelerator start-ups, which usually have more than one compute unit (SIMD, systolic array, analog, etc) with different floating point behaviours.
> That's interesting. Does this mean that if the scalar code is IEEE compliant and we are under a precise fp mode, the code should not be vectorized?
@dcaballe, that's exactly what the patch @banach-space mention does.
> Which flags would allow changing an ieee denormal mode to ftz, for example? I think it's important that we document that.
This is again per target / extension. You may have conversion instructions, you may have soft-float helpers, and you may not. My original point here is this:
**Denormal support is not a property of the operation, but the hardware micro-architecture it targets, including its runtime support.**
While I said this may be thought of as a instruction-level property, it doesn't have to be. In reality, the compilers that try to compile individual instruction in separate units (think mixed AI accelerators) do so in a precise way and thus control the distribution. In the end, those instructions need to be fetched by different units and thus be at the very least in separate regions in the object file, but most commonly in separate libraries altogether.
How does this affect the implementation? I don't know. I have not spend time, nor have a use case in hand, to have a good answer.
@joker-eph, while I agree with your general point and the need for a charter, your comment is not specific enough to warrant a reversal. Perhaps you could be a bit more specific in a forum thread and we continue from there? Also, @chelini, if you could expose the usage pattern you're looking for, that'd give more power to your argument.
Generally, changes to core dialects like `arith` should really go through an RFC on the forum before being a PR. Usually, the simple cases are quick enough ([this one](https://discourse.llvm.org/t/rfc-move-tensor-pack-and-tensor-unpack-into-linalg/83096) took only a couple of days). This is yet another thing we need to get right in the charter for the whole project, but first we need to define what a "core dialect" means and which are they.
https://github.com/llvm/llvm-project/pull/112700
More information about the Mlir-commits
mailing list