Skip to content

Commit 7404b1f

Browse files
committed
Upgrade to torch 2.9.1 and Python 3.14.2
The upstream torch arm64 wheels have been compiled for CUDA as well since 2.6.0. This makes the upgrade a lot easier. Different dependencies in the images caused difficulties in building the derived images. The dependencies are now the same. This now changes the support from sm_72 (Xavier) and sm_87 (Orin) to sm_80 (Ampere) and sm_90 (Hopper) for the arm64 image.
1 parent 299a7e6 commit 7404b1f

8 files changed

Lines changed: 39 additions & 465 deletions

.github/workflows/main.yml

Lines changed: 23 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,6 @@ on:
88
push:
99
branches:
1010
- main
11-
paths-ignore:
12-
- 'torch-wheel.Dockerfile'
13-
- '.github/workflows/torch-wheel.yml'
14-
- 'torchvision-wheel.Dockerfile'
15-
- '.github/workflows/torchvision-wheel.yml'
1611
# We want to monthly update the base image for security
1712
# TODO Can we avoid building the same image?
1813
schedule:
@@ -28,42 +23,35 @@ jobs:
2823
matrix:
2924
include:
3025
# Check torch + torchvision compatibility from https://github.com/pytorch/vision?tab=readme-ov-file#installation
31-
- torch: '2.3.1'
32-
torch-wheel-tag: '2.3.1'
33-
torchvision: '0.18.1'
34-
python: '3.11.9-slim'
26+
- torch: '2.9.1'
27+
python: '3.14.2'
28+
# We need to use project index for CUDA on aarch64 as pypi wheels are for CPU only
29+
index: cu126
3530
platforms: linux/amd64,linux/arm64
36-
constraints: constraints-2.3.1.txt
31+
constraints: constraints-2.9.1.txt
3732

38-
- torch: '2.3.1'
39-
torch-wheel-tag: '2.3.1'
40-
torchvision: '0.18.1'
41-
python: '3.11.10'
33+
- torch: '2.9.1'
34+
python: '3.14.2-slim'
35+
index: cu126
4236
platforms: linux/amd64,linux/arm64
43-
constraints: constraints-2.3.1.txt
44-
- torch: '2.3.1'
45-
torch-wheel-tag: '2.3.1'
46-
torchvision: '0.18.1'
47-
python: '3.11.10-slim'
48-
platforms: linux/amd64,linux/arm64
49-
constraints: constraints-2.3.1.txt
50-
- torch: '2.3.1+cpu'
51-
torch-wheel-tag: '2.3.1'
52-
python: '3.11.10'
53-
extra-index-url: 'https://download.pytorch.org/whl/cpu'
37+
constraints: constraints-2.9.1.txt
38+
39+
- torch: '2.9.1'
40+
python: '3.14.2'
41+
index: cpu
5442
platforms: linux/amd64
55-
constraints: constraints-2.3.1.txt
43+
constraints: constraints-2.9.1.txt
5644
steps:
5745
- id: created
5846
run: echo "created=$(date --utc +%Y-%m-%dT%H:%M:%SZ)" >> $GITHUB_OUTPUT
5947

60-
- uses: actions/checkout@v4
48+
- uses: actions/checkout@v6
6149

6250
- name: Set up Docker Buildx
63-
uses: docker/setup-buildx-action@b5ca514318bd6ebac0fb2aedd5d36ec1b5c232a2 # v3.10.0
51+
uses: docker/setup-buildx-action@8d2750c68a42422c14e847fe6c8ac0403b4cbd6f # v3.12.0
6452

6553
- name: Log in to Docker Hub
66-
uses: docker/login-action@74a5d142397b4f367a81961eba4e8cd7edddf772 # v3.4.0
54+
uses: docker/login-action@5e57cd118135c172c3672efd75eb46360885c0ef # v3.6.0
6755
if: github.ref == 'refs/heads/main'
6856
with:
6957
username: ${{ secrets.DOCKERHUB_USERNAME }}
@@ -74,9 +62,9 @@ jobs:
7462
# Tags have limited set of valid character, '+' not included
7563
# https://github.com/opencontainers/distribution-spec/blob/main/spec.md#pulling-manifests
7664
run: |
77-
echo "tag=$(echo -n "${{ matrix.torch }}-${{ matrix.python }}" | tr -c 'a-zA-Z0-9._-' '[-*]')" >> $GITHUB_OUTPUT
65+
echo "tag=$(echo -n "${{ matrix.torch }}${{ matrix.index && format('+{0}', matrix.index) || '' }}-${{ matrix.python }}" | tr -c 'a-zA-Z0-9._-' '[-*]')" >> $GITHUB_OUTPUT
7866
79-
- uses: docker/build-push-action@1dc73863535b631f98b2378be8619f83b136f4a0 # v6.17.0
67+
- uses: docker/build-push-action@263435318d21b8e681c14492fe198d362a7d2c83 # v6.18.0
8068
with:
8169
context: .
8270
push: ${{ github.ref == 'refs/heads/main' }}
@@ -88,7 +76,7 @@ jobs:
8876
TORCH_REQUIREMENT=${{ matrix.url || format('torch=={0}', matrix.torch) }}
8977
TORCH_WHEEL_SOURCE=${{ matrix.torch-wheel-tag && format('{0}/torch-wheels:{1}', vars.DOCKERHUB_USERNAME, matrix.torch-wheel-tag) || 'scratch'}}
9078
TORCHVISION_WHEEL_SOURCE=${{ matrix.torchvision && format('{0}/torchvision-wheels:{1}', vars.DOCKERHUB_USERNAME, matrix.torchvision) || 'scratch'}}
91-
EXTRA_INDEX_URL=${{ matrix.extra-index-url }}
79+
EXTRA_INDEX_URL=${{ matrix.extra-index-url || format('https://download.pytorch.org/whl/{0}/', matrix.index) }}
9280
${{ matrix.constraints && format('CONSTRAINTS={0}', matrix.constraints) || '' }}
9381
# TODO add the latest tag, maybe somehow via docker/metadata-action
9482
tags: |
@@ -105,7 +93,7 @@ jobs:
10593
# https://octokit.github.io/rest.js/v19#git-update-ref
10694
- name: Tag the commit or update tag
10795
if: github.ref == 'refs/heads/main'
108-
uses: actions/github-script@v7
96+
uses: actions/github-script@v8
10997
with:
11098
script: |
11199
try {
@@ -133,9 +121,9 @@ jobs:
133121
runs-on: ubuntu-latest
134122
if: github.ref == 'refs/heads/main'
135123
steps:
136-
- uses: actions/checkout@v4
124+
- uses: actions/checkout@v6
137125
- name: Docker Hub Description
138-
uses: peter-evans/dockerhub-description@432a30c9e07499fd01da9f8a49f0faf9e0ca5b77 # v4.0.2
126+
uses: peter-evans/dockerhub-description@1b9a80c056b620d92cedb9d9b5a223409c68ddfa # v5.0.0
139127
with:
140128
username: ${{ secrets.DOCKERHUB_USERNAME }}
141129
password: ${{ secrets.DOCKERHUB_TOKEN }}

.github/workflows/torch-wheel.yml

Lines changed: 0 additions & 90 deletions
This file was deleted.

.github/workflows/torchvision-wheel.yml

Lines changed: 0 additions & 98 deletions
This file was deleted.

Dockerfile

Lines changed: 6 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
# syntax=docker/dockerfile:1
22

3-
ARG PYTHON=3.11.10
4-
ARG TORCH=2.3.1
3+
ARG PYTHON=3.14.2
4+
ARG TORCH=2.9.1
55
ARG TORCH_REQUIREMENT="torch==${TORCH}"
6-
ARG EXTRA_INDEX_URL
6+
ARG EXTRA_INDEX_URL="https://download.pytorch.org/whl/cu126/"
77
ARG TORCH_WHEEL_SOURCE="scratch"
88
ARG TORCHVISION_WHEEL_SOURCE="scratch"
99
ARG CREATED
1010
ARG SOURCE_COMMIT
11-
ARG CONSTRAINTS=constraints-2.3.1.txt
11+
ARG CONSTRAINTS=constraints-2.9.1.txt
1212

1313
# Using variable in RUN --mount=from gives error 'from' doesn't support variable expansion, define alias stage instead
1414
FROM ${TORCH_WHEEL_SOURCE} AS torch-wheel-image
@@ -18,8 +18,8 @@ FROM ${TORCHVISION_WHEEL_SOURCE} AS torchvision-wheel-image
1818
FROM python:${PYTHON}
1919

2020
ARG TARGETPLATFORM
21-
RUN --mount=type=cache,target=/var/cache/apt,id=bookworm-/var/cache/apt-${TARGETPLATFORM} \
22-
--mount=type=cache,target=/var/lib/apt,sharing=locked,id=bookworm-/var/lib/apt-${TARGETPLATFORM} \
21+
RUN --mount=type=cache,target=/var/cache/apt,id=trixie-/var/cache/apt-${TARGETPLATFORM} \
22+
--mount=type=cache,target=/var/lib/apt,sharing=locked,id=trixie-/var/lib/apt-${TARGETPLATFORM} \
2323
<<NUR
2424
set -ex
2525
# To keep cache of downloaded .debs, replace docker configuration
@@ -28,15 +28,6 @@ RUN --mount=type=cache,target=/var/cache/apt,id=bookworm-/var/cache/apt-${TARGET
2828
apt-get update
2929
DEBIAN_FRONTEND=noninteractive \
3030
apt-get upgrade -y --no-install-recommends
31-
32-
case ${TARGETPLATFORM} in
33-
# Extra dependencies needed to run pytorch on Jetson
34-
# Retreived from: https://github.com/dusty-nv/jetson-containers/blob/master/packages/pytorch/Dockerfile
35-
"linux/arm64")
36-
DEBIAN_FRONTEND=noninteractive \
37-
apt-get install -y libopenblas-dev libopenmpi-dev openmpi-common openmpi-bin gfortran libomp-dev
38-
;;
39-
esac
4031
NUR
4132

4233
COPY README.md LICENSE /

constraints-2.3.1.txt

Lines changed: 0 additions & 28 deletions
This file was deleted.

constraints-2.9.1.txt

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
filelock==3.20.2
2+
fsspec==2025.12.0
3+
Jinja2==3.1.6
4+
MarkupSafe==3.0.3
5+
mpmath==1.3.0
6+
networkx==3.6.1
7+
setuptools==80.9.0; python_version >= "3.12"
8+
sympy==1.14.0
9+
triton==3.5.1
10+
typing_extensions==4.15.0

0 commit comments

Comments
 (0)