Skip to content

Commit 70095c6

Browse files
committed
add torch pin file (pytorch#14631)
We define torch version and nightly version in this file (cherry picked from commit 411578a)
1 parent b0462ae commit 70095c6

File tree

2 files changed

+9
-2
lines changed

2 files changed

+9
-2
lines changed

install_requirements.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@
1212
import subprocess
1313
import sys
1414

15+
from torch_pin import NIGHTLY_VERSION, TORCH_VERSION
16+
1517

1618
def python_is_compatible():
1719
# Scrape the version range from pyproject.toml, which should be in the current directory.
@@ -71,7 +73,6 @@ def python_is_compatible():
7173
#
7274
# NOTE: If you're changing, make the corresponding change in .ci/docker/ci_commit_pins/pytorch.txt
7375
# by picking the hash from the same date in https://hud.pytorch.org/hud/pytorch/pytorch/nightly/
74-
NIGHTLY_VERSION = "dev20250906"
7576

7677

7778
def install_requirements(use_pytorch_nightly):
@@ -89,7 +90,11 @@ def install_requirements(use_pytorch_nightly):
8990
# Setting use_pytorch_nightly to false to test the pinned PyTorch commit. Note
9091
# that we don't need to set any version number there because they have already
9192
# been installed on CI before this step, so pip won't reinstall them
92-
"torch==2.9.0" if use_pytorch_nightly else "torch",
93+
(
94+
f"torch=={TORCH_VERSION}.{NIGHTLY_VERSION}"
95+
if use_pytorch_nightly
96+
else "torch"
97+
),
9398
]
9499

95100
# Install the requirements for core ExecuTorch package.

torch_pin.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
TORCH_VERSION = "2.9.0"
2+
NIGHTLY_VERSION = "dev20250906"

0 commit comments

Comments
 (0)