You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[TVMC][Relay] Introduce executor and runtime parameters (#9352)
* [TVMC][Relay] Introduce executor and runtime parameters
This introduces `executor` and `runtime` into the various entrypoints but also into `tvmc` as `--executor` and `--runtime`. This touchs a lot of files and I've tried to update anywhere as necessary.
Notable, executor code generators now accept the initial `IRModule` rather than creating
it themselves so it can be annotated once.
Validated the demo application continues to classify the tabby cat with
new CLI options.
* Correct Graph Executor Python API
* ``-mcpu=cortex-m7``: used by TOPI to enable Cortex-M schedules, and, when the C source code
136
136
generator is selected, included in the output as a comment to help identify the code and
137
137
configure the downstream C compiler.
138
-
* ``-link-params``: include parameters as global constants to load from flash.
139
-
* ``-runtime=c``: build glue code to allow operators to work with the C runtime
140
-
* ``-system-lib=1``: emit a system library (i.e. which can be loaded by calling the PackedFunc
141
-
``runtime.SystemLib``.
138
+
139
+
Runtime and Executor configuration for microTVM
140
+
-----------------------------------------------
141
+
142
+
When using microTVM, it's important to use the C Runtime (``Runtime('crt')``), which is the runtime that works best on micro devices rather than the more dynamic C++ Runtime. Alongside this, there are two executors which you could use in combination with the C runtime:
143
+
144
+
* ``Executor("aot")`` - The Ahead of Time (AOT) executor precompiles the network into a runnable function which you can add directly into your micro application
145
+
* ``Executor("graph", {"link-params": True})`` - The Graph executor provides a JSON representation of your network and requires the C Runtime's system library to be generated to find functions in the function registry (``Runtime("crt", {"system-lib": True})``). ``{"link-params":True}`` enables parameters to be linked into the generated files rather than provided externally.
146
+
147
+
These are specified when building a runtime module: ``relay.build(..., runtime=..., executor=...)``.
0 commit comments