Conversation
🔗 Helpful Links🧪 See artifacts and rendered test results at hud.pytorch.org/pr/pytorch/executorch/22980
Note: Links to docs will display an error until the docs builds have been completed. ❗ 1 Active SEVsThere are 1 currently active SEVs. If your PR is affected, please view them below: ❌ 2 New Failures, 2 Unrelated FailuresAs of commit c472672 with merge base 9b91b43 ( NEW FAILURES - The following jobs have failed:
BROKEN TRUNK - The following jobs failed but were 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. |
Migrate CortexMPassManager to ExportedProgramPassManager so callers can use edge.transform() and to_edge_transform_and_lower() without replacing private program entries. Preserve the existing lowering sequence and legacy entry point, update callers, and cover program state and serialization in tests. Authored with OpenAI Codex.
rascani
force-pushed
the
cortex-m-exported-program-pass-manager
branch
from
September 21, 2026 22:12
54366e3 to
c472672
Compare
rascani
marked this pull request as ready for review
September 21, 2026 22:15
rascani
requested review from
abhinaykukkadapu,
digantdesai,
mergennachin and
psiddh
as code owners
September 21, 2026 22:15
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Passing
CortexMPassManagertoedge.transform()currently fails because it inherits a graph-module pass manager while keeping its lowering pipeline in a separate.transform()method. Callers consequently have to replaceedge._edge_programs["forward"]directly.Make it an
ExportedProgramPassManagerwith a program-aware adapter around the existing pipeline. Each pass is instantiated against the current exported program, preserving updates to constants and graph signatures. This enablesedge.transform(CortexMPassManager(...))andto_edge_transform_and_lower(..., transform_passes=CortexMPassManager(...)), while retaining the legacy bound-program constructor and.transform()entry point. Update the exporters, examples, documentation, and test harness to use the public APIs.Authored with OpenAI Codex.
Test plan
The following tests passed: 307 passed, 1 skipped, and 24 expected failures. The new regression tests cover both layouts and all three entry points, serialization, multiple methods, target configuration, and constant lifting.
python -m pytest -q \ backends/cortex_m/test/test_pass_manager.py \ backends/cortex_m/test/test_explicit_layout_pipeline.py \ backends/cortex_m/test/misc/test_target_config.py OMP_NUM_THREADS=1 python -m pytest -q -n 4 \ backends/cortex_m/test/ops exir/tests/test_pass_infra.py \ -k 'test_dialect or TestExportedProgramPassManager'Additional smoke checks passed for the Arm AOT exporter, CMSIS metadata, and ETRecord generation. Executed the export cells in
examples/arm/ethos_u_cmsis_nn_fallback_example.ipynbwith the pinnedethos-u-vela==5.1.0, confirming that the compiled delegate survives Cortex-M lowering and serialization.Built a fresh Cortex-M55 semihosting runner from this checkout with
CORTEX_M_ENABLE_RUNTIME_CHECKS=ONandEXECUTORCH_ENABLE_PROGRAM_VERIFICATION=ON. Ran four serialized programs on Corstone-300 FVP: mixed Ethos-U/Cortex-M, convolution with each layout, and linear. All four outputs matched quantized PyTorch exactly, with zero maximum absolute error; the mixed case executed one NPU delegation.Lintrunner passed for all 18 changed files. Three independent Codex reviews found no actionable regressions. Buck execution has not been validated locally.
cc @digantdesai @freddan80 @per @zingo @oscarandersson8218 @mansnils @Sebastian-Larsson @robell @psiddh @AdrianLundell