TVMC 介绍
TVMC 是一个将 TVM 的一些特性比如自动调优,编译,分析和运行模型等通过命令行前端暴露出来的工具。
TVMC 是一个 Python 应用程序,是 TVM Python 包的一部分。
可以通过下面的命令来启动TVMC命令行驱动程序python -m tvm.driver.tvmc
。
运行 tvmc --help
可以看到它支持的命令选项:
usage: tvmc [--config CONFIG] [-v] [--version] [-h] {run,tune,compile} ...
TVM compiler driver
optional arguments:
--config CONFIG configuration json file
-v, --verbose increase verbosity
--version print the version and exit
-h, --help show this help message and exit.
commands:
{run,tune,compile}
run run a compiled module
tune auto-tune a model
compile compile a model.
TVMC - TVM driver command-line interface
从上面可以看到目前 TVMC 支持三种命令:run
,tune
,compile
。针对不同的命令,也可以查看相关的帮助信息,例如:
tvmc run --help
usage: tvmc run [-h] [--device {cpu,cuda,cl,metal,vulkan,rocm,micro}]
[--fill-mode {zeros,ones,random}] [-i INPUTS] [-o OUTPUTS]
[--print-time] [--print-top N] [--profile] [--end-to-end]
[--repeat N] [--number N] [--rpc-key RPC_KEY]
[--rpc-tracker RPC_TRACKER] [--list-options]
PATH
positional arguments:
PATH path to the compiled module file or to the project
directory if '--device micro' is selected.
optional arguments:
-h, --help show this help message and exit
--device {cpu,cuda,cl,metal,vulkan,rocm,micro}
target device to run the compiled module. Defaults to
'cpu'
--fill-mode {zeros,ones,random}
fill all input tensors with values. In case
--inputs/-i is provided, they will take precedence
over --fill-mode. Any remaining inputs will be filled
using the chosen fill mode. Defaults to 'random'
-i INPUTS, --inputs INPUTS
path to the .npz input file
-o OUTPUTS, --outputs OUTPUTS
path to th