File tree Expand file tree Collapse file tree 4 files changed +6
-5
lines changed
backends/qualcomm/quantizer
examples/qualcomm/oss_scripts Expand file tree Collapse file tree 4 files changed +6
-5
lines changed Original file line number Diff line number Diff line change 2
2
from torch .ao .quantization .observer import UniformQuantizationObserverBase
3
3
4
4
5
- class ParamObserver (UniformQuantizationObserverBase ):
5
+ class PerChannelParamObserver (UniformQuantizationObserverBase ):
6
6
def __init__ (
7
7
self ,
8
8
ch_axis = 0 ,
Original file line number Diff line number Diff line change @@ -270,6 +270,7 @@ def get_ptq_per_channel_quant_config(
270
270
return quantization_config
271
271
272
272
273
+ # TODO merge qat and ptq to a fucntion, and use a bool flag to control it
273
274
def get_8a8w_qnn_qat_config (
274
275
act_symmetric : bool = False , act_observer = MovingAverageMinMaxObserver
275
276
) -> QuantizationConfig :
Original file line number Diff line number Diff line change 22
22
from torch .ao .quantization .quantizer import Quantizer
23
23
from torch .fx import GraphModule
24
24
25
+ from .annotators import OP_ANNOTATOR
26
+
25
27
from .qconfig import (
26
28
get_16a16w_qnn_ptq_config ,
27
29
get_16a4w_qnn_ptq_config ,
34
36
QuantizationConfig ,
35
37
)
36
38
37
- from .annotators import OP_ANNOTATOR
38
-
39
39
__all__ = [
40
40
"QnnQuantizer" ,
41
41
"QuantDtype" ,
Original file line number Diff line number Diff line change 14
14
QuantizationConfig ,
15
15
QuantizationSpec ,
16
16
)
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 ,
19
19
)
20
20
from executorch .backends .qualcomm .quantizer .qconfig import (
21
21
_derived_bias_quant_spec ,
You can’t perform that action at this time.
0 commit comments