-
Couldn't load subscription status.
- Fork 700
Added Command Line Option to Select Arm Zephyr Toolchain #12077
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
Conversation
🔗 Helpful Links🧪 See artifacts and rendered test results at hud.pytorch.org/pr/pytorch/executorch/12077
Note: Links to docs will display an error until the docs builds have been completed. ✅ No FailuresAs of commit 6eb6daa with merge base 1b42512 ( This comment was automatically generated by Dr. CI and updates every 15 minutes. |
|
@pytorchbot label "release notes: none" |
|
@digantdesai @zingo @perheld The Arm Zephyr cmake Preset PR was getting too big and including features that weren't directly related to the goal of that PR. I'm splitting into other smaller, more modular PRs to make them easier to review and land. This one is exclusively adding the toolchain option to the |
f2d468c to
6eb6daa
Compare
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
### Summary This change adds a cmake preset for Arm Zephyr RTOS toolchain. This requires the toolchain cmake compilation target to be added to `PATH` (see #12077 for more details). This change includes update to CI flows, modifying the CI `build_size_test` to run the test using either arm bare metal or Zephyr toolchains. Additionally, the CI for building presets is updated to target the new cmake Zephyr preset. ### Test plan Tested with `test/build_size_test.sh` to determine the correct threshold for running the size test for the arm zephyr toolchain. When the CI runs the size test for the arm zephyr toolchain, the new cmake preset is used directly. The following commands are run by the CI, and can be manually invoked to confirm functionality: ``` CXXFLAGS="-fno-exceptions -fno-rtti -Wall -Werror -Wno-int-in-bool-context -DET_HAVE_PREAD=0" cmake --preset zephyr -DCMAKE_BUILD_TYPE=Release -DEXECUTORCH_OPTIMIZE_SIZE=ON -DCMAKE_INSTALL_PREFIX=cmake-out -Bcmake-out . cmake --build cmake-out -j9 --target install --config Release CXXFLAGS="-fno-exceptions -fno-rtti -Wall -Werror -Wno-int-in-bool-context -DET_HAVE_PREAD=0" cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_TOOLCHAIN_FILE=$(realpath examples/zephyr/arm-x86-64-eabi-gcc.cmake) -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=cmake-out -Bcmake-out/test test cmake --build cmake-out/test -j9 --config Release arm-zephyr-eabi-strip cmake-out/test/size_test ls -la cmake-out/test/size_test ``` Output should corroborate CI test threshold, reporting a resultant `size_test` binary size of ~125Kb (threshold set to 130KB toin CI test tolerate variability). --------- Co-authored-by: ZephyrUser <[email protected]> Co-authored-by: Github Executorch <[email protected]>
### Summary Adds the command line option `--target-toolchain` to the `examples/arm/setup.sh` script so that Arm Zephyr toolchain for x86-64 Linux host systems can be used. Sourcing the generated `setup_path.sh` puts the selected toolchain on the `PATH` environment variable. ### Test plan Running: ``` ./examples/arm/setup.sh --i-agree-to-the-contained-eula --target-toolchain zephyr source /home/zephyruser/executorch/examples/arm/ethos-u-scratch/setup_path.sh arm-zephyr-eabi-gcc --version ``` Now produces the following output: ``` arm-zephyr-eabi-gcc (Zephyr SDK 0.17.2) 12.2.0 Copyright (C) 2022 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. ``` While running: ``` ./examples/arm/setup.sh --i-agree-to-the-contained-eula source /home/zephyruser/executorch/examples/arm/ethos-u-scratch/setup_path.sh arm-none-eabi-gcc --version ``` Still produces the following output: ``` arm-none-eabi-gcc (Arm GNU Toolchain 13.3.Rel1 (Build arm-13.24)) 13.3.1 20240614 Copyright (C) 2023 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. ```
### Summary This change adds a cmake preset for Arm Zephyr RTOS toolchain. This requires the toolchain cmake compilation target to be added to `PATH` (see pytorch#12077 for more details). This change includes update to CI flows, modifying the CI `build_size_test` to run the test using either arm bare metal or Zephyr toolchains. Additionally, the CI for building presets is updated to target the new cmake Zephyr preset. ### Test plan Tested with `test/build_size_test.sh` to determine the correct threshold for running the size test for the arm zephyr toolchain. When the CI runs the size test for the arm zephyr toolchain, the new cmake preset is used directly. The following commands are run by the CI, and can be manually invoked to confirm functionality: ``` CXXFLAGS="-fno-exceptions -fno-rtti -Wall -Werror -Wno-int-in-bool-context -DET_HAVE_PREAD=0" cmake --preset zephyr -DCMAKE_BUILD_TYPE=Release -DEXECUTORCH_OPTIMIZE_SIZE=ON -DCMAKE_INSTALL_PREFIX=cmake-out -Bcmake-out . cmake --build cmake-out -j9 --target install --config Release CXXFLAGS="-fno-exceptions -fno-rtti -Wall -Werror -Wno-int-in-bool-context -DET_HAVE_PREAD=0" cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_TOOLCHAIN_FILE=$(realpath examples/zephyr/arm-x86-64-eabi-gcc.cmake) -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=cmake-out -Bcmake-out/test test cmake --build cmake-out/test -j9 --config Release arm-zephyr-eabi-strip cmake-out/test/size_test ls -la cmake-out/test/size_test ``` Output should corroborate CI test threshold, reporting a resultant `size_test` binary size of ~125Kb (threshold set to 130KB toin CI test tolerate variability). --------- Co-authored-by: ZephyrUser <[email protected]> Co-authored-by: Github Executorch <[email protected]>
Summary
Adds the command line option
--target-toolchainto theexamples/arm/setup.shscript so that Arm Zephyr toolchain for x86-64 Linux host systems can be used. Sourcing the generatedsetup_path.shputs the selected toolchain on thePATHenvironment variable.Test plan
Running:
Now produces the following output:
While running:
Still produces the following output: