Similar to this post, I also want to extract the C code from the Relay IR. Following what was suggested in that post, I changed my target to tvm.target.Target('c --system-lib --link-params --runtime=c')
and added a line lib.export_library(compiled_model.tar)
However, the solution suggested in that post seems no longer work as I got the error saying Error when parsing target["system-lib"]: Cannot recognize 'system-lib'
Further, I tried to keep the target as llvm -mcpu=core-avx2
, but then the zip file does not contain .c file, only object files. And then I changed the target to ācā as suggested in some other posts, but then the kernel tuning step could not find any valid schedule for the dense
operator: from the standard output, it seems that every schedule has GFLOPS being 0.0
So how could I get the C code? Thanks in advance!