Skip to content

Commit a7f83c4

Browse files
authored
Update Linux CUDA build job (#1000)
- Get rid of PyTorch's custom docker image - Manually install CUDA tool kit - Update CUDA version to `12.8.1`, so that we can use GCC 14. - Add 3.13t to build
1 parent c689e65 commit a7f83c4

File tree

3 files changed

+42
-25
lines changed

3 files changed

+42
-25
lines changed

.github/scripts/windows/build_package.sh

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,9 @@ cuda_dir="/c/opt/cuda"
2424
.github/scripts/install_cuda_toolkit.py \
2525
--base-dir "${cuda_dir}" \
2626
--cuda-version "${cuda_ver}"
27+
if [ ! -d "${cuda_dir}/lib64" ]; then
28+
ln -s "${cuda_dir}/lib" "${cuda_dir}/lib64"
29+
fi
2730

2831
export PATH="${PATH}:${cuda_dir}/bin"
2932
export CUDA_PATH="${cuda_dir}"

.github/workflows/_build_linux_cuda.yml

Lines changed: 34 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,6 @@ on:
99
machine_gpu:
1010
type: string
1111
default: "4-core-ubuntu-gpu-t4"
12-
build_container:
13-
required: true
14-
type: string
1512
arch:
1613
type: string
1714
default: x86_64
@@ -47,7 +44,7 @@ env:
4744
jobs:
4845
build:
4946
runs-on: "${{ inputs.machine }}"
50-
container: "${{ inputs.build_container }}"
47+
container: "quay.io/pypa/manylinux_2_28_${{ inputs.arch }}"
5148
steps:
5249
- uses: actions/checkout@v4
5350
with:
@@ -57,28 +54,42 @@ jobs:
5754
run: |
5855
set -ex
5956
60-
# Quick sanity check
61-
nvcc --version
57+
# Figure out versions
58+
py_ver="${{ inputs.python-version }}"
59+
if [[ "${{ inputs.free-threaded }}" == 'ft' ]]; then
60+
py_ver="${py_ver}t"
61+
fi
62+
cuda_ver="${{ inputs.cuda-version }}"
6263
63-
wget -qO- https://astral.sh/uv/install.sh | sh
64-
source $HOME/.local/bin/env
64+
# Setup Python
65+
# wget -qO- https://astral.sh/uv/install.sh | sh
6566
uv --version
66-
uv python list --only-installed
6767
68-
# note: 3.13t is in cp313-cp313t directory, others are in cp313-cp313 directory
69-
v=${{ inputs.python-version }}
70-
dir="cp${v//[.t]/}-cp${v//[.]/}"
71-
if [[ "${{ inputs.free-threaded }}" == 'ft' ]]; then
72-
dir="${dir}t"
73-
fi
74-
python_exe="/opt/python/${dir}/bin/python"
75-
"${python_exe}" --version
76-
uv venv --python "${python_exe}"
77-
if [[ "${{ inputs.free-threaded }}" == 'ft' ]]; then
78-
source .venv/bin/activate
68+
uv python pin "${py_ver}"
69+
uv python list --only-installed
70+
uv venv
71+
source .venv/bin/activate
72+
73+
which python
74+
python --version
75+
76+
# Install CUDA
77+
cuda_dir="/opt/cuda"
78+
.github/scripts/install_cuda_toolkit.py \
79+
--base-dir "${cuda_dir}" \
80+
--cuda-version "${cuda_ver}"
81+
if [ ! -d "${cuda_dir}/lib64" ]; then
82+
ln -s "${cuda_dir}/lib" "${cuda_dir}/lib64"
7983
fi
80-
uv build --no-python-downloads --all-packages --wheel
8184
85+
export PATH="${PATH}:${cuda_dir}/bin"
86+
export CUDA_PATH="${cuda_dir}"
87+
# Sanity check
88+
set -e
89+
nvcc --version
90+
91+
# Build package
92+
uv build --no-python-downloads --all-packages --wheel
8293
./packaging/repair_wheels.sh "manylinux_2_27_${{ inputs.arch }}" ./dist ~/package
8394
8495
- uses: actions/upload-artifact@v4
@@ -173,7 +184,8 @@ jobs:
173184
pip install pytest pytest-xdist parameterized
174185
175186
cu_ver="${{ inputs.cuda-version }}"
176-
cu_ver="${cu_ver//[.]/}" # Remove dots
187+
cu_ver="${cu_ver//[.]/}" # Remove dots 12.4.1 -> 1241
188+
cu_ver="${cu_ver:0:3}" # Retain three chars 1241 -> 124
177189
pip install numpy torch --index-url "https://download.pytorch.org/whl/cu${cu_ver}"
178190
179191
# Install FFmpeg

.github/workflows/packaging.yml

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -95,15 +95,17 @@ jobs:
9595
fail-fast: false
9696
matrix:
9797
python-version: ["3.10", "3.11", "3.12", "3.13", "3.14"]
98-
cuda-version: ["12.4"]
98+
cuda-version: ["12.8.1"]
9999
free-threaded: [""]
100100
include:
101+
- python-version: "3.13"
102+
free-threaded: "ft"
103+
cuda-version: "12.8.1"
101104
- python-version: "3.14"
102105
free-threaded: "ft"
103-
cuda-version: "12.4"
106+
cuda-version: "12.8.1"
104107
uses: ./.github/workflows/_build_linux_cuda.yml
105108
with:
106-
build_container: "pytorch/manylinux2_28-builder:cuda${{ matrix.cuda-version }}"
107109
python-version: "${{ matrix.python-version }}"
108110
free-threaded: "${{ matrix.free-threaded }}"
109111
cuda-version: "${{ matrix.cuda-version }}"

0 commit comments

Comments
 (0)