Skip to content

Commit db8303b

Browse files
jerryzh168facebook-github-bot
authored andcommitted
Move specific quantizer related things outside of main quant code base
Summary: X-link: pytorch/pytorch#107259 Currently in quantizer/quantize_pt2e we import things from specific quantizers (XNNPACKQuantizer, QuantizationConfig) etc. this PR removes them so it's clearer that they are not part of the core quantization code base This PR also removed get_supported_operators from main Quantizer since we haven't seen a clear need for this API Reviewed By: andrewor14 Differential Revision: D48340367 fbshipit-source-id: 368cca59c13b36049f33a8b1ca7842476daf72c5
1 parent b5a7f81 commit db8303b

File tree

4 files changed

+9
-6
lines changed

4 files changed

+9
-6
lines changed

backends/xnnpack/test/TARGETS

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ python_unittest(
2222
"//executorch/bundled_program:core",
2323
"//executorch/bundled_program/serialize:lib",
2424
"//executorch/exir:lib",
25+
"//executorch/exir:tracer",
2526
"//executorch/exir/backend:backend_api",
2627
"//executorch/exir/passes:spec_prop_pass",
2728
"//executorch/exir/serialize:lib",
@@ -51,6 +52,7 @@ python_unittest(
5152
"//executorch/bundled_program:core",
5253
"//executorch/bundled_program/serialize:lib",
5354
"//executorch/exir:lib",
55+
"//executorch/exir:tracer",
5456
"//executorch/exir/backend:backend_api",
5557
"//executorch/exir/dialects:lib",
5658
"//executorch/exir/passes:spec_prop_pass",
@@ -81,6 +83,7 @@ python_unittest(
8183
"//executorch/bundled_program:core",
8284
"//executorch/bundled_program/serialize:lib",
8385
"//executorch/exir:lib",
86+
"//executorch/exir:tracer",
8487
"//executorch/exir/backend:backend_api",
8588
"//executorch/exir/passes:spec_prop_pass",
8689
"//executorch/exir/serialize:lib",

backends/xnnpack/test/test_xnnpack_utils.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -69,10 +69,9 @@
6969
prepare_fx,
7070
)
7171

72-
from torch.ao.quantization.quantize_pt2e import (
73-
convert_pt2e,
72+
from torch.ao.quantization.quantize_pt2e import convert_pt2e, prepare_pt2e
73+
from torch.ao.quantization.quantizer.xnnpack_quantizer import (
7474
get_symmetric_quantization_config,
75-
prepare_pt2e,
7675
XNNPACKQuantizer,
7776
)
7877

backends/xnnpack/test/tester/tester.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,11 +47,12 @@
4747
prepare_fx,
4848
)
4949
from torch.ao.quantization.quantize_pt2e import convert_pt2e, prepare_pt2e
50-
from torch.ao.quantization.quantizer import XNNPACKQuantizer
51-
from torch.ao.quantization.quantizer.quantizer import QuantizationConfig, Quantizer
50+
from torch.ao.quantization.quantizer.quantizer import Quantizer
5251
from torch.ao.quantization.quantizer.xnnpack_quantizer import (
5352
get_symmetric_quantization_config,
53+
XNNPACKQuantizer,
5454
)
55+
from torch.ao.quantization.quantizer.xnnpack_quantizer_utils import QuantizationConfig
5556
from torch.testing import FileCheck
5657
from torch.utils._pytree import tree_flatten
5758

exir/tests/test_quantization.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,9 @@
1919
from torch.ao.quantization.quantize_fx import convert_to_reference_fx, prepare_fx
2020
from torch.ao.quantization.quantize_pt2e import convert_pt2e, prepare_pt2e
2121

22-
from torch.ao.quantization.quantizer import XNNPACKQuantizer
2322
from torch.ao.quantization.quantizer.xnnpack_quantizer import (
2423
get_symmetric_quantization_config,
24+
XNNPACKQuantizer,
2525
)
2626
from torch.testing import FileCheck
2727
from torch.testing._internal.common_quantization import skipIfNoQNNPACK

0 commit comments

Comments
 (0)