Skip to content

Commit 400b880

Browse files
committed
up
1 parent 5174cd9 commit 400b880

File tree

2 files changed

+10
-14
lines changed

2 files changed

+10
-14
lines changed

exir/passes/constant_prop_pass.py

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -30,10 +30,6 @@
3030
# Propagating aten.full can significantly increase compiled model size.
3131
_DEFAULT_SKIP_TARGETS = {exir_ops.edge.aten.full.default}
3232

33-
# Skipping transpose/permute for now because https://github.com/pytorch/executorch/issues/10499
34-
_DEFAULT_SKIP_TARGETS.add(exir_ops.edge.aten.transpose.int)
35-
_DEFAULT_SKIP_TARGETS.add(exir_ops.edge.aten.permute.default)
36-
3733
# Do not const prop quantization primitives
3834
_QDQ_OPS = [
3935
exir_ops.edge.quantized_decomposed.dequantize_per_channel.default,

extension/llm/export/builder.py

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -503,23 +503,23 @@ def to_executorch(
503503
"""
504504
Lower the model to executorch and get an ExecutorchProgram.
505505
"""
506-
# QuantFusionPass is not necessary because we set do_quant_fusion_and_const_prop=True
507-
# in ExecutorchBackendConfig
508-
to_executorch_passes = [
509-
# If there are Linear operations left in the graph, let's execute
510-
# them with the optimized op_linear rather than materializing a
511-
# transpose followed by a regular op_mm.
512-
# TODO: ConvertToLinearPass is not a sound pass and we should fix it
513-
# https://github.com/pytorch/executorch/issues/10499
514-
ConvertToLinearPass(),
515-
]
506+
to_executorch_passes = []
516507
if passes:
517508
# pyre-fixme[6]: In call `list.extend`, for 1st positional argument,
518509
# expected `Iterable[Union[ConvertToLinearPass, QuantFusionPass]]` but
519510
# got `List[ExportPass]
520511
to_executorch_passes.extend(passes)
521512

522513
assert self.edge_manager, "Need to run export_to_edge() first"
514+
515+
# If there are Linear operations left in the graph, let's execute
516+
# them with the optimized op_linear rather than materializing a
517+
# transpose followed by a regular op_mm.
518+
# TODO: ConvertToLinearPass is not a sound pass and must be called before
519+
# const propagation. It requires fixing:
520+
# https://github.com/pytorch/executorch/issues/10499
521+
self.edge_manager.transform([ConvertToLinearPass()])
522+
523523
self.export_program = self.edge_manager.to_executorch(
524524
ExecutorchBackendConfig(
525525
extract_delegate_segments=True,

0 commit comments

Comments
 (0)