Skip to content

Commit f66b79f

Browse files
authored
Rename fuse_pt2 to apply_pre_edge_transform_passes
Differential Revision: D86710591 Pull Request resolved: #15724
1 parent ea0c612 commit f66b79f

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

backends/cadence/aot/compiler.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,7 @@ def convert_pt2(
144144
# It is however useful for unit tests to separate the converted model from the
145145
# fused model, to be able to get reference numerics.
146146
# If this does not apply, please use quantize_pt2 instead.
147-
def fuse_pt2(
147+
def apply_pre_edge_transform_passes(
148148
converted_program: ExportedProgram,
149149
quantizer: CadenceQuantizer,
150150
) -> ExportedProgram:
@@ -229,7 +229,7 @@ def quantize_pt2(
229229

230230
# Apply quant fusion to the exported program
231231
program = torch.export.export(converted_gm, inputs, strict=True)
232-
fused_program = fuse_pt2(program, quantizer)
232+
fused_program = apply_pre_edge_transform_passes(program, quantizer)
233233

234234
if dump_graphs:
235235
logging.info("Graph after quantization and fusion:")

backends/cadence/aot/export_example.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,8 @@
1818

1919
from executorch.backends.cadence.aot.compiler import (
2020
_lower_ep_to_cadence_gen_etrecord,
21+
apply_pre_edge_transform_passes,
2122
convert_pt2,
22-
fuse_pt2,
2323
prepare_pt2,
2424
)
2525

@@ -66,7 +66,7 @@ def export_model(
6666
ep = torch.export.export(converted_model, example_inputs, strict=True)
6767

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

7171
# Get edge program after Cadence specific passes
7272
exec_prog: ExecutorchProgramManager = _lower_ep_to_cadence_gen_etrecord(

0 commit comments

Comments
 (0)