I always wanted to run TVM modules using TVMs LLVM target with MLonMCU. As this approach uses the (cross-)compile infrastructure of TVM, we can skip the COMPILE stage and instead have to load and run the mod.so instead of and ELF executable. The TVMC tools offers an interface to do all this
Naming
I am currently not satisfied with the name tvm which is also used for the TvmFramework. Some alternatives would be:
tvmc: As the platform is completely based on the TVMC command line utility
tvmrpc: Not really accurate...
tvmcpp: Goes in the right direction
Further Thoughts
At this point it might make sense to introduce abstract BuildPlatform and TunePlatform classes which would wrap around the Backend and Tuner class. However I will eventually delay this as it mainly introduces complexity without adding major benefits.
Whats missing
This is a draft! Before merging the following things should be implemented:
[ ] Support validation of input and output data (similar to MLIF feature) -> Needs frontend updates
[x] Add another platform microtvm supporting MicroTVMs ProjectAPI
[x] Add tests
[ ] Test rpc feature
[ ] Ensure that the tvm Platform can only be used with the tvmllvm backend by introducing backend output formats which have to be compatible with the input_format of a CompilePlatform.
Motivation
I always wanted to run TVM modules using TVMs LLVM target with MLonMCU. As this approach uses the (cross-)compile infrastructure of TVM, we can skip the
COMPILE
stage and instead have to load and run themod.so
instead of and ELF executable. The TVMC tools offers an interface to do all thisNaming
I am currently not satisfied with the name
tvm
which is also used for theTvmFramework
. Some alternatives would be:tvmc
: As the platform is completely based on the TVMC command line utilitytvmrpc
: Not really accurate...tvmcpp
: Goes in the right directionFurther Thoughts
At this point it might make sense to introduce abstract
BuildPlatform
andTunePlatform
classes which would wrap around theBackend
andTuner
class. However I will eventually delay this as it mainly introduces complexity without adding major benefits.Whats missing
This is a draft! Before merging the following things should be implemented:
microtvm
supporting MicroTVMs ProjectAPItvm
Platform can only be used with thetvmllvm
backend by introducing backend output formats which have to be compatible with theinput_format
of a CompilePlatform.