ir.RegisterOpLowerIntrinsic seems not built for runtime

TVM_REGISTER_GLOBAL(“ir.RegisterOpLowerIntrinsic”) in src/ir/op.cc should be built for runtime. Without building this file the VTA won’t run after PR #7809. This has sth to do with Problem - RPC server on ZCU104. CMakefiles should be fixed for this.

Details: those three functions in vta/python/vta/environment.py are decorated by @register_intrin_lowering after the PR, which locates in python/tvm/ir/op.py and depends on _ffi_api, which loads the very function in src/ir/op.cc ,which seems not built with runtime only. Full build of course we won’t have this problem.

src/runtime/ is built for runtime, src/ir/ is used for unified IR, which is part of the compiler

true but if you dont build the whole tvm on board the vta simply wont run

Thanks for the explanation! Now I could understand.

The original mechanism for intrinsic lowering uses tvm.register_func, which is implemented in the TVM runtime, while the new register_intrin_lowering is instead implemented in the TVM compiler, which will throw out an error when if the TVM is a runtime-only build.

This file is loaded regardless of TVM is built fully or runtime-only, which causes the issue you mentioned: tvm/environment.py at main · apache/tvm · GitHub. To address this issue, we could simply ignore the error when registration function is not found.

A PR is more than appreciated! CC: @zxybazh

maybe not. i tried 1.delete these three functions 2.use the older register_func version. both of these failed the vta gemm test. the host side of tvm cannot identify the func tir.vta.coproc_dep_push blablabla(this might have sth to do with the host side of the tvm which is a bit older and dont have this commit, but it seems that the gemm test do need these functions to be registered correctly)

I see. @pr3dat0r2k would you mind sharing the error message and the name of the unittest that failed?

I ran the test_benchmark_gemm.py in vta/tests/python/integration but I don’t have the full error message because I’ve got it back working and I don’t have much time to reproduce it(end of semester you know). Sorry about this.