Skip to content

Conversation

@BujSet
Copy link
Contributor

@BujSet BujSet commented Jun 27, 2025

Summary

Once setup.sh and PATH have been set to point to Arm Zephyr toolchain, the run.sh script and its child processes must use the specified toolchain. This change adds the plumbing needed to support this. This change does not include the Zephyr binary in the arm_executor_runner, but merely uses allows the runner to be built with a different toolchain.

Test plan

Environment setup:

./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

The following can be run to produce the same results as in the Arm Ethos-U tutorial, now utilizing the Arm Zephyr toolchain instead of the bare metal:

examples/arm/run.sh --toolchain=arm-zephyr-eabi-gcc --model_name=add --no_quantize --target=ethos-u55-128

Which still produces the following output:

I [executorch:arm_executor_runner.cpp:747 main()] Model executed successfully.
I [executorch:arm_executor_runner.cpp:751 main()] 1 outputs:
Output[0][0]: (int) 2
Output[0][1]: (int) 2
Output[0][2]: (int) 2
Output[0][3]: (int) 2
Output[0][4]: (int) 2
I [executorch:arm_executor_runner.cpp:874 main()] Program complete, exiting.
I [executorch:arm_executor_runner.cpp:878 main()] ♦
Info: /OSCI/SystemC: Simulation stopped by user.
[warning ][main@0][3440 ns] Simulation stopped by user
[backends/arm/scripts/run_fvp.sh] Simulation complete, 0
Checking for problems in log:
No problems found!
+ set +x

@pytorch-bot
Copy link

pytorch-bot bot commented Jun 27, 2025

🔗 Helpful Links

🧪 See artifacts and rendered test results at hud.pytorch.org/pr/pytorch/executorch/12078

Note: Links to docs will display an error until the docs builds have been completed.

⏳ No Failures, 9 Pending

As of commit 7ae07c6 with merge base d533a87 (image):
💚 Looks good so far! There are no failures yet. 💚

This comment was automatically generated by Dr. CI and updates every 15 minutes.

@BujSet BujSet self-assigned this Jun 27, 2025
@facebook-github-bot facebook-github-bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label Jun 27, 2025
@BujSet
Copy link
Contributor Author

BujSet commented Jun 27, 2025

@pytorchbot label "release notes: none"

@pytorch-bot pytorch-bot bot added the release notes: none Do not include this in the release notes label Jun 27, 2025
@BujSet
Copy link
Contributor Author

BujSet commented Jun 27, 2025

@digantdesai @zingo @perheld Similar to the PR here. This PR splits part of the Arm Zephyr cmake Preset PR. This PR relates to the changes need for the run.sh script.

cc @larryliu0820

@BujSet BujSet added ciflow/trunk ciflow/binaries module: arm Issues related to arm backend labels Jun 27, 2025
@BujSet BujSet force-pushed the toolchain_select_arm_run branch 2 times, most recently from 4632981 to 53bbe72 Compare June 30, 2025 19:42
@zingo
Copy link
Collaborator

zingo commented Jul 1, 2025

Nice!
Maybe add some note aboutthis in a readme.md somewhere where it make sense?

@BujSet
Copy link
Contributor Author

BujSet commented Jul 1, 2025

Nice! Maybe add some note aboutthis in a readme.md somewhere where it make sense?

Where do you think would make sense to document this? I'm thinking of potentially adding a section to the Arm Ethos-U tutorial. Possibly after the section titled Running on Corstone FVP Platforms. What do you think @zingo?

@BujSet BujSet force-pushed the toolchain_select_arm_run branch from 53bbe72 to d42d2e7 Compare July 1, 2025 18:28
@zingo
Copy link
Collaborator

zingo commented Jul 2, 2025

Nice! Maybe add some note aboutthis in a readme.md somewhere where it make sense?

Where do you think would make sense to document this? I'm thinking of potentially adding a section to the Arm Ethos-U tutorial. Possibly after the section titled Running on Corstone FVP Platforms. What do you think @zingo?

It seem to be a good place if you don't mind. Don't feel it need to be a lot of text, write as much as you want. The important part is to show other how to run you nice stuff so as long a you mention zephyr and some building steps (and maybe running steps when we get that far) people can find it and play with it.

@BujSet
Copy link
Contributor Author

BujSet commented Jul 2, 2025

Nice! Maybe add some note aboutthis in a readme.md somewhere where it make sense?

Where do you think would make sense to document this? I'm thinking of potentially adding a section to the Arm Ethos-U tutorial. Possibly after the section titled Running on Corstone FVP Platforms. What do you think @zingo?

It seem to be a good place if you don't mind. Don't feel it need to be a lot of text, write as much as you want. The important part is to show other how to run you nice stuff so as long a you mention zephyr and some building steps (and maybe running steps when we get that far) people can find it and play with it.

Sounds good, will likely do this in a separate PR. Thanks for the feedback!

@BujSet BujSet marked this pull request as ready for review July 2, 2025 13:05
@BujSet BujSet requested a review from digantdesai as a code owner July 2, 2025 13:05
@BujSet BujSet marked this pull request as draft July 2, 2025 13:58
@BujSet BujSet force-pushed the toolchain_select_arm_run branch from d42d2e7 to db9c0d0 Compare July 2, 2025 14:03
@BujSet BujSet marked this pull request as ready for review July 2, 2025 15:45
@BujSet BujSet force-pushed the toolchain_select_arm_run branch from db9c0d0 to 6a6d47f Compare July 3, 2025 12:58
@BujSet BujSet force-pushed the toolchain_select_arm_run branch from ce9ece8 to 7ae07c6 Compare July 3, 2025 16:25
@BujSet BujSet merged commit 2871fcf into pytorch:main Jul 3, 2025
213 of 218 checks passed
Tanish2101 pushed a commit to Tanish2101/executorch that referenced this pull request Jul 9, 2025
### Summary
Once `setup.sh` and `PATH` have been set to point to Arm Zephyr
toolchain, the `run.sh` script and its child processes must use the
specified toolchain. This change adds the plumbing needed to support
this. This change **does not** include the Zephyr binary in the
`arm_executor_runner`, but merely uses allows the runner to be built
with a different toolchain.

### Test plan

Environment setup:

```
./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
```


The following can be run to produce the same results as in the [Arm
Ethos-U
tutorial](https://docs.pytorch.org/executorch/main/tutorial-arm-ethos-u.html),
now utilizing the Arm Zephyr toolchain instead of the bare metal:

```
examples/arm/run.sh --toolchain=arm-zephyr-eabi-gcc --model_name=add --no_quantize --target=ethos-u55-128
```

Which still produces the following output:

```
I [executorch:arm_executor_runner.cpp:747 main()] Model executed successfully.
I [executorch:arm_executor_runner.cpp:751 main()] 1 outputs:
Output[0][0]: (int) 2
Output[0][1]: (int) 2
Output[0][2]: (int) 2
Output[0][3]: (int) 2
Output[0][4]: (int) 2
I [executorch:arm_executor_runner.cpp:874 main()] Program complete, exiting.
I [executorch:arm_executor_runner.cpp:878 main()] ♦
Info: /OSCI/SystemC: Simulation stopped by user.
[warning ][main@0][3440 ns] Simulation stopped by user
[backends/arm/scripts/run_fvp.sh] Simulation complete, 0
Checking for problems in log:
No problems found!
+ set +x
```
@BujSet BujSet deleted the toolchain_select_arm_run branch July 17, 2025 21:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ciflow/binaries ciflow/trunk CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. module: arm Issues related to arm backend release notes: none Do not include this in the release notes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants