Uh oh!
There was an error while loading. Please reload this page.
Arm(R) Cortex(R)-M55 CPU and Arm(R) Ethos(TM)-U55 NPU Demo App - #8922
Conversation
Change-Id: I719b176bb98253aacb59af766d4eeacbad142297
9887474 to
5d34b28Comparemanupak
commented
Oct 2, 2021
leandron
commented
Oct 2, 2021
Mousius
left a comment
There was a problem hiding this comment.
Apologies for the late review, I've been through and have some change suggestions, otherwise this is a great demonstration of the power of TVM in embedded 😸
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
areusch
commented
Oct 4, 2021
neat! :) would be interested to discuss about perhaps creating apps/microtvm/ethosu e.g. project API impl. also have one question about the Python deps. |
Changes to address review comments. Change-Id: Ic15ebf3ee0d79a94ad442a83b9db5b3c5f57eaf1
grant-arm
commented
Oct 6, 2021
@Mousius Thanks for all the great comments & suggestions. |
grant-arm
commented
Oct 6, 2021
@areusch Thanks for the comments. |
manupak
commented
Oct 6, 2021
Lets keep this demo for a user seeking to integrate inference to an already existing project rather than generating a new one. However, that does not preclude us creating another demo using project API for other usecases. |
manupak
commented
Oct 6, 2021
@Mousius PTAL |
Mousius
left a comment
There was a problem hiding this comment.
@grant-arm I just have one set of suggestion 😸 thanks for working through this with me.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Refactored convert_image.py Change-Id: I2e6e9dc6722f683182e2bd101c19b36f214c0151
grant-arm
commented
Oct 6, 2021
Thanks for the suggestions @Mousius . Could you please take a look again. |
| header_file.write( | ||
| "#include <tvmgen_default.h>\n" | ||
| + f"const size_t {tensor_name}_len = {tensor_data.size};\n" | ||
| + f'uint8_t {tensor_name}[] __attribute__((section("{section}"), aligned(16))) = "' |
There was a problem hiding this comment.
I don't think you need +es here (see: https://github.com/apache/tvm/blob/main/python/tvm/micro/interface_api.py#L59-L66)
| header_file.write( | |
| "#include <tvmgen_default.h>\n" | |
| +f"const size_t {tensor_name}_len = {tensor_data.size};\n" | |
| +f'uint8_t {tensor_name}[] __attribute__((section("{section}"), aligned(16))) = "' | |
| header_file.write( | |
| "#include <tvmgen_default.h>\n" | |
| f"const size_t {tensor_name}_len = {tensor_data.size};\n" | |
| f'uint8_t {tensor_name}[] __attribute__((section("{section}"), aligned(16))) = "' |
commented
Oct 7, 2021
Thanks @grant-arm@Mousius@leandron@areusch . This is merged now. |
commented
Oct 11, 2021
@grant-arm just to follow-up on my comment, to use the Project API we essentially need to write a |
commented
Oct 18, 2021
How to run a model only on bare metal Arm® Cortex®-M55 CPU not Ethos(TM)-U55 NPU ? |
commented
Oct 18, 2021
@JKANG94 Currently we compile for offloading Conv2D & Depthwise Conv to Ethos(TM)-U55 NPU In order to compile for Arm(R) Cortex(R)-M55 CPU only, we would use: Please note though that if you try this with the current demo and MobileNet v1, when you come to building the project, the linker will complain that the ITCM memory region has overflowed. This is due to the generated code not placing params in any specific section and the linker defaulting to placing them in ITCM. We have WIP to address this. (Please refer to the USMP RFC for pinning constant buffers on different memories) |
commented
Oct 19, 2021
I just ran "run_demo.sh", but there was a error " File "/workcode/tvm/tvm/python/tvm/relay/build_module.py", line 371, in build |
commented
Oct 19, 2021
@JKANG94 thanks for pointing this out. #9218 changes the command line arguments required by tvmc which breaks the existing Arm(R) Cortex(R)-M55 CPU and Arm(R) Ethos(TM)-U55 NPU Demo App. #9323 fixes the demo app. In addition, we plan to enable running the demo app on CI so that we can catch these types of problems in future. |
commented
Oct 20, 2021
@grant-arm Using tvmc, I got operator implementations produced by tvm in codegen folder. I want to deploy these to cortext-m devices standalonely, how to get tvm c runtime static library and tvm c GraphExecutor static library? |
commented
Oct 20, 2021
Hi @JKANG94 , probably the most useful reference is the Makefile in Since we compile with |
commented
Oct 21, 2021
|
commented
Oct 22, 2021
Hope that helps. |
This PR adds a demo application that uses TVM to run a model on bare metal Arm® Cortex®-M55 CPU and Arm® Ethos™-U55 NPU
This PR is blocked on merging #8795 , #8806, #8811, #8849 and #8854. Since this is built on top of all those PR branches, this contains the accumulation of contents of the all the PRs.