Why relay.floor_mod allows float64?

Hi, as a context, we can see other dl-frameworks also allow that like tf.math.floormod  |  TensorFlow Core v2.8.0.

For TVM, below is where float floormod is lowered to normal arithmetics as a - floor(a/b) * b

Since the case in the test script is to compute floor_mod(e^c1, c2) . I think it would be great to check what sub-step actually cause the difference (exp, div, or floor()?). It is known that CUDA arithmetics do not take exact same precision with c/c++ standard math libs, Programming Guide :: CUDA Toolkit Documentation.

In my environment, the cpu result match what I test with raw python:

>>> import math
>>> def f(a,b): return a - math.floor(a/b) * b
...
>>> f(math.exp(415.748715), 787.644532)
4.606887725612233e+164
1 Like