I encountered something wrong with the relay pass FastMath()
and topi.fast_exp
.
I made a testing relay program with exp
and build it with
with relay.build_config(opt_level=4):
graph, lib, params = relay.build(mod, target, params=params)
to enable and build Op(fast_exp)
, but I got an error:
all_impls = get_valid_implementations(op, attrs, inputs, out_type, target)
File "/home/selo/tvm/python/tvm/relay/backend/compile_engine.py", line 122, in get_valid_implementations
assert fstrategy is not None, "%s doesn't have FTVMStrategy registered" % op.name
AssertionError: fast_exp doesn't have FTVMStrategy registered
It seems that there’s a gap between the relay Op and topi implementation, so I inserted two lines:
register_broadcast_schedule("fast_exp")
register_shape_func("fast_exp", False, elemwise_shape_func)
in python/tvm/relay/op/_tensor.py
and turns out it worked.
Is this the intended way to use Op(fast_exp)
?
Thanks.