From b2e76874c8a34131d6bc37a1576a061ff61281d1 Mon Sep 17 00:00:00 2001 From: Jack Khuu Date: Tue, 8 Oct 2024 10:53:45 -0700 Subject: [PATCH] Revert PT Pin to 0912 Summary: Original PR: https://github.com/pytorch/executorch/pull/5824/files Changes picked up in the revert: https://github.com/pytorch/executorch/commit/f005dd5ba111b524327b7d443cc293bd3b717836#diff-3b0b2409eb2a7cb2dfd94e84c17f54f48243649eb0874b78422b2f1411283d43L169 Differential Revision: D64053532 --- .ci/docker/ci_commit_pins/pytorch.txt | 2 +- examples/apple/mps/scripts/mps_example.py | 2 +- examples/models/phi-3-mini/export_phi-3-mini.py | 6 +++--- exir/tests/test_passes.py | 4 ++-- install_requirements.py | 4 ++-- 5 files changed, 9 insertions(+), 9 deletions(-) diff --git a/.ci/docker/ci_commit_pins/pytorch.txt b/.ci/docker/ci_commit_pins/pytorch.txt index 21a0ea5d478..0e9181ac55a 100644 --- a/.ci/docker/ci_commit_pins/pytorch.txt +++ b/.ci/docker/ci_commit_pins/pytorch.txt @@ -1 +1 @@ -d1b87e26e5c4343f5b56bb1e6f89b479b389bfac +aec9b2ab77389967ef39bb9c10662fd0fe3e185a diff --git a/examples/apple/mps/scripts/mps_example.py b/examples/apple/mps/scripts/mps_example.py index dfb958dce53..d6416e0ffc8 100644 --- a/examples/apple/mps/scripts/mps_example.py +++ b/examples/apple/mps/scripts/mps_example.py @@ -166,7 +166,7 @@ def get_model_config(args): # pre-autograd export. eventually this will become torch.export with torch.no_grad(): - model = torch.export.export_for_training(model, example_inputs).module() + model = torch._export.capture_pre_autograd_graph(model, example_inputs) edge: EdgeProgramManager = export_to_edge( model, example_inputs, diff --git a/examples/models/phi-3-mini/export_phi-3-mini.py b/examples/models/phi-3-mini/export_phi-3-mini.py index 305b83457dc..c2e97a21b1e 100644 --- a/examples/models/phi-3-mini/export_phi-3-mini.py +++ b/examples/models/phi-3-mini/export_phi-3-mini.py @@ -15,13 +15,13 @@ from executorch.backends.xnnpack.partition.xnnpack_partitioner import XnnpackPartitioner from executorch.backends.xnnpack.utils.configs import get_xnnpack_edge_compile_config from executorch.exir import to_edge +from torch._export import capture_pre_autograd_graph from torch.ao.quantization.quantize_pt2e import convert_pt2e, prepare_pt2e from torch.ao.quantization.quantizer.xnnpack_quantizer import ( get_symmetric_quantization_config, XNNPACKQuantizer, ) -from torch.export import export_for_training from transformers import Phi3ForCausalLM @@ -64,9 +64,9 @@ def export(args) -> None: xnnpack_quantizer = XNNPACKQuantizer() xnnpack_quantizer.set_global(xnnpack_quant_config) - model = export_for_training( + model = capture_pre_autograd_graph( model, example_inputs, dynamic_shapes=dynamic_shapes - ).module() + ) model = prepare_pt2e(model, xnnpack_quantizer) # pyre-fixme[6] model(*example_inputs) model = convert_pt2e(model) diff --git a/exir/tests/test_passes.py b/exir/tests/test_passes.py index be2bb4be333..ae5a1adaeb2 100644 --- a/exir/tests/test_passes.py +++ b/exir/tests/test_passes.py @@ -1431,10 +1431,10 @@ def quantize_model( m_eager: torch.nn.Module, example_inputs: Tuple[torch.Tensor] ) -> Tuple[EdgeProgramManager, int, int]: # program capture - m = torch.export.export_for_training( + m = torch._export.capture_pre_autograd_graph( m_eager, example_inputs, - ).module() + ) quantizer = XNNPACKQuantizer() quantization_config = get_symmetric_quantization_config() diff --git a/install_requirements.py b/install_requirements.py index 90acb9467ce..8926d9f955d 100644 --- a/install_requirements.py +++ b/install_requirements.py @@ -106,14 +106,14 @@ def python_is_compatible(): # NOTE: If a newly-fetched version of the executorch repo changes the value of # NIGHTLY_VERSION, you should re-run this script to install the necessary # package versions. -NIGHTLY_VERSION = "dev20241007" +NIGHTLY_VERSION = "dev20240912" # The pip repository that hosts nightly torch packages. TORCH_NIGHTLY_URL = "https://download.pytorch.org/whl/nightly/cpu" # pip packages needed by exir. EXIR_REQUIREMENTS = [ - f"torch==2.6.0.{NIGHTLY_VERSION}", + f"torch==2.5.0.{NIGHTLY_VERSION}", f"torchvision==0.20.0.{NIGHTLY_VERSION}", # For testing. "typing-extensions", ]