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
4 changes: 2 additions & 2 deletions backends/cadence/aot/compiler.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
import executorch.backends.cadence.aot.ops_registrations # noqa
import torch
from executorch.backends.cadence.aot.compiler_funcs import (
convert as convert_fn,
prepare as prepare_fn,
trace as trace_fn,
)
Expand Down Expand Up @@ -42,6 +41,7 @@
from executorch.exir.program._program import to_edge

from torch.export.exported_program import ExportedProgram
from torchao.quantization.pt2e.quantize_pt2e import convert_pt2e

from .passes import apply_exir_ops_passes, apply_torch_ops_passes

Expand Down Expand Up @@ -139,7 +139,7 @@ def convert_pt2(
Returns a GraphModule with the converted model.
"""

converted_model = convert_fn(graph_module)
converted_model = convert_pt2e(graph_module)

if dump_graphs:
logging.info("Graph after convert:")
Expand Down
11 changes: 1 addition & 10 deletions backends/cadence/aot/compiler_funcs.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,7 @@

import torch
from torch._inductor.decomposition import remove_decompositions
from torchao.quantization.pt2e.quantize_pt2e import (
convert_pt2e,
prepare_pt2e,
prepare_qat_pt2e,
)
from torchao.quantization.pt2e.quantize_pt2e import prepare_pt2e, prepare_qat_pt2e
from torchao.quantization.pt2e.quantizer import Quantizer


Expand Down Expand Up @@ -56,8 +52,3 @@ def prepare(
prepared_model = prepare_pt2e(traced_model, quantizer)

return prepared_model


def convert(prepared_model: torch.fx.GraphModule) -> torch.fx.GraphModule:
converted_model = convert_pt2e(prepared_model)
return converted_model
Loading