Skip to content
Draft
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
3 changes: 3 additions & 0 deletions optimum/exporters/executorch/recipes/xnnpack.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@ def export_to_executorch_with_xnnpack(
Seq2SeqLMExportableModule,
MultiModalTextToTextExportableModule,
],
run_reinplace_pass: bool = True,
**kwargs,
):
"""
Expand All @@ -84,6 +85,7 @@ def export_to_executorch_with_xnnpack(
Args:
model (Union[CausalLMExportableModule, MaskedLMExportableModule, Seq2SeqLMExportableModule, MultiModalTextToTextExportableModule]):
The PyTorch model to be exported to ExecuTorch.
run_reinplace_pass (bool): Whether to reinplace eligible ops during lowering. Defaults to True.
**kwargs:
Additional keyword arguments for recipe-specific configurations, e.g. export using different example inputs, or different compile/bechend configs.

Expand All @@ -100,6 +102,7 @@ def _lower_to_executorch(
backend_config_dict = {
"extract_delegate_segments": True,
"memory_planning_pass": MemoryPlanningPass(alloc_graph_input=False),
"run_reinplace_pass": run_reinplace_pass,
}
backend_config_dict["do_quant_fusion_and_const_prop"] = True
logging.debug(f"\nExported program: {exported_programs}")
Expand Down
Loading