gnup84
February 19, 2021, 12:23pm
1
Hi.
I have some questions about tvm.Target option.
In many tutorials and answer, I got some example like (target = “llvm -mcpu=cascadelake” ,etc…)
But i can not find a properly organized document.
Where can I find that?
target option -mcpu, -mattr, -libs … etc
(TVM, OMP, MKL)_(BIND, NUM)_THREADS
leeexyz
February 20, 2021, 5:28am
2
Hi, @gnup84 . So far as I can tell, there is no document to list which target currently supports.
I think one way to list it is by TVMC
, which should have this function to show the list of supported targets like
python3 -m tvm compile --target --help
You can find the target registration at tvm/target_kind.cc at 5688068eb02912a4ec926a88f5cad3f0f370454e · apache/tvm · GitHub
2 Likes
gnup84
February 20, 2021, 2:46pm
3
Thanks you so much…
I tested many options.
then i catch the weird situations.
target = “llvm -mcpu=cascadelake -libs=mkl”
if i set a option to use mkl like above, the inference time is slower than not use mkl.
not use mkl = 12ms
use mkl = 87ms
It depends. What’s your workload? Is that just a dense op or an entire network? Dense may not be the performance bottleneck if you profile an entire network so that the impact of using CBLAS would be moderated. I did an experiment months ago using 512x512 matrix to perform dense with and without CBLAS. The one with CBLAS is ~1.25x faster.
If no external library specified (e.g., llvm), TVM will generate LLVM IR and then lowers to the machine code directly. In this case, it’s suggested to specify…
This post says set(USE_OPENMP intel or gnu) can improve the inference time.
In this case, inference time is 16ms. // use_openmp and mkl
But still slow…
I think that using mkl is more fast than not use.
Why this happen??
Why using MKL is more slow than base.
What is the relationship between the openmp, mkl?
*** model = resnet50, bacth_size = 1, model in relay.testing
tvmc
doesn’t have this specific functionality right now. I’ve been thinking on how we could make the Targets to self-describe, by adding a text description field and API to pull information about a target. That would be great for usability of TVMC, but right now, we can’t collect that information.
You can collect the list of existing targets in Python, by using this API call:
import tvm
targets = tvm.target.Target.list_kinds()
print(targets)
source: Make the TVM targets list available in Python by NicolaLancellotti · Pull Request #7427 · apache/tvm · GitHub