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

[AOT] Introducing AOT in TVM #7785

Merged
merged 33 commits into from
May 5, 2021
Merged

[AOT] Introducing AOT in TVM #7785

merged 33 commits into from
May 5, 2021

Conversation

giuseros
Copy link
Contributor

@giuseros giuseros commented Apr 1, 2021

This change adds the code generation and minimal runtime API to use the
Ahead Of Time (AOT) compilation flow. The main logic is contained in:

  • src/relay/backend/aot_codegen.cc

Which produces a TIR PrimFunc traversing the Relay graph

The runtime interface (authored by @Mousius) leaves a gap for future
iterations using platform-specific features from RTOS.

Currently AOT runs successfully on x86 in a host OS, running these
tests on micro is coming soon.

This PR is based on the RFC described here: https://discuss.tvm.apache.org/t/implementing-aot-in-tvm/9206

Co-authored-by: Christopher Sidebottom Christopher.Sidebottom@arm.com

@giuseros
Copy link
Contributor Author

giuseros commented Apr 1, 2021

@jwfromm
Copy link
Contributor

jwfromm commented Apr 1, 2021

Thanks for this awesome contribution @giuseros, its definitely a big milestone for the project. I looked through your changes and didn't find any docs or tutorials on how to use the AOT. Although there are some tests that show it being used, I think a doc would go a long way for encouraging others to use this approach.

Copy link
Contributor

@areusch areusch left a comment

Choose a reason for hiding this comment

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

great work @giuseros and thanks for your contribution! I left a bunch of comments, many for my understanding--so please don't take them as an over-critique of the code. I think this is definitely going in the right direction and I think most of the things to debate here are specifics.

it looks like there are a couple of renames that have landed since you've been working on this:

  • DLDevice rename
  • GraphExecutor rename

would be great if you could update the PR to include those changes too.

tests/python/relay/aot/test_crt_aot.py Show resolved Hide resolved
include/tvm/runtime/crt/aot/tvm_backend.h Outdated Show resolved Hide resolved
include/tvm/runtime/crt/aot/tvm_error.h Outdated Show resolved Hide resolved
cmake/modules/StandaloneCrt.cmake Outdated Show resolved Hide resolved
include/tvm/runtime/crt/aot/tvm_backend.h Outdated Show resolved Hide resolved
src/tir/transforms/lower_tvm_builtin.cc Outdated Show resolved Hide resolved
src/target/source/codegen_source_base.h Show resolved Hide resolved
src/relay/backend/graph_plan_memory.cc Outdated Show resolved Hide resolved
tests/python/relay/aot/aot_test.mk Show resolved Hide resolved
src/target/source/source_module.cc Show resolved Hide resolved
@giuseros
Copy link
Contributor Author

giuseros commented Apr 6, 2021

Hi @areusch , just back from holidays.

First of all, thank you so much to be so thorough in the review. I appreciate this.

Instead of a big single reply, I will gradually reply to your comments

@giuseros
Copy link
Contributor Author

giuseros commented Apr 6, 2021

Hi @jwfromm ,
I am happy to add docs for AOT. Could you just point me to an example of what you mean by doc/tutorial? Where should it go in the codebase?

Thanks!

Copy link
Contributor

@manupak manupak left a comment

Choose a reason for hiding this comment

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

Hi @giuseros ,

Thanks and looking good.
I did an initial pass of at the export_library_format and build_module.py changes. I will look at the rest in another pass.

python/tvm/micro/model_library_format.py Outdated Show resolved Hide resolved
python/tvm/micro/model_library_format.py Outdated Show resolved Hide resolved
python/tvm/micro/model_library_format.py Outdated Show resolved Hide resolved
python/tvm/micro/model_library_format.py Show resolved Hide resolved
python/tvm/micro/model_library_format.py Show resolved Hide resolved
python/tvm/relay/backend/graph_executor_factory.py Outdated Show resolved Hide resolved
python/tvm/relay/build_module.py Outdated Show resolved Hide resolved
@giuseros
Copy link
Contributor Author

giuseros commented Apr 9, 2021

Hi all,
I refactored bits and pieces. In particular:

  • Moved everything in crt (with the agreement that in the next future we will remove dependencies on things that embedded platforms might struggle with)
  • Refactored the model_library_format.py and the executor factories to be a bit more generic and elegant. Please, let me know what you think

giuseros pushed a commit to giuseros/incubator-tvm that referenced this pull request Apr 9, 2021
Spin off from PR apache#7785 to decide the
correct name to use for the AOT main executor function

Change-Id: I62b29e809a88d797afbb0c155fdc7be80659f7cf
Copy link
Contributor

@areusch areusch left a comment

Choose a reason for hiding this comment

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

@giuseros did another pass. GH decided that many of my previous comments are now outdated--I know best practice is to force-push iterations on your PR, but can you use git merge to sync it rather than force-pushing? I think there's enough open comments here I won't be able to keep track of them otherwise.

cc @tqchen -- we need to address this limitation with our code review tool.

include/tvm/runtime/crt/aot_executor.h Outdated Show resolved Hide resolved
include/tvm/target/target_kind.h Outdated Show resolved Hide resolved
python/tvm/relay/backend/executor_factory.py Outdated Show resolved Hide resolved
python/tvm/relay/backend/executor_factory.py Outdated Show resolved Hide resolved
python/tvm/relay/backend/executor_factory.py Outdated Show resolved Hide resolved
src/relay/backend/build_module.cc Outdated Show resolved Hide resolved
src/relay/backend/build_module.cc Outdated Show resolved Hide resolved
python/tvm/relay/backend/executor_factory.py Outdated Show resolved Hide resolved
include/tvm/runtime/crt/aot_executor.h Outdated Show resolved Hide resolved
src/target/source/codegen_c_host.cc Outdated Show resolved Hide resolved
@giuseros
Copy link
Contributor Author

Hi @tqchen , @areusch ,
I updated a new patch while we agree on the codegen changes here.

@areusch
Copy link
Contributor

areusch commented Apr 15, 2021

@giuseros sorry for the delay, lots to review and stuff. I commented on our codegen thread, let's agree on a path forward for this PR, then we can launch some separate discussions about the pieces we're deferring.

Copy link
Contributor

@areusch areusch left a comment

Choose a reason for hiding this comment

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

thanks @giuseros for your work on this, I think it's shaping up! took another look and replied to our mega-comment on PR direction.

include/tvm/runtime/crt/page_allocator.h Show resolved Hide resolved
include/tvm/target/target_kind.h Outdated Show resolved Hide resolved
python/tvm/micro/model_library_format.py Show resolved Hide resolved
python/tvm/relay/backend/executor_factory.py Outdated Show resolved Hide resolved
python/tvm/relay/backend/executor_factory.py Show resolved Hide resolved
tests/python/unittest/test_crt.py Outdated Show resolved Hide resolved
tests/python/relay/aot/aot_test.mk Show resolved Hide resolved
src/target/source/codegen_c_host.cc Outdated Show resolved Hide resolved
@giuseros
Copy link
Contributor Author

giuseros commented Apr 16, 2021

Hi @areusch ,
Thanks for you comments. I left some questions where I didn't get exactly what you meant (sorry :) ). The major things I will do next week is:

  • Introduce a new intrinsic to support the cpacked_func call
  • Move the aot_executor.h in an internal folder, so that is not a public interface and update the aot_test.mk make file accordingly

Copy link
Contributor

@manupak manupak left a comment

Choose a reason for hiding this comment

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

Hi @giuseros ,

Did a second pass -- my comments are mostly based on the structure and mostly around overloading with graph executor codegen. See if you agree.

src/relay/backend/build_module.cc Outdated Show resolved Hide resolved
src/relay/backend/aot_codegen.cc Outdated Show resolved Hide resolved
src/relay/backend/build_module.cc Outdated Show resolved Hide resolved
src/relay/backend/build_module.cc Outdated Show resolved Hide resolved
src/relay/backend/build_module.cc Outdated Show resolved Hide resolved
src/relay/backend/build_module.cc Outdated Show resolved Hide resolved
src/relay/backend/build_module.cc Outdated Show resolved Hide resolved
src/relay/backend/build_module.cc Outdated Show resolved Hide resolved
src/relay/backend/aot_codegen.cc Outdated Show resolved Hide resolved
@giuseros giuseros force-pushed the aot-upstream branch 2 times, most recently from d5f2e81 to 218760b Compare April 19, 2021 23:17
@giuseros
Copy link
Contributor Author

Hi @manupa-arm , @areusch ,
I applied most of the changes. Namely:

  • Moved to a call_cpacked builtin
  • Moved the aot_executor.h in internal
  • Moved to use tir::Allocate
  • Removed the aot_backend_api.c (and defined a fake TVMFuncRegisterGlobal in test.c)
  • Removed the runner function PrimFunc returned as internal representation by AOT
    I partially addressed the following:
  • About unification of BuildOutput , @manupa-arm we agreed that it is too complex to do now, because of the get_graph_json method defined in the RelayBuildModule.
  • Instead of passing the LoweredOutput to the CreateMetadataModule I moved AOTMetadata to a generic Metadata and used it. The main reason is that otherwise I need to expose to the Object system the LoweredOutput class, which seems to be too much of an internal back-end class to be exposed.

Please, let me know what you think!

Copy link
Contributor

@manupak manupak 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 nits and a suggestion to add a test case to check BYOC compilation pathway.
Its looking good @giuseros .

src/relay/backend/build_module.cc Outdated Show resolved Hide resolved
src/relay/backend/build_module.cc Outdated Show resolved Hide resolved
tests/python/relay/aot/test_crt_aot.py Show resolved Hide resolved
Copy link
Contributor

@areusch areusch left a comment

Choose a reason for hiding this comment

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

here's another review pass, I think this is looking good. couldn't reply to your executor param comment thread while doing this review, will try after I hit submit review.

src/relay/backend/build_module.cc Outdated Show resolved Hide resolved
src/runtime/meta_data.h Outdated Show resolved Hide resolved
python/tvm/relay/backend/executor_factory.py Outdated Show resolved Hide resolved
python/tvm/relay/build_module.py Outdated Show resolved Hide resolved
src/relay/backend/utils.h Outdated Show resolved Hide resolved
tests/cpp/relay_build_module_test.cc Outdated Show resolved Hide resolved
src/runtime/crt/memory/stack_allocator.c Outdated Show resolved Hide resolved
src/runtime/crt/memory/stack_allocator.c Show resolved Hide resolved
tests/crt/aot_memory_test.cc Show resolved Hide resolved
src/relay/backend/graph_plan_memory.cc Show resolved Hide resolved
@giuseros
Copy link
Contributor Author

Hi @areusch ,
I worked on your suggestions, this is what I did:

  • Moved meta_data.h in include/tvm/runtime. This is to use the runtime::kTvmExecutor{Graph,Aot} also from tests, and in this way we don't need to include relative paths in the files.
  • Added the stack FIFO memory checks. We are "wasting" 4 bytes per block, so I enabled it only if TVM_CRT_RUNTIME is defined.
  • In the Executor factory, I merged get_internal_repr and save_executor_config in a single get_executor_config
  • Added tests for the content of sid sizes.
    Only thing I wasn't able to do was to add tests for FIFO enforcement. I have a test working in my local repo, but the problem is that I am not able to define TVM_CRT_RUNTIME for the single aot_memory_test.cc (the best would be to define it for the single test). Any suggestions?

Copy link
Contributor

@areusch areusch left a comment

Choose a reason for hiding this comment

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

@giuseros great! took another look here. here's my thoughts:

  • maybe we could just move the constants in meta_data.h into the include tree? the bar for what should be there is "is it user-facing?" I think those two constants are definitely user-facing but nothing in this change promotes the other structs/classes declared there.
  • I left some comments about when to enable but the impl looks fine.
  • merging the two seems fine. left some comments on the top-level ExecutorFactory interface.
  • I sort of think the final problem could be fixed by just turning the check on all the time. alternatively, you could create a crt_config.h for testing and update the test include path

python/tvm/relay/backend/executor_factory.py Outdated Show resolved Hide resolved
src/runtime/crt/memory/stack_allocator.c Outdated Show resolved Hide resolved
include/tvm/runtime/crt/stack_allocator.h Show resolved Hide resolved
src/runtime/crt/memory/stack_allocator.c Outdated Show resolved Hide resolved
src/runtime/crt/memory/stack_allocator.c Outdated Show resolved Hide resolved
src/tir/transforms/lower_tvm_builtin.cc Outdated Show resolved Hide resolved
python/tvm/relay/backend/executor_factory.py Outdated Show resolved Hide resolved
@giuseros
Copy link
Contributor Author

Hi @areusch ,
I addressed most of the comments except the stack_allocator. Let's discuss a bit more on the thread here

@giuseros
Copy link
Contributor Author

Hi @areusch ,
I reworked most of the comments except the ones concerning the stack allocator where the discussion is still going on

Giuseppe Rossini added 9 commits May 4, 2021 16:26
Change-Id: I90bced4e18259a6d42e6a406d93958e204f3859e
Change-Id: Id28751b069bd046f00faee301b2b446b2ea4fab8
Change-Id: I06c9f280de0a9bf0ca5545bbbbfcc70cb66831b3
Change-Id: I739f29779862f05def36e5f3e0722019596d17f8
Change-Id: Ie736f40a5225f4e56e79006753d7732127da5408
Change-Id: I83e16068b93aaccc7a86b79d42f13328bc76b53d
Change-Id: I443d72f53913849f3c28fd6e416162d1ca99e647
Change-Id: I7fefbd0076949b9c38d0abbf2759ebf1502de330
Change-Id: Iad028144d7b394b2dd2fce41a35ca689d1680200
Change-Id: I14286e665dcdba1e9bc10bb5a27dd6ced50372b0
Giuseppe Rossini added 2 commits May 4, 2021 18:19
Change-Id: I7b4c966da9680870ceda1704c749ee3bdc751926
Change-Id: Icf62128a604998ed1b7d5af4cbeadf7d39196d0b
@areusch
Copy link
Contributor

areusch commented May 5, 2021

@manupa-arm please take another look and explicitly approve if you're okay with this!
https://tvm.apache.org/docs/contribute/code_review.html#approve-and-request-changes-explicitly

Copy link
Contributor

@manupak manupak left a comment

Choose a reason for hiding this comment

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

LGTM

@areusch areusch merged commit f85cab2 into apache:main May 5, 2021
@areusch
Copy link
Contributor

areusch commented May 5, 2021

thanks @giuseros for your hard work on this effort and for bearing with me through a long review! and thanks @manupa-arm @jroesch @tqchen @tkonolige @jwfromm for helping to review the PR!

areusch added a commit to areusch/tvm that referenced this pull request May 5, 2021
tqchen pushed a commit that referenced this pull request May 6, 2021
trevor-m pushed a commit to trevor-m/tvm that referenced this pull request May 6, 2021
* [AOT] Introducing AOT in TVM

This change adds the code generation and minimal runtime API to use the
Ahead Of Time (AOT) compilation flow. The main logic is contained in:

- src/relay/backend/aot_codegen.cc

Which produces a TIR PrimFunc traversing the Relay graph

The runtime interface (authored by @Mousius) leaves a gap for future
iterations using platform-specific features from RTOS.

Currently AOT runs successfully on x86 in a host OS, running these
tests on micro is coming soon.

This PR is based on the RFC described here: https://discuss.tvm.apache.org/t/implementing-aot-in-tvm/9206

Co-authored-by: Christopher Sidebottom <Christopher.Sidebottom@arm.com>
Change-Id: I9f731c953231f129e1472298915dddc01788efd7

* Rebasing 2

Change-Id: Ia0a533a49960f1cb4bf3c3833511e539cf7c459f

* Applying comments/refactoring

Change-Id: Iea1832355f8b1d4c921d02c6b4ceec7db3a681c1

* Fixing comments + refactoring - 2

Change-Id: I7200cc17b297e42bf67dcdef6f643e86991ca0a8

* fix linting

Change-Id: Iba6544ac7101595696b352b8702345cf916625f6

* fix linting - 2

Change-Id: I7f80d16005f2c621d37a9aae2cbbd61df0277cbe

* fix linting - 3

Change-Id: I7a1ba40afeea46d5f122563a20cd4b2f08751a1e

* fix tests

Change-Id: I1297ccc54dd6d93647f421e0beb226f410bf73f5

* Addressing comments - 3

Change-Id: Id25d1382c30d6d0a0013b5e8986fb8cd886666dc

* Addressing comments - 4

Change-Id: Ibe29676abe3b75161b5a0903e007118a8318d862

* fix tests - 2

Change-Id: I2117f9d4392bfd87102ecbef0993c8b320f479a0

* fix tests - 3

Change-Id: Ic0373543b0f9a54dbd4dc32d428272f7293200ba

* fix tests - 4

Change-Id: I8a6f229c9a3a9e169779c8d49cbfa3f473348b1f

* Addressing comments - 5

Change-Id: Ib9ccd07c87392034a21b2eb70955d0b091b780f1

* fix tests - 5

Change-Id: I4b13c3b548ced414991e83072e9e6fc99b64f939

* fix tests - 6

Change-Id: Id5af1f778ae25bc60849cc054a605181c1b7a765

* addressing comments - 6

Change-Id: Id94a2bbcaae891f9498d41be538f13a952f55b81

* fix linting - 4

Change-Id: I371a0aa5b81824b5a3a1278fac22ace57832027a

* add missing file

Change-Id: If359bef96dd0773ead4f75f0d9f5234276347e2d

* fix build

Change-Id: I73fc1feb6f7b5d454a528e3289228484dc2b07d5

* addressing comments - 7

Change-Id: I7f908f3908ffc77e408391f62edcc06f2600c6c2

* addressing comments - 8

Change-Id: I90bced4e18259a6d42e6a406d93958e204f3859e

* rebasing

Change-Id: Id28751b069bd046f00faee301b2b446b2ea4fab8

* Addressing comments - 9

Change-Id: I06c9f280de0a9bf0ca5545bbbbfcc70cb66831b3

* fix tests - 7

Change-Id: I739f29779862f05def36e5f3e0722019596d17f8

* Addressing comments - 9

Change-Id: Ie736f40a5225f4e56e79006753d7732127da5408

* Applying comments + fixing tests

Change-Id: I83e16068b93aaccc7a86b79d42f13328bc76b53d

* Applying comments - 10

Change-Id: I443d72f53913849f3c28fd6e416162d1ca99e647

* Addressing comments - 11

Change-Id: I7fefbd0076949b9c38d0abbf2759ebf1502de330

* Addressing comments - 11

Change-Id: Iad028144d7b394b2dd2fce41a35ca689d1680200

* fix tests - 7

Change-Id: I14286e665dcdba1e9bc10bb5a27dd6ced50372b0

* fixing tests -8

Change-Id: I7b4c966da9680870ceda1704c749ee3bdc751926

* fixing tests - 9

Change-Id: Icf62128a604998ed1b7d5af4cbeadf7d39196d0b

Co-authored-by: Christopher Sidebottom <Christopher.Sidebottom@arm.com>
trevor-m pushed a commit to trevor-m/tvm that referenced this pull request May 6, 2021
trevor-m pushed a commit to trevor-m/tvm that referenced this pull request May 6, 2021
* [AOT] Introducing AOT in TVM

This change adds the code generation and minimal runtime API to use the
Ahead Of Time (AOT) compilation flow. The main logic is contained in:

- src/relay/backend/aot_codegen.cc

Which produces a TIR PrimFunc traversing the Relay graph

The runtime interface (authored by @Mousius) leaves a gap for future
iterations using platform-specific features from RTOS.

Currently AOT runs successfully on x86 in a host OS, running these
tests on micro is coming soon.

This PR is based on the RFC described here: https://discuss.tvm.apache.org/t/implementing-aot-in-tvm/9206

Co-authored-by: Christopher Sidebottom <Christopher.Sidebottom@arm.com>
Change-Id: I9f731c953231f129e1472298915dddc01788efd7

* Rebasing 2

Change-Id: Ia0a533a49960f1cb4bf3c3833511e539cf7c459f

* Applying comments/refactoring

Change-Id: Iea1832355f8b1d4c921d02c6b4ceec7db3a681c1

* Fixing comments + refactoring - 2

Change-Id: I7200cc17b297e42bf67dcdef6f643e86991ca0a8

* fix linting

Change-Id: Iba6544ac7101595696b352b8702345cf916625f6

* fix linting - 2

Change-Id: I7f80d16005f2c621d37a9aae2cbbd61df0277cbe

* fix linting - 3

Change-Id: I7a1ba40afeea46d5f122563a20cd4b2f08751a1e

* fix tests

Change-Id: I1297ccc54dd6d93647f421e0beb226f410bf73f5

* Addressing comments - 3

Change-Id: Id25d1382c30d6d0a0013b5e8986fb8cd886666dc

* Addressing comments - 4

Change-Id: Ibe29676abe3b75161b5a0903e007118a8318d862

* fix tests - 2

Change-Id: I2117f9d4392bfd87102ecbef0993c8b320f479a0

* fix tests - 3

Change-Id: Ic0373543b0f9a54dbd4dc32d428272f7293200ba

* fix tests - 4

Change-Id: I8a6f229c9a3a9e169779c8d49cbfa3f473348b1f

* Addressing comments - 5

Change-Id: Ib9ccd07c87392034a21b2eb70955d0b091b780f1

* fix tests - 5

Change-Id: I4b13c3b548ced414991e83072e9e6fc99b64f939

* fix tests - 6

Change-Id: Id5af1f778ae25bc60849cc054a605181c1b7a765

* addressing comments - 6

Change-Id: Id94a2bbcaae891f9498d41be538f13a952f55b81

* fix linting - 4

Change-Id: I371a0aa5b81824b5a3a1278fac22ace57832027a

* add missing file

Change-Id: If359bef96dd0773ead4f75f0d9f5234276347e2d

* fix build

Change-Id: I73fc1feb6f7b5d454a528e3289228484dc2b07d5

* addressing comments - 7

Change-Id: I7f908f3908ffc77e408391f62edcc06f2600c6c2

* addressing comments - 8

Change-Id: I90bced4e18259a6d42e6a406d93958e204f3859e

* rebasing

Change-Id: Id28751b069bd046f00faee301b2b446b2ea4fab8

* Addressing comments - 9

Change-Id: I06c9f280de0a9bf0ca5545bbbbfcc70cb66831b3

* fix tests - 7

Change-Id: I739f29779862f05def36e5f3e0722019596d17f8

* Addressing comments - 9

Change-Id: Ie736f40a5225f4e56e79006753d7732127da5408

* Applying comments + fixing tests

Change-Id: I83e16068b93aaccc7a86b79d42f13328bc76b53d

* Applying comments - 10

Change-Id: I443d72f53913849f3c28fd6e416162d1ca99e647

* Addressing comments - 11

Change-Id: I7fefbd0076949b9c38d0abbf2759ebf1502de330

* Addressing comments - 11

Change-Id: Iad028144d7b394b2dd2fce41a35ca689d1680200

* fix tests - 7

Change-Id: I14286e665dcdba1e9bc10bb5a27dd6ced50372b0

* fixing tests -8

Change-Id: I7b4c966da9680870ceda1704c749ee3bdc751926

* fixing tests - 9

Change-Id: Icf62128a604998ed1b7d5af4cbeadf7d39196d0b

Co-authored-by: Christopher Sidebottom <Christopher.Sidebottom@arm.com>
trevor-m pushed a commit to trevor-m/tvm that referenced this pull request May 6, 2021
trevor-m pushed a commit to trevor-m/tvm that referenced this pull request May 6, 2021
* [AOT] Introducing AOT in TVM

This change adds the code generation and minimal runtime API to use the
Ahead Of Time (AOT) compilation flow. The main logic is contained in:

- src/relay/backend/aot_codegen.cc

Which produces a TIR PrimFunc traversing the Relay graph

The runtime interface (authored by @Mousius) leaves a gap for future
iterations using platform-specific features from RTOS.

Currently AOT runs successfully on x86 in a host OS, running these
tests on micro is coming soon.

This PR is based on the RFC described here: https://discuss.tvm.apache.org/t/implementing-aot-in-tvm/9206

Co-authored-by: Christopher Sidebottom <Christopher.Sidebottom@arm.com>
Change-Id: I9f731c953231f129e1472298915dddc01788efd7

* Rebasing 2

Change-Id: Ia0a533a49960f1cb4bf3c3833511e539cf7c459f

* Applying comments/refactoring

Change-Id: Iea1832355f8b1d4c921d02c6b4ceec7db3a681c1

* Fixing comments + refactoring - 2

Change-Id: I7200cc17b297e42bf67dcdef6f643e86991ca0a8

* fix linting

Change-Id: Iba6544ac7101595696b352b8702345cf916625f6

* fix linting - 2

Change-Id: I7f80d16005f2c621d37a9aae2cbbd61df0277cbe

* fix linting - 3

Change-Id: I7a1ba40afeea46d5f122563a20cd4b2f08751a1e

* fix tests

Change-Id: I1297ccc54dd6d93647f421e0beb226f410bf73f5

* Addressing comments - 3

Change-Id: Id25d1382c30d6d0a0013b5e8986fb8cd886666dc

* Addressing comments - 4

Change-Id: Ibe29676abe3b75161b5a0903e007118a8318d862

* fix tests - 2

Change-Id: I2117f9d4392bfd87102ecbef0993c8b320f479a0

* fix tests - 3

Change-Id: Ic0373543b0f9a54dbd4dc32d428272f7293200ba

* fix tests - 4

Change-Id: I8a6f229c9a3a9e169779c8d49cbfa3f473348b1f

* Addressing comments - 5

Change-Id: Ib9ccd07c87392034a21b2eb70955d0b091b780f1

* fix tests - 5

Change-Id: I4b13c3b548ced414991e83072e9e6fc99b64f939

* fix tests - 6

Change-Id: Id5af1f778ae25bc60849cc054a605181c1b7a765

* addressing comments - 6

Change-Id: Id94a2bbcaae891f9498d41be538f13a952f55b81

* fix linting - 4

Change-Id: I371a0aa5b81824b5a3a1278fac22ace57832027a

* add missing file

Change-Id: If359bef96dd0773ead4f75f0d9f5234276347e2d

* fix build

Change-Id: I73fc1feb6f7b5d454a528e3289228484dc2b07d5

* addressing comments - 7

Change-Id: I7f908f3908ffc77e408391f62edcc06f2600c6c2

* addressing comments - 8

Change-Id: I90bced4e18259a6d42e6a406d93958e204f3859e

* rebasing

Change-Id: Id28751b069bd046f00faee301b2b446b2ea4fab8

* Addressing comments - 9

Change-Id: I06c9f280de0a9bf0ca5545bbbbfcc70cb66831b3

* fix tests - 7

Change-Id: I739f29779862f05def36e5f3e0722019596d17f8

* Addressing comments - 9

Change-Id: Ie736f40a5225f4e56e79006753d7732127da5408

* Applying comments + fixing tests

Change-Id: I83e16068b93aaccc7a86b79d42f13328bc76b53d

* Applying comments - 10

Change-Id: I443d72f53913849f3c28fd6e416162d1ca99e647

* Addressing comments - 11

Change-Id: I7fefbd0076949b9c38d0abbf2759ebf1502de330

* Addressing comments - 11

Change-Id: Iad028144d7b394b2dd2fce41a35ca689d1680200

* fix tests - 7

Change-Id: I14286e665dcdba1e9bc10bb5a27dd6ced50372b0

* fixing tests -8

Change-Id: I7b4c966da9680870ceda1704c749ee3bdc751926

* fixing tests - 9

Change-Id: Icf62128a604998ed1b7d5af4cbeadf7d39196d0b

Co-authored-by: Christopher Sidebottom <Christopher.Sidebottom@arm.com>
trevor-m pushed a commit to trevor-m/tvm that referenced this pull request May 6, 2021
trevor-m pushed a commit to neo-ai/tvm that referenced this pull request May 11, 2021
* [AOT] Introducing AOT in TVM

This change adds the code generation and minimal runtime API to use the
Ahead Of Time (AOT) compilation flow. The main logic is contained in:

- src/relay/backend/aot_codegen.cc

Which produces a TIR PrimFunc traversing the Relay graph

The runtime interface (authored by @Mousius) leaves a gap for future
iterations using platform-specific features from RTOS.

Currently AOT runs successfully on x86 in a host OS, running these
tests on micro is coming soon.

This PR is based on the RFC described here: https://discuss.tvm.apache.org/t/implementing-aot-in-tvm/9206

Co-authored-by: Christopher Sidebottom <Christopher.Sidebottom@arm.com>
Change-Id: I9f731c953231f129e1472298915dddc01788efd7

* Rebasing 2

Change-Id: Ia0a533a49960f1cb4bf3c3833511e539cf7c459f

* Applying comments/refactoring

Change-Id: Iea1832355f8b1d4c921d02c6b4ceec7db3a681c1

* Fixing comments + refactoring - 2

Change-Id: I7200cc17b297e42bf67dcdef6f643e86991ca0a8

* fix linting

Change-Id: Iba6544ac7101595696b352b8702345cf916625f6

* fix linting - 2

Change-Id: I7f80d16005f2c621d37a9aae2cbbd61df0277cbe

* fix linting - 3

Change-Id: I7a1ba40afeea46d5f122563a20cd4b2f08751a1e

* fix tests

Change-Id: I1297ccc54dd6d93647f421e0beb226f410bf73f5

* Addressing comments - 3

Change-Id: Id25d1382c30d6d0a0013b5e8986fb8cd886666dc

* Addressing comments - 4

Change-Id: Ibe29676abe3b75161b5a0903e007118a8318d862

* fix tests - 2

Change-Id: I2117f9d4392bfd87102ecbef0993c8b320f479a0

* fix tests - 3

Change-Id: Ic0373543b0f9a54dbd4dc32d428272f7293200ba

* fix tests - 4

Change-Id: I8a6f229c9a3a9e169779c8d49cbfa3f473348b1f

* Addressing comments - 5

Change-Id: Ib9ccd07c87392034a21b2eb70955d0b091b780f1

* fix tests - 5

Change-Id: I4b13c3b548ced414991e83072e9e6fc99b64f939

* fix tests - 6

Change-Id: Id5af1f778ae25bc60849cc054a605181c1b7a765

* addressing comments - 6

Change-Id: Id94a2bbcaae891f9498d41be538f13a952f55b81

* fix linting - 4

Change-Id: I371a0aa5b81824b5a3a1278fac22ace57832027a

* add missing file

Change-Id: If359bef96dd0773ead4f75f0d9f5234276347e2d

* fix build

Change-Id: I73fc1feb6f7b5d454a528e3289228484dc2b07d5

* addressing comments - 7

Change-Id: I7f908f3908ffc77e408391f62edcc06f2600c6c2

* addressing comments - 8

Change-Id: I90bced4e18259a6d42e6a406d93958e204f3859e

* rebasing

Change-Id: Id28751b069bd046f00faee301b2b446b2ea4fab8

* Addressing comments - 9

Change-Id: I06c9f280de0a9bf0ca5545bbbbfcc70cb66831b3

* fix tests - 7

Change-Id: I739f29779862f05def36e5f3e0722019596d17f8

* Addressing comments - 9

Change-Id: Ie736f40a5225f4e56e79006753d7732127da5408

* Applying comments + fixing tests

Change-Id: I83e16068b93aaccc7a86b79d42f13328bc76b53d

* Applying comments - 10

Change-Id: I443d72f53913849f3c28fd6e416162d1ca99e647

* Addressing comments - 11

Change-Id: I7fefbd0076949b9c38d0abbf2759ebf1502de330

* Addressing comments - 11

Change-Id: Iad028144d7b394b2dd2fce41a35ca689d1680200

* fix tests - 7

Change-Id: I14286e665dcdba1e9bc10bb5a27dd6ced50372b0

* fixing tests -8

Change-Id: I7b4c966da9680870ceda1704c749ee3bdc751926

* fixing tests - 9

Change-Id: Icf62128a604998ed1b7d5af4cbeadf7d39196d0b

Co-authored-by: Christopher Sidebottom <Christopher.Sidebottom@arm.com>
trevor-m pushed a commit to neo-ai/tvm that referenced this pull request May 11, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants