Skip to content

Commit 602e9c3

Browse files
author
Joey Tsai
committed
Fix baed on comments
- Move and rename param_observer.py to per_channel_param_observer.py - Add todo to merge qconfig
1 parent d2d44e1 commit 602e9c3

File tree

4 files changed

+6
-5
lines changed

4 files changed

+6
-5
lines changed

backends/qualcomm/quantizer/observers/param_observer.py renamed to backends/qualcomm/quantizer/observers/per_channel_param_observer.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
from torch.ao.quantization.observer import UniformQuantizationObserverBase
33

44

5-
class ParamObserver(UniformQuantizationObserverBase):
5+
class PerChannelParamObserver(UniformQuantizationObserverBase):
66
def __init__(
77
self,
88
ch_axis=0,

backends/qualcomm/quantizer/qconfig.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -270,6 +270,7 @@ def get_ptq_per_channel_quant_config(
270270
return quantization_config
271271

272272

273+
# TODO merge qat and ptq to a fucntion, and use a bool flag to control it
273274
def get_8a8w_qnn_qat_config(
274275
act_symmetric: bool = False, act_observer=MovingAverageMinMaxObserver
275276
) -> QuantizationConfig:

backends/qualcomm/quantizer/quantizer.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,8 @@
2222
from torch.ao.quantization.quantizer import Quantizer
2323
from torch.fx import GraphModule
2424

25+
from .annotators import OP_ANNOTATOR
26+
2527
from .qconfig import (
2628
get_16a16w_qnn_ptq_config,
2729
get_16a4w_qnn_ptq_config,
@@ -34,8 +36,6 @@
3436
QuantizationConfig,
3537
)
3638

37-
from .annotators import OP_ANNOTATOR
38-
3939
__all__ = [
4040
"QnnQuantizer",
4141
"QuantDtype",

examples/qualcomm/oss_scripts/fastvit.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@
1414
QuantizationConfig,
1515
QuantizationSpec,
1616
)
17-
from executorch.backends.qualcomm.quantizer.observers.param_observer import (
18-
ParamObserver,
17+
from executorch.backends.qualcomm.quantizer.observers.per_channel_param_observer import (
18+
PerChannelParamObserver,
1919
)
2020
from executorch.backends.qualcomm.quantizer.qconfig import (
2121
_derived_bias_quant_spec,

0 commit comments

Comments
 (0)