Skip to content

Commit df34b90

Browse files
authored
[ML] Upgrade to PyTorch 2.7.1 (#2863)
PyTorch 2.7.1 is the latest stable release of PyTorch and contains several bug and security fixes.
1 parent e1e93b5 commit df34b90

File tree

29 files changed

+58
-78
lines changed

29 files changed

+58
-78
lines changed

.buildkite/pipelines/build_linux.json.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@
3636
"cpu": "6",
3737
"ephemeralStorage": "20G",
3838
"memory": "64G",
39-
"image": os.getenv("DOCKER_IMAGE", "docker.elastic.co/ml-dev/ml-linux-build:33")
39+
"image": os.getenv("DOCKER_IMAGE", "docker.elastic.co/ml-dev/ml-linux-build:34")
4040
},
4141
"aarch64": {
4242
"provider": "aws",
@@ -100,7 +100,7 @@ def main(args):
100100
"cpu": "6",
101101
"ephemeralStorage": "20G",
102102
"memory": "64G",
103-
"image": "docker.elastic.co/ml-dev/ml-linux-aarch64-cross-build:16"
103+
"image": "docker.elastic.co/ml-dev/ml-linux-aarch64-cross-build:17"
104104
},
105105
"commands": [
106106
".buildkite/scripts/steps/build_and_test.sh"

.buildkite/pipelines/build_macos.json.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@
3333
agents = {
3434
"aarch64": {
3535
"provider": "orka",
36-
"image": "ml-macos-13-arm-004.orkasi"
36+
"image": "ml-macos-13-arm-005.orkasi"
3737
}
3838
}
3939
envs = {

.buildkite/pipelines/build_windows.json.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ def main(args):
4545
"provider": "gcp",
4646
"machineType": "c2-standard-16",
4747
"minCpuPlatform": "Intel Cascade Lake",
48-
"image": "family/ml-cpp-4-windows-2022",
48+
"image": "family/ml-cpp-5-windows-2022",
4949
},
5050
"commands": [
5151
f'if ( "{args.action}" -eq "debug" ) {{\$Env:ML_DEBUG="1"}}',

.ci/orka/README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
## Files
1010

1111
- `install.sh` The script that does the software installs on the image
12-
- `orka-macos-12-arm.pkr.hcl` The packer definition for a MacOS 12 ARM builder image
12+
- `orka-macos-13-arm.pkr.hcl` The packer definition for a MacOS 13 ARM builder image
1313

1414

1515
## Set Up Packer
@@ -26,7 +26,7 @@ Make sure you are connected to the Orka VM.
2626

2727
Packer requires access to secrets in vault, where VAULT_ADDR=https://vault-ci-prod.elastic.dev and VAULT_TOKEN must be set appropriately in the environment.
2828

29-
Run the following to create the image (MacOS 12 ARM in this example):
29+
Run the following to create the image (MacOS 13 ARM in this example):
3030

3131
```
3232
packer build orka-macos-13-arm.pkr.hcl
@@ -63,7 +63,7 @@ The ML packer scripts do the following:
6363
* Install JDK `11.0.25`
6464
* Install CMake `3.30.5`
6565
* Install Boost `1.86.0` from source
66-
* Install PyTorch `2.5.1` from source
66+
* Install PyTorch `2.7.1` from source
6767

6868
## Caveats
6969

.ci/orka/orka-macos-13-arm.pkr.hcl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ locals {
1818

1919
source "macstadium-orka" "image" {
2020
source_image = "generic-13-ventura-arm-002.orkasi"
21-
image_name = "ml-macos-13-arm-004.orkasi"
21+
image_name = "ml-macos-13-arm-005.orkasi"
2222
orka_endpoint = local.orka_endpoint
2323
orka_user = local.orka_user
2424
orka_password = local.orka_password

.ci/orka/third_party_deps.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ sudo rm -rf boost_1_86_0
3434
sudo pip3 install numpy ninja pyyaml setuptools cffi typing_extensions future six requests dataclasses
3535

3636
# Build and install PyTorch
37-
git clone --depth=1 --branch=v2.5.1 https://github.com/pytorch/pytorch.git && \
37+
git clone --depth=1 --branch=v2.7.1 https://github.com/pytorch/pytorch.git && \
3838
cd pytorch && \
3939
git submodule sync && \
4040
git submodule update --init --recursive && \
@@ -59,7 +59,7 @@ export DNNL_TARGET_ARCH=AARCH64
5959
export USE_MKLDNN=ON
6060
export USE_QNNPACK=OFF
6161
export USE_PYTORCH_QNNPACK=OFF
62-
export PYTORCH_BUILD_VERSION=2.5.1
62+
export PYTORCH_BUILD_VERSION=2.7.1
6363
export PYTORCH_BUILD_NUMBER=1
6464
python3 setup.py install
6565

3rd_party/licenses/pytorch-INFO.csv

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
name,version,revision,url,license,copyright,sourceURL
2-
PyTorch,2.5.1,a8d6afb511a69687bbb2b7e88a3cf67917e1697e,https://pytorch.org,BSD-3-Clause,,
2+
PyTorch,2.7.1,e2d141dbde55c2a4370fac5165b0561b6af4798b,https://pytorch.org,BSD-3-Clause,,

build-setup/linux.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -333,7 +333,7 @@ Then copy the shared libraries to the system directory:
333333
(cd /opt/intel/oneapi/mkl/2024.0 && tar cf - lib) | (cd /usr/local/gcc133 && sudo tar xvf -)
334334
```
335335

336-
### PyTorch 2.5.1
336+
### PyTorch 2.7.1
337337

338338
(This step requires a reasonable amount of memory. It failed on a machine with 8GB of RAM. It succeeded on a 16GB machine. You can specify the number of parallel jobs using environment variable MAX_JOBS. Lower number of jobs will reduce memory usage.)
339339

@@ -352,7 +352,7 @@ sudo /usr/local/gcc133/bin/python3.12 -m pip install numpy pyyaml setuptools cff
352352
Then obtain the PyTorch code:
353353

354354
```
355-
git clone --depth=1 --branch=v2.5.1 https://github.com/pytorch/pytorch.git
355+
git clone --depth=1 --branch=v2.7.1 https://github.com/pytorch/pytorch.git
356356
cd pytorch
357357
git submodule sync
358358
git submodule update --init --recursive
@@ -386,7 +386,7 @@ export USE_MKLDNN=ON
386386
export USE_QNNPACK=OFF
387387
export USE_PYTORCH_QNNPACK=OFF
388388
[ $(uname -m) = x86_64 ] && export USE_XNNPACK=OFF
389-
export PYTORCH_BUILD_VERSION=2.5.1
389+
export PYTORCH_BUILD_VERSION=2.7.1
390390
export PYTORCH_BUILD_NUMBER=1
391391
/usr/local/gcc133/bin/python3.12 setup.py install
392392
```

build-setup/macos.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -133,18 +133,18 @@ Download the graphical installer for Python 3.10.10 from <https://www.python.org
133133

134134
Install using all the default options. When the installer completes a Finder window pops up. Double click the `Install Certificates.command` file in this folder to install the SSL certificates Python needs.
135135

136-
### PyTorch 2.5.1
136+
### PyTorch 2.7.1
137137

138138
PyTorch requires that certain Python modules are installed. To install them:
139139

140140
```
141-
sudo /Library/Frameworks/Python.framework/Versions/3.10/bin/pip3.10 install numpy ninja pyyaml setuptools cffi typing_extensions future six requests dataclasses
141+
sudo /Library/Frameworks/Python.framework/Versions/3.12/bin/pip3.12 install numpy ninja pyyaml setuptools cffi typing_extensions future six requests dataclasses
142142
```
143143

144144
Then obtain the PyTorch code:
145145

146146
```
147-
git clone --depth=1 --branch=v2.5.1 https://github.com/pytorch/pytorch.git
147+
git clone --depth=1 --branch=v2.7.1 https://github.com/pytorch/pytorch.git
148148
cd pytorch
149149
git submodule sync
150150
git submodule update --init --recursive
@@ -188,9 +188,9 @@ export DNNL_TARGET_ARCH=AARCH64
188188
export USE_MKLDNN=ON
189189
export USE_QNNPACK=OFF
190190
export USE_PYTORCH_QNNPACK=OFF
191-
export PYTORCH_BUILD_VERSION=2.5.1
191+
export PYTORCH_BUILD_VERSION=2.7.1
192192
export PYTORCH_BUILD_NUMBER=1
193-
/Library/Frameworks/Python.framework/Versions/3.10/bin/python3.10 setup.py install
193+
/Library/Frameworks/Python.framework/Versions/3.12/bin/python3.12 setup.py install
194194
```
195195
196196
Once built copy headers and libraries to system directories:

build-setup/windows.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -202,7 +202,7 @@ On the "Advanced Options" screen, check "Install for all users" and "Add Python
202202

203203
For the time being, do not take advantage of the option on the final installer screen to reconfigure the machine to allow paths longer than 260 characters. We still support Windows versions that do not have this option.
204204

205-
### PyTorch 2.5.1
205+
### PyTorch 2.7.1
206206

207207
(This step requires a lot of memory. It failed on a machine with 12GB of RAM. It just about fitted on a 20GB machine. 32GB RAM is recommended.)
208208

@@ -216,7 +216,7 @@ Next, in a Git bash shell run:
216216

217217
```
218218
cd /c/tools
219-
git clone --depth=1 --branch=v2.5.1 https://github.com/pytorch/pytorch.git
219+
git clone --depth=1 --branch=v2.7.1 https://github.com/pytorch/pytorch.git
220220
cd pytorch
221221
git submodule sync
222222
git submodule update --init --recursive
@@ -272,7 +272,7 @@ set USE_QNNPACK=OFF
272272
set USE_PYTORCH_QNNPACK=OFF
273273
set USE_XNNPACK=OFF
274274
set MSVC_Z7_OVERRIDE=OFF
275-
set PYTORCH_BUILD_VERSION=2.5.1
275+
set PYTORCH_BUILD_VERSION=2.7.1
276276
set PYTORCH_BUILD_NUMBER=1
277277
python setup.py install
278278
```

0 commit comments

Comments
 (0)