cbalint13 commented on PR #19589:
URL: https://github.com/apache/tvm/pull/19589#issuecomment-4553189791

   > @tqchen The failing test case in ir_module.py is due to the LLVM backend 
lagging behind LLVM IR in its support for llvm.{min,max}imum.{f32,f64}. How 
should we handle this situation? Related issue: 
[llvm/llvm-project#53353](https://github.com/llvm/llvm-project/issues/53353)
   > 
   > `LLVM ERROR: Cannot select: 0x5d50add04bf0: f32 = fmaximum 0x5d50add04d28, 
ConstantFP:f32<0.000000e+00>, IRModule.CodeGenLLVM:0`
   > 
   > The fmaximum instruction is supported in llvm 18.1.0 for x86-64 and in 
llvm 19.1.0 for i686. proof: X86-64: https://godbolt.org/z/b95xvbKxn i686: 
https://godbolt.org/z/q39dr1bs9
   
   Hi @actinks !
   
   - I dont think it is a good idea to enfoce  *evrything* via 
createmin/createmax at IR / LLVM-IR level.
   - We also loose backward compatibility with older LLVM (I personally highly 
appreciate this one in TVM).
   
   ---
   
   Instead we could do:
     - Add new TIRx functions ```nanmin```,  ```nanmax``` just like the 
existing ```nearbyint```  see 
https://github.com/apache/tvm/blob/main/src/target/llvm/intrin_rule_llvm.cc#L95
     - These new ```nanmin``` and ```nanmax``` can offer TVM / TIRx to be 
on-par with numpy functions : 
https://numpy.org/devdocs/reference/generated/numpy.nanmin.html
   
   
   Now, these new functions can be used to "protect" needed things in the 
higher level graph flow.
   These new TIRx can be available only for certain LLVM version above 
(protecting with #if LLVM_VERSION_MAJOR).
   
   
   @tqchen what do you think ?
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to