Skip to content

Commit b40d6fe

Browse files
mergennachinmanuelcandalesCopilot
authored
Update torch pin to 2.11 release candidate (#18287)
Trying to pin to nightly 3.18 but the some linux cuda wheels weren't successfully built last night. #18187 Need to pin to stable release candidate due to time criticality. Will need to revert this PR and pin normally to torch nightlies --------- Co-authored-by: Manuel Candales <42380156+manuelcandales@users.noreply.github.com> Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
1 parent 5e265e6 commit b40d6fe

File tree

12 files changed

+72
-49
lines changed

12 files changed

+72
-49
lines changed
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
659af3c353e49b35c191cdd2dba3b3c79d0e6822
1+
release/2.11

.ci/docker/common/install_pytorch.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,9 +32,9 @@ install_pytorch_and_domains() {
3232
pip_install "$(echo dist/*.whl)"
3333

3434
# Grab the pinned audio and vision commits from PyTorch
35-
TORCHAUDIO_VERSION=$(cat .github/ci_commit_pins/audio.txt)
35+
TORCHAUDIO_VERSION=release/2.11
3636
export TORCHAUDIO_VERSION
37-
TORCHVISION_VERSION=$(cat .github/ci_commit_pins/vision.txt)
37+
TORCHVISION_VERSION=release/0.26
3838
export TORCHVISION_VERSION
3939

4040
install_domains

.ci/scripts/test_model_e2e.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -248,7 +248,7 @@ if [ "$AUDIO_URL" != "" ]; then
248248
elif [[ "$MODEL_NAME" == *whisper* ]] || [ "$MODEL_NAME" = "voxtral_realtime" ]; then
249249
conda install -y -c conda-forge "ffmpeg<8"
250250
pip install datasets soundfile
251-
pip install torchcodec==0.11.0.dev20260217 --extra-index-url https://download.pytorch.org/whl/nightly/cpu
251+
pip install torchcodec==0.11.0 --extra-index-url https://download.pytorch.org/whl/test/cpu
252252
python -c "from datasets import load_dataset;import soundfile as sf;sample = load_dataset('distil-whisper/librispeech_long', 'clean', split='validation')[0]['audio'];sf.write('${MODEL_DIR}/$AUDIO_FILE', sample['array'][:sample['sampling_rate']*30], sample['sampling_rate'])"
253253
fi
254254

.ci/scripts/test_wheel_package_qnn.sh

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -158,17 +158,17 @@ print(module_vars["TORCH_VERSION"])
158158
PY
159159
)
160160

161-
NIGHTLY_VERSION=$(
162-
"$PYBIN" - <<'PY'
163-
import runpy
164-
module_vars = runpy.run_path("torch_pin.py")
165-
print(module_vars["NIGHTLY_VERSION"])
166-
PY
167-
)
168-
echo "=== [$LABEL] Install torch==${TORCH_VERSION}.${NIGHTLY_VERSION} ==="
169-
170-
# Install torchao based on the pinned PyTorch version
171-
"$PIPBIN" install torch=="${TORCH_VERSION}.${NIGHTLY_VERSION}" --index-url "https://download.pytorch.org/whl/nightly/cpu"
161+
# NIGHTLY_VERSION=$(
162+
# "$PYBIN" - <<'PY'
163+
# import runpy
164+
# module_vars = runpy.run_path("torch_pin.py")
165+
# print(module_vars["NIGHTLY_VERSION"])
166+
# PY
167+
# )
168+
echo "=== [$LABEL] Install torch==${TORCH_VERSION} ==="
169+
170+
# Install torch based on the pinned PyTorch version, preferring the PyTorch test index
171+
"$PIPBIN" install torch=="${TORCH_VERSION}" --extra-index-url "https://download.pytorch.org/whl/test"
172172
"$PIPBIN" install wheel
173173

174174
# Install torchao based on the pinned commit from third-party/ao submodule

.ci/scripts/utils.sh

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ dedupe_macos_loader_path_rpaths() {
5353
pushd ..
5454
torch_lib_dir=$(python -c "import importlib.util; print(importlib.util.find_spec('torch').submodule_search_locations[0])")/lib
5555
popd
56-
56+
5757
if [[ -z "${torch_lib_dir}" || ! -d "${torch_lib_dir}" ]]; then
5858
return
5959
fi
@@ -141,9 +141,9 @@ install_pytorch_and_domains() {
141141

142142
dedupe_macos_loader_path_rpaths
143143
# Grab the pinned audio and vision commits from PyTorch
144-
TORCHAUDIO_VERSION=$(cat .github/ci_commit_pins/audio.txt)
144+
TORCHAUDIO_VERSION=release/2.11
145145
export TORCHAUDIO_VERSION
146-
TORCHVISION_VERSION=$(cat .github/ci_commit_pins/vision.txt)
146+
TORCHVISION_VERSION=release/0.26
147147
export TORCHVISION_VERSION
148148

149149
install_domains

examples/models/moshi/mimi/install_requirements.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
set -x
99

1010
sudo apt install ffmpeg -y
11-
pip install torchcodec==0.11.0.dev20260217 --extra-index-url https://download.pytorch.org/whl/nightly/cpu
11+
pip install torchcodec==0.11.0 --extra-index-url https://download.pytorch.org/whl/test/cpu
1212
pip install moshi==0.2.11
1313
pip install bitsandbytes soundfile einops
1414
# Run llama2/install requirements for torchao deps

examples/models/parakeet/export_parakeet_tdt.py

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -508,13 +508,11 @@ def _create_metal_partitioners(programs):
508508

509509
# Run decompositions for non-preprocessor programs
510510
updated_programs = {}
511+
decomp_table = torch.export.default_decompositions()
512+
decomp_table[torch.ops.aten.linear.default] = _linear_bias_decomposition
511513
for key, ep in programs.items():
512-
# print(f"Running decompositions for {key}")
513-
# print(ep.graph_module)
514514
if key != "preprocessor":
515-
updated_programs[key] = ep.run_decompositions(
516-
{torch.ops.aten.linear.default: _linear_bias_decomposition}
517-
)
515+
updated_programs[key] = ep.run_decompositions(decomp_table)
518516
else:
519517
updated_programs[key] = ep
520518

examples/models/voxtral_realtime/export_voxtral_rt.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -394,10 +394,10 @@ def lower_to_executorch(programs, metadata, backend="xnnpack"):
394394

395395
# Run decompositions for Metal backend
396396
updated_programs = {}
397+
decomp_table = torch.export.default_decompositions()
398+
decomp_table[torch.ops.aten.linear.default] = _linear_bias_decomposition
397399
for key, ep in programs.items():
398-
updated_programs[key] = ep.run_decompositions(
399-
{torch.ops.aten.linear.default: _linear_bias_decomposition}
400-
)
400+
updated_programs[key] = ep.run_decompositions(decomp_table)
401401
programs = updated_programs
402402

403403
partitioner = {}

exir/sym_util.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,11 @@ def eval_expr(symint: Union[int, torch.SymInt]) -> Optional[int]:
2525
shape_env = node.shape_env
2626
expr = node.expr
2727
try:
28-
output = shape_env.size_hint(expr)
28+
if hasattr(shape_env, "guarding_hint_or_throw"):
29+
output = shape_env.guarding_hint_or_throw(expr)
30+
else:
31+
# size_hint is deprecated, delete this code path.
32+
output = shape_env.size_hint(expr)
2933
except torch.fx.experimental.symbolic_shapes.GuardOnDataDependentSymNode:
3034
return None
3135
return int(output)

install_requirements.py

Lines changed: 6 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,9 @@
1212

1313
from install_utils import determine_torch_url, is_intel_mac_os, python_is_compatible
1414

15-
from torch_pin import NIGHTLY_VERSION, TORCH_VERSION
16-
1715
# The pip repository that hosts nightly torch packages.
1816
# This will be dynamically set based on CUDA availability and CUDA backend enabled/disabled.
19-
TORCH_NIGHTLY_URL_BASE = "https://download.pytorch.org/whl/nightly"
17+
TORCH_URL_BASE = "https://download.pytorch.org/whl/test"
2018

2119
# Since ExecuTorch often uses main-branch features of pytorch, only the nightly
2220
# pip versions will have the required features.
@@ -44,18 +42,14 @@ def install_requirements(use_pytorch_nightly):
4442
sys.exit(1)
4543

4644
# Determine the appropriate PyTorch URL based on CUDA delegate status
47-
torch_url = determine_torch_url(TORCH_NIGHTLY_URL_BASE)
45+
torch_url = determine_torch_url(TORCH_URL_BASE)
4846

4947
# pip packages needed by exir.
5048
TORCH_PACKAGE = [
5149
# Setting use_pytorch_nightly to false to test the pinned PyTorch commit. Note
5250
# that we don't need to set any version number there because they have already
5351
# been installed on CI before this step, so pip won't reinstall them
54-
(
55-
f"torch=={TORCH_VERSION}.{NIGHTLY_VERSION}"
56-
if use_pytorch_nightly
57-
else "torch"
58-
),
52+
("torch==2.11.0" if use_pytorch_nightly else "torch"),
5953
]
6054

6155
# Install the requirements for core ExecuTorch package.
@@ -114,20 +108,12 @@ def install_requirements(use_pytorch_nightly):
114108

115109
def install_optional_example_requirements(use_pytorch_nightly):
116110
# Determine the appropriate PyTorch URL based on CUDA delegate status
117-
torch_url = determine_torch_url(TORCH_NIGHTLY_URL_BASE)
111+
torch_url = determine_torch_url(TORCH_URL_BASE)
118112

119113
print("Installing torch domain libraries")
120114
DOMAIN_LIBRARIES = [
121-
(
122-
f"torchvision==0.26.0.{NIGHTLY_VERSION}"
123-
if use_pytorch_nightly
124-
else "torchvision"
125-
),
126-
(
127-
f"torchaudio==2.11.0.{NIGHTLY_VERSION}"
128-
if use_pytorch_nightly
129-
else "torchaudio"
130-
),
115+
("torchvision==0.26.0" if use_pytorch_nightly else "torchvision"),
116+
("torchaudio==2.11.0" if use_pytorch_nightly else "torchaudio"),
131117
]
132118
# Then install domain libraries
133119
subprocess.run(

0 commit comments

Comments
 (0)