I wrote a relay function containing just one operation (subratract).
input1 = relay.var("i1" , shape = (N,) , dtype = "float16")
input2 = relay.var("i2" , shape = (N,) , dtype = "float16")
sub_out = relay.subtract(input1 , input2)
func = relay.Function([input1 , input2] , sub_out)
mod = tvm.IRModule.from_expr(func)
mod = relay.transform.InferType()(mod)
and used
with tvm.transform.PassContext(opt_level=2):
graph, lib, params = relay.build(mod, target="rocm", params=None)
to build with “ROCM” as target. Till here i was able to run the code.
But when i export the library using
lib.export_library("lib.so", fcompile=False)
i get following error:
Traceback (most recent call last):
File "tvm_half_test.py", line 33, in <module>
lib.export_library("lib.so", fcompile=False)
File "/home/user/pim-workspace/rib_tvm/tvm/python/tvm/runtime/module.py", line 503, in export_library
modules = self._collect_dso_modules()
File "/home/user/pim-workspace/rib_tvm/tvm/python/tvm/runtime/module.py", line 440, in _collect_dso_modules
return self._collect_from_import_tree(lambda m: m.is_dso_exportable)
File "/home/user/pim-workspace/rib_tvm/tvm/python/tvm/runtime/module.py", line 429, in _collect_from_import_tree
), f"Module {module.type_key} should be either dso exportable or binary serializable."
AssertionError: Module hip should be either dso exportable or binary serializable.
Could anyone please point me right direction for this issue?
thanks