Open bhahn221 opened 3 years ago
Hi @bhahn221,
This is a known issue with generating C code from TVM, it defaults to trying to use vector types which aren't supported - if you add --pass-config tir.disable_vectorize=1
to your tvmc
command line it'll stop trying to do this and should generate valid C :smile_cat:
CC @leandron / @areusch
Hi @bhahn221. I had a look into this issue and it seems like some similar issues we've seen in past with tvmc compile --target=c
.
Based on the error message, it looks like we need to create a way to disable the vectorizer when using the C backend in this case? This is currently available via the --pass-config
, only in tvmc compile
.
To do that in tvmc tune
, my first impulse would be plumbing a similar --pass-config
option, all the way from tvmc tune
() to call_all_topic_funcs
in tvm/auto_scheduler/relay_integration.py
:
I couldn't find the autotvm equivalent, on where the PassContext
is actually called, but for now, in summary you would need to patch TVM to disable the vectorizer in the sources.
Apologies @bhahn221, I think I misunderstood the initial issue, you can add the same pass config to your python code using:
with tvm.transform.PassContext(opt_level=3, config={"tir.disable_vectorize": True}):
I first used AutoTVM with TVMC to tune the model, and I used the following command
Then I tried to use that log to generate an optimized C code. Before I tried generating an unoptimized C code (without
apply_history_best
), I was successful using the following lines of code:However, when I tried generating an optimized C code (with
apply_history_best
), I was not successful and got the following error:The code I used looks like this:
and entries in the log looked like:
Is this not supposed to work this way? Or is there a way to fix this?