Skip to content

Build and install cmsis_nn pybinds with executorch#20531

Open
Erik-Lundell wants to merge 2 commits into
pytorch:mainfrom
Erik-Lundell:in-wheel-pybinds
Open

Build and install cmsis_nn pybinds with executorch#20531
Erik-Lundell wants to merge 2 commits into
pytorch:mainfrom
Erik-Lundell:in-wheel-pybinds

Conversation

@Erik-Lundell

@Erik-Lundell Erik-Lundell commented Jun 26, 2026

Copy link
Copy Markdown
Collaborator

The package is not available on pypi, and is needed aot. Therefore, add it as a BuiltExtension in setup.py, and wire the cmake up to build it by default with the pybind.cmake preset, that is used when building the executorch wheel.

A pip installation of cmsis_nn can still be used in backends.cortex_m.library.cmsis_nn as a backup.

Tested in all wheel smoke tests.

Additionally:

  • Move cmsis_nn build into the cortex_m build folder
  • Remove git+pip cmsis_nn install path, deprecating the --disable-cortex-m-deps flag in setup.sh
  • Remove pyproject.toml additional dependencies [cortex_m], since cmsis_nn is now included with executorch.
  • CMSIS-NN requires pybind11 as a python dependency.

From a local test, the new dependency adds

  • 5 sec to a configure time of ~15s
  • 3 sec to a build time of ~10 min

cc @digantdesai @freddan80 @per @zingo @oscarandersson8218 @mansnils @Sebastian-Larsson @robell @rascani

The package is not available on pypi, and is needed aot.
Therefore, add it as a BuiltExtension in setup.py, and wire
the cmake up to build it by default with the pybind.cmake
preset, that is used when building the executorch wheel.

A pip installation of cmsis_nn can still be used in
backends.cortex_m.library.cmsis_nn as a backup.

Tested in all wheel smoke tests.

Additionally:
- Move cmsis_nn build into the cortex_m build folder
- Remove git+pip cmsis_nn install path, deprecating the
--disable-cortex-m-deps flag in setup.sh
- Remove pyproject.toml additional dependencies [cortex_m], since
cmsis_nn is now included with executorch.
- CMSIS-NN requires pybind11 as a python dependency.

From a local test, the new dependency adds
- 5 sec to a configure time of ~15s
- 3 sec to a build time of ~10 min

Signed-off-by: Erik Lundell <erik.lundell@arm.com>
Change-Id: Idb79e37dd1cf28f351062e0181140a50a8e7cae4
@pytorch-bot

pytorch-bot Bot commented Jun 26, 2026

Copy link
Copy Markdown

🔗 Helpful Links

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

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

❌ 2 New Failures, 4 Unrelated Failures, 4 Unclassified Failures

As of commit cd8a1e1 with merge base 6021a58 (image):

NEW FAILURES - The following jobs have failed:

UNCLASSIFIED FAILURES - DrCI could not classify the following jobs because the workflow did not run on the merge base. The failures may be pre-existing on trunk or introduced by this PR:

FLAKY - The following job failed but was likely due to flakiness present on trunk:

BROKEN TRUNK - The following jobs failed but was present on the merge base:

👉 Rebase onto the `viable/strict` branch to avoid these failures

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 Jun 26, 2026
@github-actions github-actions Bot added ciflow/trunk module: arm Issues related to arm backend labels Jun 26, 2026
@Erik-Lundell Erik-Lundell added partner: arm For backend delegation, kernels, demo, etc. from the 3rd-party partner, Arm help wanted Extra attention is needed ciflow/trunk release notes: none Do not include this in the release notes and removed ciflow/trunk module: arm Issues related to arm backend labels Jun 26, 2026
Signed-off-by: Erik Lundell <erik.lundell@arm.com>
Change-Id: Ia9f9239e0a19b47a4a8480b86693a5f9236beff5
@github-actions github-actions Bot added the module: arm Issues related to arm backend label Jun 26, 2026
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. help wanted Extra attention is needed module: arm Issues related to arm backend partner: arm For backend delegation, kernels, demo, etc. from the 3rd-party partner, Arm release notes: none Do not include this in the release notes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant