Skip to content

Cortex-M: Add MLPerf Tiny model tests#18546

Merged
rascani merged 2 commits intopytorch:mainfrom
rascani:cortex-m-mlperf-tiny-tests
Apr 2, 2026
Merged

Cortex-M: Add MLPerf Tiny model tests#18546
rascani merged 2 commits intopytorch:mainfrom
rascani:cortex-m-mlperf-tiny-tests

Conversation

@rascani
Copy link
Copy Markdown
Contributor

@rascani rascani commented Mar 27, 2026

Summary

Add Cortex-M dialect and implementation tests for DeepAutoEncoder, DS-CNN, MobileNet V1 0.25, and ResNet-8 from the MLPerf Tiny benchmark suite. All 4D model inputs use explicit channels_last memory format as required by CMSIS-NN.

Add atol parameter to CortexMTester.test_dialect() and test_implementation() for models that need relaxed tolerance.

Fix McuTestCase.example_inputs type annotation to accept both tuples and callables, matching actual usage.

Fixes #16038

Test plan

pytest backends/cortex_m/test/models/

cc @psiddh @AdrianLundell @digantdesai

@pytorch-bot
Copy link
Copy Markdown

pytorch-bot Bot commented Mar 27, 2026

🔗 Helpful Links

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

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

❌ 1 New Failure, 3 Unrelated Failures

As of commit eea1921 with merge base c39a0ff (image):

NEW FAILURE - The following job has 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.

@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 Mar 27, 2026
@github-actions
Copy link
Copy Markdown

This PR needs a release notes: label

If your change should be included in the release notes (i.e. would users of this library care about this change?), please use a label starting with release notes:. This helps us keep track and include your important work in the next release notes.

To add a label, you can comment to pytorchbot, for example
@pytorchbot label "release notes: none"

For more information, see
https://github.com/pytorch/pytorch/wiki/PyTorch-AutoLabel-Bot#why-categorize-for-release-notes-and-how-does-it-work.

@zingo zingo added the module: microcontrollers For embedded MCUs like Cortex-M, or RTOS like Zephyr, does not track NPU backend like Arm Ethos. label Mar 28, 2026
@rascani rascani force-pushed the cortex-m-mlperf-tiny-tests branch from eb30d0a to 0468885 Compare March 28, 2026 20:56
@rascani rascani requested review from AdrianLundell and psiddh March 28, 2026 20:58
@rascani rascani marked this pull request as ready for review March 28, 2026 20:59
@rascani rascani force-pushed the cortex-m-mlperf-tiny-tests branch from 0468885 to 95cfdb9 Compare March 28, 2026 21:03
Comment thread backends/cortex_m/test/models/test_resnet8.py Outdated
rascani and others added 2 commits April 1, 2026 16:10
Add Cortex-M dialect and implementation tests for DeepAutoEncoder,
DS-CNN, MobileNet V1 0.25, and ResNet-8 from the MLPerf Tiny benchmark
suite. All 4D model inputs use explicit channels_last memory format as
required by CMSIS-NN.

Add atol parameter to CortexMTester.test_dialect() and
test_implementation() for models that need relaxed tolerance.

Fix McuTestCase.example_inputs type annotation to accept both tuples
and callables, matching actual usage.

Co-authored-by: Claude <noreply@anthropic.com>
The dialect test was using atol=0.1 while the implementation test used
the default atol=1e-03, which is backwards — the CPU graph comparison
should not need a looser tolerance than hardware simulation. Remove the
override; the test passes at the stricter default.

Co-authored-by: Claude <noreply@anthropic.com>
@rascani rascani merged commit 819c7d7 into pytorch:main Apr 2, 2026
414 of 420 checks passed
jpiat pushed a commit to jpiat/executorch that referenced this pull request Apr 14, 2026
### Summary

Add Cortex-M dialect and implementation tests for DeepAutoEncoder,
DS-CNN, MobileNet V1 0.25, and ResNet-8 from the MLPerf Tiny benchmark
suite. All 4D model inputs use explicit channels_last memory format as
required by CMSIS-NN.

Add atol parameter to CortexMTester.test_dialect() and
test_implementation() for models that need relaxed tolerance.

Fix McuTestCase.example_inputs type annotation to accept both tuples and
callables, matching actual usage.

Fixes pytorch#16038

### Test plan
```
pytest backends/cortex_m/test/models/
```


cc @psiddh @AdrianLundell @digantdesai

---------

Co-authored-by: Claude <noreply@anthropic.com>
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. module: microcontrollers For embedded MCUs like Cortex-M, or RTOS like Zephyr, does not track NPU backend like Arm Ethos.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

CORTEX_M: Add more pytest models

3 participants