-
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
[CMSIS-NN] Support CMSIS NN from new GitHub location #13656
[CMSIS-NN] Support CMSIS NN from new GitHub location #13656
Conversation
Thanks for contributing to TVM! Please refer to the contributing guidelines https://tvm.apache.org/docs/contribute/ for useful information and tips. Please request code reviews from Reviewers by @-ing them in a comment.
Generated by tvm-bot |
Thanks @NicolaLancellotti for this changes. Looks good to me overall. A small request though - is it possible to checkout the repository with the name |
Done. |
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.
@NicolaLancellotti thanks for this PR!
Could you please add this change to docker script installation?
https://github.com/apache/tvm/blob/main/docker/install/ubuntu_install_cmsis.sh
bdc555b
to
359efd3
Compare
I updated the pr with three commits:
|
Change-Id: I2c39bc671a8a2583f8e271cae98f61f8cabd1ab9
Change-Id: I1585ec3b31626bde5fa5c70224b1c70b48ceeadf
Change-Id: If6237cc6903d03d0e3ff04e849a6812f1980244a
359efd3
to
ff57097
Compare
@@ -85,6 +85,9 @@ cmake -DCMAKE_TOOLCHAIN_FILE=${ethosu_dir}/core_platform/cmake/toolchain/arm-non | |||
make | |||
|
|||
# Build NN Library | |||
mkdir ${CMSIS_PATH}/CMSIS-NN/build/ && cd ${CMSIS_PATH}/CMSIS-NN/build/ | |||
cmake .. -DCMAKE_TOOLCHAIN_FILE=${ethosu_dir}/core_platform/cmake/toolchain/arm-none-eabi-gcc.cmake -DTARGET_CPU=cortex-m55 -DBUILD_CMSIS_NN_FUNCTIONS=YES -DCMSIS_PATH=${CMSIS_PATH} | |||
|
|||
mkdir ${CMSIS_PATH}/CMSIS/NN/build/ && cd ${CMSIS_PATH}/CMSIS/NN/build/ | |||
cmake .. -DCMAKE_TOOLCHAIN_FILE=${ethosu_dir}/core_platform/cmake/toolchain/arm-none-eabi-gcc.cmake -DTARGET_CPU=cortex-m55 -DBUILD_CMSIS_NN_FUNCTIONS=YES | |||
make |
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.
Both of the above commands look similar, I hope they are serving two different things. Can you please revisit them?
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.
The first one builds the new CMSIS-NN
, and the second one builds the old CMSIS/NN
.
When the docker image will be updated I'll remove support for CMSIS/NN
, that is, I''ll revert this commit: ff57097.
@@ -623,7 +624,7 @@ def test_schedule_build_with_cmsis_dependency(workspace_dir, board, microtvm_deb | |||
assert "CMSIS/DSP/Include" in cmake_content | |||
assert "CMSIS/DSP/Include/dsp" in cmake_content | |||
assert "CMSIS/DSP/Include" in cmake_content | |||
assert "CMSIS/NN/Include" in cmake_content | |||
# assert "CMSIS-NN/Include" in cmake_content |
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.
If comment is not useful for future, it can be removed?
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.
In the future, after the docker image will be updated, we want this assert.
CMSIS_NN_PATH = ${CMSIS_PATH}/CMSIS-NN | ||
else | ||
CMSIS_NN_PATH = ${CMSIS_PATH}/CMSIS/NN | ||
endif |
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.
doesn't simply looking for the directory work if [ -d " ${CMSIS_PATH}/CMSIS-NN" ];
for simplicity - just curious?
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.
If you want I can check and improve that, but this code will be reverted when the docker image will be updated.
@@ -31,21 +31,27 @@ find_package(Zephyr HINTS $ENV{ZEPHYR_BASE}) | |||
project(microtvm_autogenerated_project) | |||
|
|||
if(DEFINED CMSIS_PATH) | |||
if (EXISTS ${CMSIS_PATH}/CMSIS-NN) |
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.
Is this a temporary fix until we update the docker image?
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.
Yes it is.
It will be hard to keep track of all the follow up changes that are required after we update the image. Could you please add comment in all of those places so we can track them? |
Hi @mehrdadh, thanks for the review. |
After discussing offline about the remaining issues with @NicolaLancellotti, it looks like the support for the old CMSIS-NN location will be removed in future. Overall the changes LGTM! Thanks @NicolaLancellotti for this critical update. |
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.
LGTM, thanks!
Pr: apache#13656 adds support for the new CMSIS NN project Change-Id: I28e99fd511b42d9a77ebc6bdc085fc5ffc6b533a
Pr: apache#13656 adds support for the new CMSIS NN project Change-Id: I28e99fd511b42d9a77ebc6bdc085fc5ffc6b533a
Pr: #13656 adds support for the new CMSIS NN project After the docker image is updated we can remove support for the old CMSIS NN project.
CMSIS NN has been moved out of the CMSIS project into a new GitHub project. This pr adds support for CMSIS NN from this new GitHub location. Both CMSIS and CMSIS NN are now downloaded in /opt/arm/ethosu/cmsis I updated the pr with three commits: - First, I supported CMSIS NN from the new GitHub location, as previously done. - Second, I prevented the definition of the `cmsis_path` project API option from an environment variable. Before, thanks to the environment variable, the `cmsis_path` option was always enabled. That was not a problem, but now CMSIS NN uses a new header (`arm_acle.h`) which is not always present, so we need to explicitly enable CMSIS when we need it. - In the end, I re-added support for the old location of CMSIS NN because the docker image is not yet updated, and we need the tests to pass to accept this pr. In this way, tvm will use the new CMSIS NN project when we will update the docker image, but for now, it uses the old one. I'll create a pr that reverts this last commit when the docker image is updated.
Pr: apache#13656 adds support for the new CMSIS NN project After the docker image is updated we can remove support for the old CMSIS NN project.
CMSIS NN has been moved out of the CMSIS project into a new GitHub project.
This pr adds support for CMSIS NN from this new GitHub location.
Both CMSIS and CMSIS NN are now downloaded in
/opt/arm/ethosu/cmsis