Skip to content

Arm backend: Allow PatternQuantizer to annotate all nodes with None#19639

Merged
AdrianLundell merged 1 commit into
pytorch:mainfrom
AdrianLundell:change-1260609
May 19, 2026
Merged

Arm backend: Allow PatternQuantizer to annotate all nodes with None#19639
AdrianLundell merged 1 commit into
pytorch:mainfrom
AdrianLundell:change-1260609

Conversation

@AdrianLundell
Copy link
Copy Markdown
Collaborator

@AdrianLundell AdrianLundell commented May 18, 2026

Previously it required nodes to be part of the quantizer support_dict, ignoring nodes quantized by the SharedQspecQuantizer.

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

Previously it required nodes to be part of the quantizer support_dict,
ignoring nodes quantized by the SharedQspecQuantizer.

Signed-off-by: Adrian Lundell <adrian.lundell@arm.com>
Change-Id: Ie89126cf0dd8cf5fb1206777e3f7912296f46da5
Copilot AI review requested due to automatic review settings May 18, 2026 14:08
@AdrianLundell AdrianLundell added ciflow/trunk module: arm Issues related to arm backend release notes: none Do not include this in the release notes labels May 18, 2026
@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 May 18, 2026
@pytorch-bot
Copy link
Copy Markdown

pytorch-bot Bot commented May 18, 2026

🔗 Helpful Links

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

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

❗ 1 Active SEVs

There are 1 currently active SEVs. If your PR is affected, please view them below:

❌ 3 New Failures

As of commit 75173ad with merge base a142873 (image):

NEW FAILURES - The following jobs have failed:

This comment was automatically generated by Dr. CI and updates every 15 minutes.

Copy link
Copy Markdown
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

This PR updates Arm/Cortex-M pattern matching so PatternQuantizer can explicitly annotate nodes with None to reject quantization, including nodes normally handled by shared-qspec annotation.

Changes:

  • Allows PatternMatcher APIs to receive Optional[QuantizationConfig].
  • Adds a None config path that marks individual nodes as matched.
  • Adds selective quantization tests for composable quantizer None behavior.

Reviewed changes

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

File Description
backends/cortex_m/quantizer/pattern_matcher.py Adds None quantization-config handling in pattern matching.
backends/arm/test/quantizer/test_selective_quantization.py Adds composable quantizer tests for node target, IO, and global None configs.

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

Comment on lines +124 to +130
if node.meta.get(self.Q_PATTERN_MATCHED_KEY, False):
return [
PatternMatchResult([node], False, self.REJECT_PREVIOUSLY_ANNOTATED)
]

node.meta[self.Q_PATTERN_MATCHED_KEY] = True
return [PatternMatchResult([node], True)]
Comment on lines +169 to +173
qspecs={
"aten.cat.default": {
None: 1,
},
},
@AdrianLundell AdrianLundell merged commit b213b42 into pytorch:main May 19, 2026
447 of 456 checks passed
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: arm Issues related to arm backend release notes: none Do not include this in the release notes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants