Arm backend: Allow PatternQuantizer to annotate all nodes with None#19639
Merged
Conversation
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
🔗 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 SEVsThere are 1 currently active SEVs. If your PR is affected, please view them below: ❌ 3 New FailuresAs of commit 75173ad with merge base a142873 ( NEW FAILURES - The following jobs have 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
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
PatternMatcherAPIs to receiveOptional[QuantizationConfig]. - Adds a
Noneconfig path that marks individual nodes as matched. - Adds selective quantization tests for composable quantizer
Nonebehavior.
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, | ||
| }, | ||
| }, |
zingo
approved these changes
May 18, 2026
rascani
approved these changes
May 18, 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.
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