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 @@ -144,7 +144,7 @@ def convert_pt2(
# It is however useful for unit tests to separate the converted model from the
# fused model, to be able to get reference numerics.
# If this does not apply, please use quantize_pt2 instead.
def fuse_pt2(
def apply_pre_edge_transform_passes(
converted_program: ExportedProgram,
quantizer: CadenceQuantizer,
) -> ExportedProgram:
Expand Down Expand Up @@ -229,7 +229,7 @@ def quantize_pt2(

# Apply quant fusion to the exported program
program = torch.export.export(converted_gm, inputs, strict=True)
fused_program = fuse_pt2(program, quantizer)
fused_program = apply_pre_edge_transform_passes(program, quantizer)

if dump_graphs:
logging.info("Graph after quantization and fusion:")
Expand Down
4 changes: 2 additions & 2 deletions backends/cadence/aot/export_example.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@

from executorch.backends.cadence.aot.compiler import (
_lower_ep_to_cadence_gen_etrecord,
apply_pre_edge_transform_passes,
convert_pt2,
fuse_pt2,
prepare_pt2,
)

Expand Down Expand Up @@ -66,7 +66,7 @@ def export_model(
ep = torch.export.export(converted_model, example_inputs, strict=True)

# Fuse the quantized patterns on the exported program (note: quantizer needs to be the same as the one used in prepare_and_convert_pt2)
ep = fuse_pt2(ep, quantizer)
ep = apply_pre_edge_transform_passes(ep, quantizer)

# Get edge program after Cadence specific passes
exec_prog: ExecutorchProgramManager = _lower_ep_to_cadence_gen_etrecord(
Expand Down
Loading