Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion .lintrunner.toml
Original file line number Diff line number Diff line change
Expand Up @@ -390,7 +390,6 @@ exclude_patterns = [
"backends/arm/test/ops/**",
"backends/vulkan/quantizer/**",
"backends/vulkan/test/**",
"backends/cadence/aot/quantizer/**",
"backends/qualcomm/quantizer/**",
"examples/qualcomm/**",
"backends/xnnpack/quantizer/**",
Expand Down
2 changes: 1 addition & 1 deletion backends/cadence/aot/compiler.py
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ def prepare_and_convert_pt2(
assert isinstance(model_gm, torch.fx.GraphModule)

# Prepare
prepared_model = prepare_pt2e(model_gm, quantizer) # pyre-ignore[6]
prepared_model = prepare_pt2e(model_gm, quantizer)

# Calibrate
# If no calibration data is provided, use the inputs
Expand Down
2 changes: 1 addition & 1 deletion backends/cadence/aot/quantizer/TARGETS
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ python_library(
],
deps = [
"//caffe2:torch",
"//pytorch/ao:torchao",
],
)

Expand All @@ -34,7 +35,6 @@ python_library(
":patterns",
":utils",
"//caffe2:torch",
"//executorch/backends/xnnpack/quantizer:xnnpack_quantizer_utils",
],
)

Expand Down
2 changes: 1 addition & 1 deletion backends/cadence/aot/quantizer/patterns.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@

from torch import fx
from torch._ops import OpOverload
from torch.ao.quantization.quantizer import (
from torchao.quantization.pt2e.quantizer import (
DerivedQuantizationSpec,
SharedQuantizationSpec,
)
Expand Down
15 changes: 8 additions & 7 deletions backends/cadence/aot/quantizer/quantizer.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,19 +29,20 @@
is_annotated,
no_outside_users,
)
from executorch.backends.xnnpack.quantizer.xnnpack_quantizer_utils import (

from torch import fx

from torchao.quantization.pt2e import HistogramObserver, MinMaxObserver
from torchao.quantization.pt2e.quantizer import (
ComposableQuantizer,
DerivedQuantizationSpec,
OperatorConfig,
QuantizationAnnotation,
QuantizationConfig,
QuantizationSpec,
Quantizer,
)

from torch import fx

from torch.ao.quantization.observer import HistogramObserver, MinMaxObserver
from torch.ao.quantization.quantizer import DerivedQuantizationSpec, Quantizer
from torch.ao.quantization.quantizer.composable_quantizer import ComposableQuantizer


act_qspec_asym8s = QuantizationSpec(
dtype=torch.int8,
Expand Down
2 changes: 1 addition & 1 deletion backends/cadence/aot/quantizer/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,13 @@
import torch
from torch import fx
from torch._ops import OpOverload
from torch.ao.quantization import ObserverOrFakeQuantize

from torch.fx import GraphModule
from torch.fx.passes.utils.source_matcher_utils import (
check_subgraphs_connected,
SourcePartition,
)
from torchao.quantization.pt2e import ObserverOrFakeQuantize


def quantize_tensor_multiplier(
Expand Down
Loading