Skip to content

Commit 8c0a60b

Browse files
Re-export Q_ANNOTATION_KEY from quantizer annotators package
Differential Revision: D95862010 Pull Request resolved: pytorch#18063
1 parent c85bfe1 commit 8c0a60b

2 files changed

Lines changed: 3 additions & 6 deletions

File tree

examples/qualcomm/custom_op/custom_ops_1.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -70,11 +70,10 @@ def annotate_custom(gm: torch.fx.GraphModule) -> None:
7070
This function is specific for custom op.
7171
The source_fn of the rewritten nn module turns out to be "my_ops.mul3.default"
7272
"""
73-
from executorch.backends.qualcomm.quantizer.annotators import _is_annotated
74-
7573
from executorch.backends.qualcomm.quantizer.qconfig import (
7674
get_ptq_per_channel_quant_config,
7775
)
76+
from executorch.backends.qualcomm.quantizer.rules import _is_annotated
7877
from torch.fx import Node
7978
from torchao.quantization.pt2e.quantizer import QuantizationAnnotation
8079
from torchao.quantization.pt2e.quantizer.quantizer import Q_ANNOTATION_KEY

examples/qualcomm/oss_scripts/fastvit.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,16 +12,13 @@
1212
import numpy as np
1313
import torch
1414

15-
from executorch.backends.qualcomm.quantizer.annotators import (
16-
QuantizationConfig,
17-
QuantizationSpec,
18-
)
1915
from executorch.backends.qualcomm.quantizer.observers.per_channel_param_observer import (
2016
PerChannelParamObserver,
2117
)
2218
from executorch.backends.qualcomm.quantizer.qconfig import (
2319
_derived_bias_quant_spec,
2420
MovingAverageMinMaxObserver,
21+
QuantizationConfig,
2522
)
2623

2724
from executorch.backends.qualcomm.quantizer.quantizer import QuantDtype
@@ -40,6 +37,7 @@
4037
SimpleADB,
4138
topk_accuracy,
4239
)
40+
from torchao.quantization.pt2e.quantizer import QuantizationSpec
4341

4442

4543
def get_instance(repo_path: str, checkpoint_path: str):

0 commit comments

Comments
 (0)