Introduction and Motivation
As we introduced an Ahead of TIme (AoT) flow in TVM in this PR, we are able to compile a single model into a the Model Library Format (MLF) and compile it to run on an embedded board.
It’s hard to bundle more than one model together, since we will end up with different name clashes (the name of the network descriptor, the name of the main function, and potentially the name of the operators if they appear in multiple networks). In order to avoid this, we think it would be nice to let the user specify a model name to append to all the global names generated through the compilation process. Example of global names are:
-
tvm__run_func
for the main function -
network
for the network descriptor -
fused_conv2d_shift_cast
for the operator (the operator name is truncated to 80)
Moreover, none of those global symbols start with an underscore (which means user might specify similar function names, thus having clashes)
Proposal
We are proposing to prefix by default all the global symbols with a __tvm
prefix. Moreover, we would give the user the opportunity to specify the model name. If the user specify MYNET
, this would be the end result:
-
MYNET_run_func
for the main function -
MYNET_network
for the descriptor -
MYNET_fused_conv2d_shift_cast...
for the operator (the operator name is truncated to 80)
In case the user does not specify any model name, the result would be:
-
_tvm_run_func
for the main function -
_tvm_network
for the descriptor -
_tvm_fused_conv2d_shift_cast
for the operator (the operator name is truncated to 80)