Skip to content
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

Add Module-Based Model Runtime Interface for AOT (support C++ runtime) #9697

Closed
wants to merge 41 commits into from

Conversation

areusch
Copy link
Contributor

@areusch areusch commented Dec 10, 2021

This PR implements Module-based Model Runtime for AOT RFC. It adds support for targeting the C++ runtime with the Ahead-of-Time Executor for workloads which are purely CPU-based (e.g. the Device API cannot be used).

cc @manupa-arm @kparzysz-quic @csullivan @mehrdadh @adstraw for early feedback while I iterate to prepare to merge this.

@areusch areusch force-pushed the aot-executor-no-codegen branch 2 times, most recently from 66cc5a8 to e879841 Compare December 13, 2021 04:50
Copy link
Member

@mehrdadh mehrdadh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just few nit suggestions.

@@ -390,6 +391,13 @@ if(USE_PROFILER)
list(APPEND RUNTIME_SRCS ${RUNTIME_VM_PROFILER_SRCS})
endif(USE_PROFILER)

if(USE_AOT_EXECUTOR)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I suggest to add USE_AOT_EXECUTOR to cmake/config.cmake with default value ON



def test_conv2d():
RELAY_MODEL = textwrap.dedent(
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I suggest to use relay directly to build the relay model. Here is an example:

y = relay.nn.conv2d(

output_list = generate_ref_data(ir_mod, inputs, params)

with tvm.transform.PassContext(opt_level=3, config={"tir.disable_vectorize": True}):
mod = tvm.relay.build(ir_mod, params=params, target="c -executor=aot -link-params")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

change this to use executor and runtime args?

@areusch areusch force-pushed the aot-executor-no-codegen branch from 94a72c3 to 94bcb1c Compare January 5, 2022 20:06
@masahi
Copy link
Member

masahi commented Feb 26, 2022

#10283

@masahi masahi closed this Feb 26, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants