-
Notifications
You must be signed in to change notification settings - Fork 3.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[microTVM] Add support for host-driven AoT Executor #11044
Conversation
…ape encoded in metadata appears to be incorrect;
…); test_aot_executor() is now passing;
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thanks @alanmacd this looks pretty good! some small comments here and there
…ot to include metadata.h c++ code
…der to avoid c/c++ issues and remove the need for the TVM_IS_CPP_RUNTIME define
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thanks @alanmacd just a few small cleanups now!
cc @mehrdadh @mkatanbaf @gromero @Mousius if you guys have input
* Generate AOT Metadata when targeting C runtime and packed API. * Also copy metadata.h and metadata_base.h to standalone_crt. * add support for get_input_index as well as setting up get_input_info as unsupported * add support for tvm.aot_executor.create in C runtime * changes in-progress to unit tests * Include get_c_metadata in emitted function list * make CRT error codes generic for graph or AoT executor, fix AoT lib link order * add AoT executor creation and initializaion, as well as support for get_input_index() * add allocation of inputs, outputs, and pools; add get_input(), but shape encoded in metadata appears to be incorrect; * add support to test_aot_executor for get_input() * fix numpy array shape so that get_input() works properly * implement run(), get_output(), get_num_inputs(), and get_num_outputs(); test_aot_executor() is now passing; * fix up some issues from rebase with main * clean up logging and test_graph_executor() * lint clean-up * more lint clean-up * fix i386 build errors * first set of changes addressing PR feedback * more PR feedback: device pass-by-value, docstring entries, return variable name * add mangling of get_c_metadata() name to avoid function name collisions * only mangle get_c_metadata() when using C runtime * add static specifier to all kTvmgenMetadata variables to avoid namespace collisions * use TVM_IS_CPP_RUNTIME preprocessor define to deteremine whether or not to include metadata.h c++ code * add TVM_IS_CPP_RUNTIME define for cpptest * add TVM_IS_CPP_RUNTIME to apps/bundle_deploy * add TVM_IS_CPP_RUNTIME web/Makefile * update number of expected generated C files for AoT source files * break out metadata data structures into separate metadata_types.h header to avoid c/c++ issues and remove the need for the TVM_IS_CPP_RUNTIME define * remove TVM_IS_CPP_RUNTIME from web makefile * fix metadata.h include-order lint issue * correct error mask bits * address PR feedback * trigger build * trigger build * trigger build * trigger build * add alternate name for test_graph_executor() too see if it runs in CI * fix lint * revert alternate test code Co-authored-by: Andrew Reusch <[email protected]>
* Generate AOT Metadata when targeting C runtime and packed API. * Also copy metadata.h and metadata_base.h to standalone_crt. * add support for get_input_index as well as setting up get_input_info as unsupported * add support for tvm.aot_executor.create in C runtime * changes in-progress to unit tests * Include get_c_metadata in emitted function list * make CRT error codes generic for graph or AoT executor, fix AoT lib link order * add AoT executor creation and initializaion, as well as support for get_input_index() * add allocation of inputs, outputs, and pools; add get_input(), but shape encoded in metadata appears to be incorrect; * add support to test_aot_executor for get_input() * fix numpy array shape so that get_input() works properly * implement run(), get_output(), get_num_inputs(), and get_num_outputs(); test_aot_executor() is now passing; * fix up some issues from rebase with main * clean up logging and test_graph_executor() * lint clean-up * more lint clean-up * fix i386 build errors * first set of changes addressing PR feedback * more PR feedback: device pass-by-value, docstring entries, return variable name * add mangling of get_c_metadata() name to avoid function name collisions * only mangle get_c_metadata() when using C runtime * add static specifier to all kTvmgenMetadata variables to avoid namespace collisions * use TVM_IS_CPP_RUNTIME preprocessor define to deteremine whether or not to include metadata.h c++ code * add TVM_IS_CPP_RUNTIME define for cpptest * add TVM_IS_CPP_RUNTIME to apps/bundle_deploy * add TVM_IS_CPP_RUNTIME web/Makefile * update number of expected generated C files for AoT source files * break out metadata data structures into separate metadata_types.h header to avoid c/c++ issues and remove the need for the TVM_IS_CPP_RUNTIME define * remove TVM_IS_CPP_RUNTIME from web makefile * fix metadata.h include-order lint issue * correct error mask bits * address PR feedback * trigger build * trigger build * trigger build * trigger build * add alternate name for test_graph_executor() too see if it runs in CI * fix lint * revert alternate test code Co-authored-by: Andrew Reusch <[email protected]>
* Generate AOT Metadata when targeting C runtime and packed API. * Also copy metadata.h and metadata_base.h to standalone_crt. * add support for get_input_index as well as setting up get_input_info as unsupported * add support for tvm.aot_executor.create in C runtime * changes in-progress to unit tests * Include get_c_metadata in emitted function list * make CRT error codes generic for graph or AoT executor, fix AoT lib link order * add AoT executor creation and initializaion, as well as support for get_input_index() * add allocation of inputs, outputs, and pools; add get_input(), but shape encoded in metadata appears to be incorrect; * add support to test_aot_executor for get_input() * fix numpy array shape so that get_input() works properly * implement run(), get_output(), get_num_inputs(), and get_num_outputs(); test_aot_executor() is now passing; * fix up some issues from rebase with main * clean up logging and test_graph_executor() * lint clean-up * more lint clean-up * fix i386 build errors * first set of changes addressing PR feedback * more PR feedback: device pass-by-value, docstring entries, return variable name * add mangling of get_c_metadata() name to avoid function name collisions * only mangle get_c_metadata() when using C runtime * add static specifier to all kTvmgenMetadata variables to avoid namespace collisions * use TVM_IS_CPP_RUNTIME preprocessor define to deteremine whether or not to include metadata.h c++ code * add TVM_IS_CPP_RUNTIME define for cpptest * add TVM_IS_CPP_RUNTIME to apps/bundle_deploy * add TVM_IS_CPP_RUNTIME web/Makefile * update number of expected generated C files for AoT source files * break out metadata data structures into separate metadata_types.h header to avoid c/c++ issues and remove the need for the TVM_IS_CPP_RUNTIME define * remove TVM_IS_CPP_RUNTIME from web makefile * fix metadata.h include-order lint issue * correct error mask bits * address PR feedback * trigger build * trigger build * trigger build * trigger build * add alternate name for test_graph_executor() too see if it runs in CI * fix lint * revert alternate test code Co-authored-by: Andrew Reusch <[email protected]>
* Generate AOT Metadata when targeting C runtime and packed API. * Also copy metadata.h and metadata_base.h to standalone_crt. * add support for get_input_index as well as setting up get_input_info as unsupported * add support for tvm.aot_executor.create in C runtime * changes in-progress to unit tests * Include get_c_metadata in emitted function list * make CRT error codes generic for graph or AoT executor, fix AoT lib link order * add AoT executor creation and initializaion, as well as support for get_input_index() * add allocation of inputs, outputs, and pools; add get_input(), but shape encoded in metadata appears to be incorrect; * add support to test_aot_executor for get_input() * fix numpy array shape so that get_input() works properly * implement run(), get_output(), get_num_inputs(), and get_num_outputs(); test_aot_executor() is now passing; * fix up some issues from rebase with main * clean up logging and test_graph_executor() * lint clean-up * more lint clean-up * fix i386 build errors * first set of changes addressing PR feedback * more PR feedback: device pass-by-value, docstring entries, return variable name * add mangling of get_c_metadata() name to avoid function name collisions * only mangle get_c_metadata() when using C runtime * add static specifier to all kTvmgenMetadata variables to avoid namespace collisions * use TVM_IS_CPP_RUNTIME preprocessor define to deteremine whether or not to include metadata.h c++ code * add TVM_IS_CPP_RUNTIME define for cpptest * add TVM_IS_CPP_RUNTIME to apps/bundle_deploy * add TVM_IS_CPP_RUNTIME web/Makefile * update number of expected generated C files for AoT source files * break out metadata data structures into separate metadata_types.h header to avoid c/c++ issues and remove the need for the TVM_IS_CPP_RUNTIME define * remove TVM_IS_CPP_RUNTIME from web makefile * fix metadata.h include-order lint issue * correct error mask bits * address PR feedback * trigger build * trigger build * trigger build * trigger build * add alternate name for test_graph_executor() too see if it runs in CI * fix lint * revert alternate test code Co-authored-by: Andrew Reusch <[email protected]>
It is currently not possible to use the AoT executor with microTVM over the RPC channel. Add support for host-driven AoT executor using the generated AoT metadata to allocate working buffer memory for operations such as get_input(). Add test_aot_executor() test function to test_crt.py to exercise this new functionality.
This PR addresses #10076
cc @gromero @mehrdadh @areusch @mkatanbaf