Skip to content

Commit 411578a

Browse files
authored
add torch pin file (#14631)
We define torch version and nightly version in this file
1 parent 684b5fd commit 411578a

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

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+
1517
# The pip repository that hosts nightly torch packages.
1618
# This will be dynamically set based on CUDA availability and CUDA backend enabled/disabled.
1719
TORCH_NIGHTLY_URL_BASE = "https://download.pytorch.org/whl/nightly"
@@ -36,7 +38,6 @@
3638
#
3739
# NOTE: If you're changing, make the corresponding supported CUDA versions in
3840
# SUPPORTED_CUDA_VERSIONS above if needed.
39-
NIGHTLY_VERSION = "dev20250915"
4041

4142

4243
def install_requirements(use_pytorch_nightly):
@@ -57,7 +58,11 @@ def install_requirements(use_pytorch_nightly):
5758
# Setting use_pytorch_nightly to false to test the pinned PyTorch commit. Note
5859
# that we don't need to set any version number there because they have already
5960
# been installed on CI before this step, so pip won't reinstall them
60-
f"torch==2.10.0.{NIGHTLY_VERSION}" if use_pytorch_nightly else "torch",
61+
(
62+
f"torch=={TORCH_VERSION}.{NIGHTLY_VERSION}"
63+
if use_pytorch_nightly
64+
else "torch"
65+
),
6166
]
6267

6368
# 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.10.0"
2+
NIGHTLY_VERSION = "dev20250915"

0 commit comments

Comments
 (0)