Skip to content
This repository was archived by the owner on Sep 10, 2025. It is now read-only.

Commit 5ab9d7e

Browse files
Use training IR in torchchat export
1 parent ecc628d commit 5ab9d7e

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

install/install_requirements.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ fi
4747
# NOTE: If a newly-fetched version of the executorch repo changes the value of
4848
# PYTORCH_NIGHTLY_VERSION, you should re-run this script to install the necessary
4949
# package versions.
50-
PYTORCH_NIGHTLY_VERSION=dev20241002
50+
PYTORCH_NIGHTLY_VERSION=dev20241019
5151

5252
# Nightly version for torchvision
5353
VISION_NIGHTLY_VERSION=dev20241002

torchchat/export.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ def export_for_server(
110110
from executorch.exir.tracer import Value
111111

112112
from torch._export import capture_pre_autograd_graph
113-
from torch.export import export, ExportedProgram
113+
from torch.export import export_for_training, ExportedProgram
114114

115115
from torchchat.model import apply_rotary_emb, Attention
116116
from torchchat.utils.build_utils import get_precision
@@ -226,7 +226,7 @@ def _to_core_aten(
226226
raise ValueError(
227227
f"Expected passed in model to be an instance of fx.GraphModule, got {type(model)}"
228228
)
229-
core_aten_ep = export(model, example_inputs, dynamic_shapes=dynamic_shapes)
229+
core_aten_ep = export_for_training(model, example_inputs, dynamic_shapes=dynamic_shapes)
230230
if verbose:
231231
logging.info(f"Core ATen graph:\n{core_aten_ep.graph}")
232232
return core_aten_ep

0 commit comments

Comments
 (0)