Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use training IR in torchchat export #1319

Closed
wants to merge 10 commits into from
4 changes: 2 additions & 2 deletions install/install_requirements.sh
Original file line number Diff line number Diff line change
Expand Up @@ -47,10 +47,10 @@ fi
# NOTE: If a newly-fetched version of the executorch repo changes the value of
# PYTORCH_NIGHTLY_VERSION, you should re-run this script to install the necessary
# package versions.
PYTORCH_NIGHTLY_VERSION=dev20241002
PYTORCH_NIGHTLY_VERSION=dev20241028

# Nightly version for torchvision
VISION_NIGHTLY_VERSION=dev20241002
VISION_NIGHTLY_VERSION=dev20241028

# Nightly version for torchtune
TUNE_NIGHTLY_VERSION=dev20241010
Expand Down
4 changes: 2 additions & 2 deletions torchchat/export.py
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ def export_for_server(
from executorch.exir.tracer import Value

from torch._export import capture_pre_autograd_graph
from torch.export import export, ExportedProgram
from torch.export import export_for_training, ExportedProgram

from torchchat.model import apply_rotary_emb, Attention
from torchchat.utils.build_utils import get_precision
Expand Down Expand Up @@ -238,7 +238,7 @@ def _to_core_aten(
raise ValueError(
f"Expected passed in model to be an instance of fx.GraphModule, got {type(model)}"
)
core_aten_ep = export(model, example_inputs, dynamic_shapes=dynamic_shapes)
core_aten_ep = export_for_training(model, example_inputs, dynamic_shapes=dynamic_shapes)
if verbose:
logging.info(f"Core ATen graph:\n{core_aten_ep.graph}")
return core_aten_ep
Expand Down
Loading