Skip to content

Re-export Q_ANNOTATION_KEY from quantizer annotators package#18063

Merged
meta-codesync[bot] merged 1 commit intopytorch:mainfrom
manuelcandales:export-D95862010
Mar 10, 2026
Merged

Re-export Q_ANNOTATION_KEY from quantizer annotators package#18063
meta-codesync[bot] merged 1 commit intopytorch:mainfrom
manuelcandales:export-D95862010

Conversation

@manuelcandales
Copy link
Contributor

Summary:
D95244673 refactored annotators.py into a package annotators/ but
left __init__.py empty, breaking downstream imports of
Q_ANNOTATION_KEY from executorch.backends.qualcomm.quantizer.annotators.

This fixes type-checking failures.

Reviewed By: Gasoonjia

Differential Revision: D95862010

Copilot AI review requested due to automatic review settings March 10, 2026 17:30
@pytorch-bot
Copy link

pytorch-bot bot commented Mar 10, 2026

🔗 Helpful Links

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

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

❌ 3 New Failures, 1 Pending, 1 Unrelated Failure

As of commit 7b6883e with merge base 7b5c60d (image):

NEW FAILURES - The following jobs have failed:

FLAKY - The following job failed but was likely due to flakiness present on trunk:

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 10, 2026
@meta-codesync
Copy link
Contributor

meta-codesync bot commented Mar 10, 2026

@manuelcandales has exported this pull request. If you are a Meta employee, you can view the originating Diff in D95862010.

@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

This PR aims to address breakages caused by refactoring Qualcomm quantizer annotators into a package, and updates example code to import quantization types/helpers from their new locations.

Changes:

  • Update fastvit.py to import QuantizationConfig from qconfig and QuantizationSpec directly from torchao.
  • Update custom_ops_1.py to import _is_annotated from executorch.backends.qualcomm.quantizer.rules instead of ...quantizer.annotators.

Reviewed changes

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

File Description
examples/qualcomm/oss_scripts/fastvit.py Adjusts quantization-related imports to match the post-refactor module layout.
examples/qualcomm/custom_op/custom_ops_1.py Fixes the import path for _is_annotated used by the custom-op annotation example.

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

You can also share your feedback on Copilot code review. Take the survey.

Comment on lines 18 to 26
from executorch.backends.qualcomm.quantizer.qconfig import (
_derived_bias_quant_spec,
MovingAverageMinMaxObserver,
QuantizationConfig,
)

from executorch.backends.qualcomm.quantizer.quantizer import QuantDtype
from torchao.quantization.pt2e.quantizer import QuantizationSpec
from executorch.backends.qualcomm.serialization.qc_schema import (
Copy link

Copilot AI Mar 10, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

PR title/description indicate restoring downstream import of Q_ANNOTATION_KEY from executorch.backends.qualcomm.quantizer.annotators, but that package’s annotators/__init__.py is still empty in this change set, so downstream imports will still fail. Please re-export Q_ANNOTATION_KEY (and ideally include it in __all__) from backends/qualcomm/quantizer/annotators/__init__.py to actually fix the reported type-checking break.

Copilot uses AI. Check for mistakes.
…#18063)

Summary:

D95244673 refactored `annotators.py` into a package `annotators/` but
left `__init__.py` empty, breaking downstream imports of
`Q_ANNOTATION_KEY` from `executorch.backends.qualcomm.quantizer.annotators`.

This fixes type-checking failures.

Reviewed By: Gasoonjia

Differential Revision: D95862010
@meta-codesync meta-codesync bot merged commit 8c0a60b into pytorch:main Mar 10, 2026
153 of 160 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. fb-exported meta-exported

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants