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
I have not looked in any detail, but IR has 3 different kinds of floating point max with different rules for nans and signed zeros: fmaxnum, fmaxnum_ieee and fmaximum. The backend does not natively support fmaximum. I'm not sure whether sdag should have lowered it to something that the backend does support.
Is it possible you could switch to using a different flavor of max in the first place? Or do you really need the fmaximum semantics?
I'm not sure whether sdag should have lowered it to something that the backend does support.
@jayfoad on the spirv gl side we have to emit comparisons with nan for a similar reason. I guess the backend should be able to do something similar in sdag? #66696
Activity
llvmbot commentedon Sep 29, 2023
@llvm/issue-subscribers-bug
Detailed dump here
More context on iree-org/iree#15064
llvmbot commentedon Sep 29, 2023
@llvm/issue-subscribers-backend-amdgpu
Detailed dump here
More context on iree-org/iree#15064
nirvedhmeshram commentedon Sep 29, 2023
debug dump with debug symbols here
nirvedhmeshram commentedon Sep 29, 2023
cc @krzysz00 @jayfoad
kuhar commentedon Sep 29, 2023
@jayfoad Could you take a look or help us find someone familiar with this part of the codebase?
jayfoad commentedon Sep 29, 2023
I have not looked in any detail, but IR has 3 different kinds of floating point max with different rules for nans and signed zeros: fmaxnum, fmaxnum_ieee and fmaximum. The backend does not natively support fmaximum. I'm not sure whether sdag should have lowered it to something that the backend does support.
Is it possible you could switch to using a different flavor of max in the first place? Or do you really need the fmaximum semantics?
jayfoad commentedon Sep 29, 2023
@arsenm is probably the most familiar with this.
nirvedhmeshram commentedon Sep 29, 2023
on the mlir side this is the change that introduced this semantics
https://reviews.llvm.org/D158618
It seems to have done after some discussions
https://discourse.llvm.org/t/rfc-fix-floating-point-max-and-min-operations-in-mlir/72671
@kuhar any thoughts how to unblock amdgpu on this? I do believe that the correct thing to do is that the backend should support thse
kuhar commentedon Sep 29, 2023
@jayfoad on the spirv gl side we have to emit comparisons with nan for a similar reason. I guess the backend should be able to do something similar in sdag? #66696
arsenm commentedon Oct 2, 2023
Somehow nobody ever implemented legalization for maximum/minimum. There's nothing AMDGPU specific about this
nirvedhmeshram commentedon Oct 3, 2023
I think this is just missing SD node selection on the AMDGPU side, for example the NVPTX backend selects it here
jayfoad commentedon Oct 10, 2023
Looks like #67301 might fix this.
krzysz00 commentedon Aug 13, 2025
Since I can't find the reproducer ... did this ever get fixed?
kuhar commentedon Aug 14, 2025
Can't repro and haven't seen this in the wild --> closing