Skip to content

Commit 59a2594

Browse files
lucylqangelayi
andauthored
pin update (#7273)
* Bump pytorch pin to 20241206 * remove args --------- Co-authored-by: angelayi <[email protected]>
1 parent b2a680b commit 59a2594

File tree

12 files changed

+44
-47
lines changed

12 files changed

+44
-47
lines changed

.ci/docker/ci_commit_pins/pytorch.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
19eff28ff3f19b50da46f5a9ff5f4d4d213806fe
1+
2ea4b56ec872424e486c4fe2d55da061067a2ed3

.ci/docker/common/install_pytorch.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ install_pytorch_and_domains() {
2626

2727
chown -R ci-user .
2828

29-
export _GLIBCXX_USE_CXX11_ABI=0
29+
export _GLIBCXX_USE_CXX11_ABI=1
3030
# Then build and install PyTorch
3131
conda_run python setup.py bdist_wheel
3232
pip_install "$(echo dist/*.whl)"

.ci/scripts/test_llava.sh

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,6 @@ EXECUTORCH_COMMON_CMAKE_ARGS=" \
4141
-DEXECUTORCH_BUILD_KERNELS_OPTIMIZED=ON \
4242
-DEXECUTORCH_BUILD_KERNELS_QUANTIZED=ON \
4343
-DEXECUTORCH_BUILD_XNNPACK=ON \
44-
-DEXECUTORCH_DO_NOT_USE_CXX11_ABI=ON \
4544
-DEXECUTORCH_XNNPACK_SHARED_WORKSPACE=ON"
4645

4746
cmake_install_executorch_libraries() {

CMakeLists.txt

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -145,12 +145,6 @@ if(EXECUTORCH_ENABLE_EVENT_TRACER)
145145
add_definitions(-DET_EVENT_TRACER_ENABLED)
146146
endif()
147147

148-
option(EXECUTORCH_DO_NOT_USE_CXX11_ABI "Define _GLIBCXX_USE_CXX11_ABI=0 if ON"
149-
OFF
150-
)
151-
if(EXECUTORCH_DO_NOT_USE_CXX11_ABI)
152-
add_definitions(-D_GLIBCXX_USE_CXX11_ABI=0)
153-
endif()
154148
# -ffunction-sections -fdata-sections: breaks function and data into sections so
155149
# they can be properly gc'd. -s: strip symbol. -fno-exceptions -fno-rtti:
156150
# disables exceptions and runtime type.
@@ -772,13 +766,6 @@ if(EXECUTORCH_BUILD_PYBIND)
772766
-frtti
773767
-fexceptions
774768
)
775-
if(EXECUTORCH_DO_NOT_USE_CXX11_ABI)
776-
# libtorch is built with the old ABI, so we need to do the same for any
777-
# .cpp files that include torch, c10, or ATen targets. Note that PyTorch
778-
# nightly binary is built with _GLIBCXX_USE_CXX11_ABI set to 0 while its
779-
# CI build sets this to 1 (default)
780-
list(APPEND _pybind_compile_options -D_GLIBCXX_USE_CXX11_ABI=0)
781-
endif()
782769

783770
# util lib
784771
add_library(

examples/models/llama3_2_vision/text_decoder/test/test_text_decoder.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -74,8 +74,6 @@ def test_llama3_2_text_decoder_aoti(self) -> None:
7474
with tempfile.TemporaryDirectory() as tmpdir:
7575
path = torch._inductor.aoti_compile_and_package(
7676
ep,
77-
model.get_example_inputs(),
78-
kwargs=model.get_example_kwarg_inputs(),
7977
package_path=os.path.join(tmpdir, "text_decoder.pt2"),
8078
)
8179
encoder_aoti = torch._inductor.aoti_load_package(path)

examples/models/llama3_2_vision/vision_encoder/test/test_vision_encoder.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,6 @@ def test_flamingo_vision_encoder(self) -> None:
3636
with tempfile.TemporaryDirectory() as tmpdir:
3737
path = torch._inductor.aoti_compile_and_package(
3838
ep,
39-
model.get_example_inputs(),
4039
package_path=os.path.join(tmpdir, "vision_encoder.pt2"),
4140
)
4241
print(path)

examples/models/llava/CMakeLists.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,6 @@ if(LLAVA_RUNNER_NO_TORCH_DUMMY_IMAGE)
8181
else()
8282
find_package(Torch CONFIG REQUIRED)
8383
endif()
84-
add_definitions(-D_GLIBCXX_USE_CXX11_ABI=0)
8584

8685
#
8786
# llava_main: test binary to run llava, with tokenizer and sampler integrated

extension/llm/export/builder.py

Lines changed: 38 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,11 @@
1010

1111
# pyre-unsafe
1212

13+
import contextlib
1314
import logging
1415
from enum import Enum
1516
from typing import Any, Callable, Dict, List, Optional
17+
from unittest.mock import patch
1618

1719
import torch
1820
from executorch.backends.transforms.duplicate_dynamic_quant_chain import (
@@ -184,15 +186,23 @@ def export(self) -> "LLMEdgeManager":
184186
# 2. torch.no_grad() is for getting rid of the dropout (not sure why training ops will show up)
185187
with torch.nn.attention.sdpa_kernel([SDPBackend.MATH]), torch.no_grad():
186188
if hasattr(self.args, "qnn") and self.args.qnn:
187-
# TODO: this is temporary and export_for_training doesn't work with qnn either. We need a
188-
# functional graph. See issue https://github.com/pytorch/executorch/pull/4627 for more details
189-
exported_module = torch.export.export(
190-
self.model,
191-
self.example_inputs,
192-
self.example_kwarg_inputs,
193-
dynamic_shapes=dynamic_shape,
194-
strict=True,
195-
)
189+
# TODO: this is temporary, as qnn flow does not work with new, non-functional export IR.
190+
# See issue: https://github.com/pytorch/executorch/issues/7373
191+
192+
with patch.object(
193+
torch._utils_internal,
194+
"export_training_ir_rollout_check",
195+
return_value=False,
196+
):
197+
# TODO: this is temporary and export_for_training doesn't work with qnn either. We need a
198+
# functional graph. See issue https://github.com/pytorch/executorch/pull/4627 for more details
199+
exported_module = torch.export.export(
200+
self.model,
201+
self.example_inputs,
202+
self.example_kwarg_inputs,
203+
dynamic_shapes=dynamic_shape,
204+
strict=True,
205+
)
196206
else:
197207
logging.info("Exporting with:")
198208
logging.info(f"inputs: {self.example_inputs}")
@@ -354,15 +364,25 @@ def export_to_edge(self) -> "LLMEdgeManager":
354364
if self.pre_autograd_graph_module is None:
355365
# Run export() if it didn't run
356366
self.export()
357-
self.edge_manager = export_to_edge(
358-
self.pre_autograd_graph_module, # pyre-fixme[6]
359-
self.example_inputs,
360-
example_kwarg_inputs=self.example_kwarg_inputs,
361-
dynamic_shapes=dynamic_shape,
362-
edge_constant_methods=self.metadata,
363-
edge_compile_config=edge_config,
364-
verbose=self.verbose,
365-
)
367+
368+
override_export_behaviour = contextlib.nullcontext()
369+
if hasattr(self.args, "qnn") and self.args.qnn:
370+
override_export_behaviour = patch.object(
371+
torch._utils_internal,
372+
"export_training_ir_rollout_check",
373+
return_value=False,
374+
)
375+
376+
with override_export_behaviour:
377+
self.edge_manager = export_to_edge(
378+
self.pre_autograd_graph_module, # pyre-fixme[6]
379+
self.example_inputs,
380+
example_kwarg_inputs=self.example_kwarg_inputs,
381+
dynamic_shapes=dynamic_shape,
382+
edge_constant_methods=self.metadata,
383+
edge_compile_config=edge_config,
384+
verbose=self.verbose,
385+
)
366386
return self
367387

368388
def to_backend(self, partitioners: Optional[List[Partitioner]]) -> "LLMEdgeManager":

extension/llm/modules/test/test_position_embeddings.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -177,7 +177,6 @@ def test_tiled_token_positional_embedding_aoti(self):
177177
with tempfile.TemporaryDirectory() as tmpdir:
178178
path = torch._inductor.aoti_compile_and_package(
179179
tpe_ep,
180-
(self.x, self.aspect_ratio),
181180
package_path=os.path.join(tmpdir, "tpe.pt2"),
182181
)
183182
tpe_aoti = load_package(path)

install_requirements.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ def python_is_compatible():
112112
# NOTE: If a newly-fetched version of the executorch repo changes the value of
113113
# NIGHTLY_VERSION, you should re-run this script to install the necessary
114114
# package versions.
115-
NIGHTLY_VERSION = "dev20241112"
115+
NIGHTLY_VERSION = "dev20241218"
116116

117117
# The pip repository that hosts nightly torch packages.
118118
TORCH_NIGHTLY_URL = "https://download.pytorch.org/whl/nightly/cpu"
@@ -124,7 +124,7 @@ def python_is_compatible():
124124
# been installed on CI before this step, so pip won't reinstall them
125125
f"torch==2.6.0.{NIGHTLY_VERSION}" if USE_PYTORCH_NIGHTLY else "torch",
126126
(
127-
f"torchvision==0.20.0.{NIGHTLY_VERSION}"
127+
f"torchvision==0.22.0.{NIGHTLY_VERSION}"
128128
if USE_PYTORCH_NIGHTLY
129129
else "torchvision"
130130
), # For testing.
@@ -135,7 +135,7 @@ def python_is_compatible():
135135
# TODO: Make each example publish its own requirements.txt
136136
EXAMPLES_REQUIREMENTS = [
137137
"timm==1.0.7",
138-
f"torchaudio==2.5.0.{NIGHTLY_VERSION}" if USE_PYTORCH_NIGHTLY else "torchaudio",
138+
f"torchaudio==2.6.0.{NIGHTLY_VERSION}" if USE_PYTORCH_NIGHTLY else "torchaudio",
139139
"torchsr==1.0.4",
140140
"transformers==4.46.1",
141141
]

third-party/TARGETS

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -298,7 +298,6 @@ prebuilt_cxx_library(
298298
name = "libtorch",
299299
shared_lib = ":libtorch_gen[libtorch]",
300300
exported_preprocessor_flags = [
301-
"-D_GLIBCXX_USE_CXX11_ABI=0", # `libtorch` is built without CXX11_ABI so any target depends on it need to use the same build config.
302301
"-I$(location :libtorch_gen[include])", # include header directories
303302
"-I$(location :libtorch_gen[include])/torch/csrc/api/include", # include header directories
304303
],
@@ -318,7 +317,6 @@ prebuilt_cxx_library(
318317
name = "libtorch_python",
319318
shared_lib = ":libtorch_gen[libtorch_python]",
320319
exported_preprocessor_flags = [
321-
"-D_GLIBCXX_USE_CXX11_ABI=0", # `libtorch` is built without CXX11_ABI so any target depends on it need to use the same build config.
322320
"-I$(location :libtorch_gen[include])", # include header directories
323321
"-I$(location :libtorch_gen[include])/torch/csrc/api/include", # include header directories
324322
],

third-party/gtest_defs.bzl

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,7 @@ COMPILER_FLAGS = [
44
"-std=c++17",
55
]
66
COMPILER_FLAGS_ATEN = [
7-
"-std=c++17",
8-
"-D_GLIBCXX_USE_CXX11_ABI=0", # `libtorch` is built without CXX11_ABI so gtest needs to be compiled in the same way
9-
]
7+
"-std=c++17",]
108

119
# define_gtest_targets
1210
def define_gtest_targets():

0 commit comments

Comments
 (0)