Skip to content

Reverts the addition of RemoveNoopPass to the Cortex-M pass manager…#17407

Merged
psiddh merged 1 commit intomainfrom
follow
Feb 12, 2026
Merged

Reverts the addition of RemoveNoopPass to the Cortex-M pass manager…#17407
psiddh merged 1 commit intomainfrom
follow

Conversation

@psiddh
Copy link
Contributor

@psiddh psiddh commented Feb 12, 2026

… (introduced in #17300) which broke 8 quantization tests.

After #17300 merged, the following tests started failing:

  • test_shared_qspec_quantizer[input_fork_x_shared]
  • test_shared_qspec_quantizer[input_fork_y_shared]
  • test_shared_qspec_quantizer[surrounded_quantized_op]
  • test_shared_qspec_quantizer[output_fork_shared]
  • test_shared_qspec_quantizer[many_forks]
  • test_dialect_mv2[mobilenet_v2] (+ 2 more)

RemoveNoopPass removes clone_dim_order operators that are functionally necessary for shared quantization specs. It only checks dtype equality, not dim_order/layout changes, causing it to incorrectly remove clones needed for:

  • Tensor forking in quantized graphs
  • Shared quantization parameter propagation
  • Correct quantization fusion

Remove RemoveNoopPass from the Cortex-M pass pipeline. The MobileNetV2 clone_dim_order issue it was meant to address needs a more targeted solution.

pytest -c backends/arm/test/pytest.ini backends/cortex_m/test/misc/test_quantization.py::test_shared_qspec_quantizer -v
pytest -c backends/arm/test/pytest.ini backends/cortex_m/test/models/test_mobilenet_v2.py::test_dialect_mv2 -v

… (introduced in #17300) which broke 8 quantization tests.

After #17300 merged, the following tests started failing:
- `test_shared_qspec_quantizer[input_fork_x_shared]`
- `test_shared_qspec_quantizer[input_fork_y_shared]`
- `test_shared_qspec_quantizer[surrounded_quantized_op]`
- `test_shared_qspec_quantizer[output_fork_shared]`
- `test_shared_qspec_quantizer[many_forks]`
- `test_dialect_mv2[mobilenet_v2]` (+ 2 more)

`RemoveNoopPass` removes `clone_dim_order` operators that are functionally necessary for shared quantization specs. It only checks dtype equality, not dim_order/layout changes, causing it to incorrectly remove clones needed for:
- Tensor forking in quantized graphs
- Shared quantization parameter propagation
- Correct quantization fusion

Remove `RemoveNoopPass` from the Cortex-M pass pipeline. The MobileNetV2 `clone_dim_order` issue it was meant to address needs a more targeted solution.

```bash
pytest -c backends/arm/test/pytest.ini backends/cortex_m/test/misc/test_quantization.py::test_shared_qspec_quantizer -v
pytest -c backends/arm/test/pytest.ini backends/cortex_m/test/models/test_mobilenet_v2.py::test_dialect_mv2 -v
Copilot AI review requested due to automatic review settings February 12, 2026 01:23
@pytorch-bot pytorch-bot bot added the ci-no-td label Feb 12, 2026
@pytorch-bot
Copy link

pytorch-bot bot commented Feb 12, 2026

🔗 Helpful Links

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

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

❌ 2 New Failures, 84 Pending

As of commit abadaa6 with merge base 429925d (image):

NEW FAILURES - The following jobs have failed:

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 12, 2026
@psiddh psiddh requested a review from metascroy February 12, 2026 01:24
@github-actions
Copy link

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.

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

Reverts the recently-added RemoveNoopPass from the Cortex-M pass pipeline to prevent incorrect removal of _clone_dim_order ops that are required for shared quantization spec behavior (fixing the quantization test regressions introduced in #17300).

Changes:

  • Remove RemoveNoopPass from CortexMPassManager to preserve necessary clone_dim_order ops.
  • Update the MobileNetV2 Cortex-M dialect test expectations to include one remaining clone_dim_order op after transforms.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
backends/cortex_m/passes/cortex_m_pass_manager.py Drops RemoveNoopPass from the Cortex-M pass list to avoid stripping required dim-order clones.
backends/cortex_m/test/models/test_mobilenet_v2.py Updates expected op counts to reflect that clone_dim_order is no longer removed by the pass pipeline.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@psiddh
Copy link
Contributor Author

psiddh commented Feb 12, 2026

Failing mcu test will be fixed by this #17405

@psiddh psiddh merged commit fd0adb6 into main Feb 12, 2026
357 of 365 checks passed
@psiddh psiddh deleted the follow branch February 12, 2026 03:22
@AdrianLundell
Copy link
Collaborator

Hi, have you considered adding cortex-m unittests to your CI?

@AdrianLundell
Copy link
Collaborator

Now the mv2 test is failing instead...

@psiddh
Copy link
Contributor Author

psiddh commented Feb 12, 2026

Now the mv2 test is failing instead...

Should be fixed by #17405.

Yes adding unittests in the next PR, moreover enabling test-mcu-cortex-m-backend / linux-job to run on diff times

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

Labels

ci-no-td ciflow/trunk CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants