Skip to content

Arm backend: Direct drive patches and README.md #17735

Open
perheld wants to merge 3 commits intopytorch:mainfrom
perheld:ph-direct-drive
Open

Arm backend: Direct drive patches and README.md #17735
perheld wants to merge 3 commits intopytorch:mainfrom
perheld:ph-direct-drive

Conversation

@perheld
Copy link
Collaborator

@perheld perheld commented Feb 26, 2026

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
Copilot AI review requested due to automatic review settings February 26, 2026 12:13
@perheld perheld added partner: arm For backend delegation, kernels, demo, etc. from the 3rd-party partner, Arm ciflow/trunk release notes: arm Changes to the ARM backend delegate labels Feb 26, 2026
@pytorch-bot
Copy link

pytorch-bot bot commented Feb 26, 2026

🔗 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 Job

As of commit c8c9a44 with merge base 331ac4a (image):

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.

@meta-cla meta-cla 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 Feb 26, 2026
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.cmake preset file and switch the arm-ethosu-linux CMake 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.md with 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_RELEASE are 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 -UNDEBUG to the existing *_FLAGS_RELEASE (or adding it via a config-specific add_compile_options generator 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.

@zingo
Copy link
Collaborator

zingo commented Feb 26, 2026

Hi @SS-JIA this adds a file and also updates files outside Arm folder (but in Arm parts)

Copy link
Collaborator

@zingo zingo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK to merge after @SS-JIA also gives OK :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ciflow/trunk CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. partner: arm For backend delegation, kernels, demo, etc. from the 3rd-party partner, Arm release notes: arm Changes to the ARM backend delegate

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants