Error: identifier "hfabs" is undefined

The following code failed at compilation after codegen, tested with CUDA 10.0:

import tvm
from tvm import relay

x = relay.var('x', shape=(32, 128), dtype='float16')
func = relay.Function([x], relay.abs(x))
mod = tvm.IRModule.from_expr(func)

with tvm.transform.PassContext(opt_level=3):
    with tvm.target.Target('cuda'):
        lib = relay.build(mod)

Is this a bug? It looks like tvm codegen misses generating abs function for half precision.

2 Likes

I’m running into the same issue, is there any known workaround?

See https://github.com/apache/tvm/issues/10397#issuecomment-1052831955