Cortex_M backend: Add more model tests#19720
Merged
Merged
Conversation
Add model tests of currently not supported models - yolo11 - wav2letter - silero_vad Signed-off-by: Adrian Lundell <adrian.lundell@arm.com> Change-Id: I92e0b8820b89de93567884918d1bf2b684c42440
🔗 Helpful Links🧪 See artifacts and rendered test results at hud.pytorch.org/pr/pytorch/executorch/19720
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: ❌ 1 New FailureAs of commit e5e6b03 with merge base b4a9e72 ( NEW FAILURE - The following job has failed:
This comment was automatically generated by Dr. CI and updates every 15 minutes. |
Contributor
There was a problem hiding this comment.
Pull request overview
Adds new Cortex-M backend model tests intended to track lowering/acceleration progress for currently unsupported models.
Changes:
- Add YOLO11 dialect test using Ultralytics YOLO11n.
- Add Wav2Letter dialect test using the example torchaudio-based model.
- Add Silero VAD (16k) dialect test using the example model definition and fixed op-count expectations.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
| backends/cortex_m/test/models/test_yolo11.py | Introduces a YOLO11n-based dialect test for progress tracking. |
| backends/cortex_m/test/models/test_wav2letter.py | Introduces a Wav2Letter dialect test using the examples model. |
| backends/cortex_m/test/models/test_silero_vad.py | Introduces a Silero VAD 16k dialect test with expected op-counts before/after transforms. |
Comments suppressed due to low confidence (2)
backends/cortex_m/test/models/test_wav2letter.py:34
- The docstring says this model currently doesn’t lower due to missing conv1d support, but the test is not marked as expected-failure. As written, this will fail CI until conv1d is implemented. Consider using the
parametrize(..., xfails={"wav2letter": "..."}, strict=False)mechanism (or an explicitpytest.mark.xfail) so the test can track progress without breaking the suite.
@parametrize("test_case", test_cases)
def test_dialect_wav2letter(test_case):
"""This model currently does largely not lower to accelerated kernels due to missing conv1d support, this test is to track development progress."""
inputs = test_case.get_example_inputs()
tester = CortexMTester(test_case.model, inputs)
tester.test_dialect(
ops_before_transforms,
ops_after_transforms,
qtol=10,
)
backends/cortex_m/test/models/test_yolo11.py:45
- The docstring indicates YOLO11 currently does not lower in the Cortex-M backend, but the test isn’t marked xfail/skip. That will make the test suite fail until support lands. Use
parametrize(..., xfails={"yolo11n": "..."}, strict=False)(or equivalentpytest.mark.xfail) so it can serve as a progress tracker without blocking CI.
@parametrize("test_case", test_cases)
def test_dialect_yolo11(test_case):
"""This model currently does not lower in the cortex-m backend, this test is to track development progress."""
inputs = test_case.get_example_inputs()
tester = CortexMTester(test_case.model, inputs)
tester.test_dialect(
ops_before_transforms,
ops_after_transforms,
qtol=10,
)
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
+5
to
+7
|
|
||
| from executorch.backends.arm.test.common import parametrize | ||
| from executorch.backends.cortex_m.test.tester import CortexMTester, McuTestCase |
Comment on lines
+23
to
+38
| yolo = YOLO(WEIGHTS) | ||
| pt_model = yolo.model.eval() | ||
|
|
||
| test_cases = { | ||
| "yolo11n": McuTestCase( | ||
| model=pt_model, | ||
| example_inputs=lambda: ( | ||
| torch.randn(1, 3, 640, 640).to(memory_format=torch.channels_last), | ||
| ), | ||
| ), | ||
| } | ||
|
|
||
|
|
||
| @parametrize("test_case", test_cases) | ||
| def test_dialect_yolo11(test_case): | ||
| """This model currently does not lower in the cortex-m backend, this test is to track development progress.""" |
Comment on lines
+85
to
+94
| @parametrize("test_case", test_cases) | ||
| def test_dialect_silero_vad_16k(test_case): | ||
| """This model currently does largely not lower to accelerated kernels due to missing LSTM and conv1d support, this test is to track development progress.""" | ||
| inputs = test_case.get_example_inputs() | ||
| tester = CortexMTester(test_case.model, inputs) | ||
| tester.test_dialect( | ||
| ops_before_transforms, | ||
| ops_after_transforms, | ||
| qtol=10, | ||
| ) |
rascani
approved these changes
May 21, 2026
digantdesai
approved these changes
May 21, 2026
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.
Add model tests of currently not supported models
cc @digantdesai @freddan80 @per @zingo @oscarandersson8218 @mansnils @Sebastian-Larsson @robell @rascani