Arm backend: Direct drive patches and README.md #17735
Arm backend: Direct drive patches and README.md #17735perheld wants to merge 3 commits intopytorch:mainfrom
Conversation
Handle output size mismatches by allocating scratch buffers, invoking the driver, then post‑processing with copy_with_layout_adjustment instead of failing on size mismatch. Signed-off-by: Per Held <per.held@arm.com> Change-Id: Iaa20077e06404a7da1c25ae2d837d1b9291f67d4
Add arm-ethosu-linux preset file and wire CMake preset to it Signed-off-by: per.held@arm.com Change-Id: Ice800b6fe0eb7befbdd62509cd7186f2977cba25
Change-Id: I46fb3c86a14b169b73ef79a7cb3cc38bef66ceac Signed-off-by: per.held@arm.com
🔗 Helpful Links🧪 See artifacts and rendered test results at hud.pytorch.org/pr/pytorch/executorch/17735
Note: Links to docs will display an error until the docs builds have been completed. ❌ 3 New Failures, 1 Cancelled JobAs of commit c8c9a44 with merge base 331ac4a ( NEW FAILURES - The following jobs have failed:
CANCELLED JOB - The following job was cancelled. Please retry:
This comment was automatically generated by Dr. CI and updates every 15 minutes. |
There was a problem hiding this comment.
Pull request overview
Updates the Arm backend to better support the experimental “Direct Drive” Ethos-U85-on-Linux workflow by adjusting runtime output handling, documenting the workflow, and centralizing the CMake preset configuration into a preset file.
Changes:
- Add an
arm_ethosu_linux.cmakepreset file and switch thearm-ethosu-linuxCMake preset to reference it. - Update the Ethos-U Cortex-A (Linux) runtime path to handle output buffer size/layout mismatches via scratch buffering + layout adjustment instead of failing.
- Expand
backends/arm/README.mdwith target-specific build/setup sections, including Direct Drive workflow instructions.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| tools/cmake/preset/arm_ethosu_linux.cmake | New build preset file for Ethos-U Linux, including Release-flag adjustment. |
| CMakePresets.json | Switch arm-ethosu-linux to load the new preset file instead of inline cache variables. |
| backends/arm/runtime/EthosUBackend_Cortex_A.cpp | Adjust Linux output handling to support IO/tensor size mismatch using scratch buffers + copy_with_layout_adjustment. |
| backends/arm/README.md | Document target workflows and add Direct Drive setup/build/run instructions. |
Comments suppressed due to low confidence (2)
tools/cmake/preset/arm_ethosu_linux.cmake:19
CMAKE_C_FLAGS_RELEASE/CMAKE_CXX_FLAGS_RELEASEare being set to just-UNDEBUG, which overwrites CMake’s default Release flags (typically includes-O*and-DNDEBUG). This can unintentionally strip optimizations and other Release settings. Prefer appending-UNDEBUGto the existing*_FLAGS_RELEASE(or adding it via a config-specificadd_compile_optionsgenerator expression) instead of replacing the variable value outright.
set(CMAKE_C_FLAGS_RELEASE
"-UNDEBUG"
CACHE STRING "Avoid NDEBUG forward-decl mismatch in musl Release builds"
)
set(CMAKE_CXX_FLAGS_RELEASE
"-UNDEBUG"
CACHE STRING "Avoid NDEBUG forward-decl mismatch in musl Release builds"
)
backends/arm/README.md:110
- This section says each target flow has both a one-time setup step and a build command, but the VGF workflow currently documents only the setup step (no build invocation). Either add the corresponding build command for VGF or adjust the wording so it doesn’t promise a build step for every flow.
Pick one of the target flows below. Each flow has a one-time setup step and a build command.
### Baremetal (Ethos-U) workflow
Builds ExecuTorch runtime libraries for Cortex-M with Ethos-U acceleration.
Setup:
./examples/arm/setup.sh --i-agree-to-the-contained-eula
Build:
./backends/arm/scripts/build_executorch.sh
### VGF (Vulkan ML extensions) workflow
Setup:
./examples/arm/setup.sh --disable-ethos-u-deps --enable-mlsdk-deps
The current flow lowers to TOSA and converts to VGF for use in external projects,
so the `executor_runner` is not typically used here.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
Hi @SS-JIA this adds a file and also updates files outside Arm folder (but in Arm parts) |
cc @digantdesai @SS-JIA @freddan80 @per @zingo @oscarandersson8218 @mansnils @Sebastian-Larsson @robell