Skip to content

Commit ea33f0a

Browse files
committed
Add 3.13t build CI jobs for Linux
1 parent 3fa43af commit ea33f0a

File tree

3 files changed

+83
-15
lines changed

3 files changed

+83
-15
lines changed

.github/workflows/_build_linux.yml

+32-5
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,10 @@ on:
66
python-version:
77
required: true
88
type: string
9+
free-threaded:
10+
description: 'Whether FT Python or not. Valid value is "ft" or not.'
11+
default: ''
12+
type: string
913
arch:
1014
required: true
1115
type: string
@@ -18,7 +22,7 @@ on:
1822
type: string
1923

2024
env:
21-
ARTIFACT: wheel-linux-py${{ inputs.python-version }}-${{ inputs.arch }}
25+
ARTIFACT: wheel-linux-py${{ inputs.python-version }}${{ inputs.free-threaded }}-${{ inputs.arch }}
2226

2327
jobs:
2428
build:
@@ -37,8 +41,14 @@ jobs:
3741
set -ex
3842
uv python list --only-installed
3943
40-
py_ver="$(echo '${{ inputs.python-version }}' | sed 's|[^0-9]*||g')"
41-
python_exe="/opt/python/cp${py_ver}-cp${py_ver}/bin/python"
44+
# note: 3.13t is in cp313-cp313t directory, others are in cp313-cp313 directory
45+
v=${{ inputs.python-version }}
46+
if [[ "${{ inputs.free-threaded }}" == 'ft' ]]; then
47+
dir="cp${v//[.t]/}-cp${v//[.]/}t"
48+
else
49+
dir="cp${v//[.t]/}-cp${v//[.]/}"
50+
fi
51+
python_exe="/opt/python/${dir}/bin/python"
4252
uv venv --python "${python_exe}"
4353
uv build --all-packages --wheel
4454
@@ -55,8 +65,12 @@ jobs:
5565

5666
- name: Check package
5767
run: |
58-
py_ver="$(echo '${{ inputs.python-version }}' | sed 's|[^0-9]*||g')"
59-
python_exe="/opt/python/cp${py_ver}-cp${py_ver}/bin/python"
68+
# CFFI is not available yet for 3.13t, which prevents the installation of twine
69+
# https://github.com/python-cffi/cffi/releases/tag/v1.17.0
70+
# So we use the regular 3.13
71+
v=${{ inputs.python-version }}
72+
dir="cp${v//[.t]/}-cp${v//[.t]/}"
73+
python_exe="/opt/python/${dir}/bin/python"
6074
"${python_exe}" -m pip install -r ./packaging/requirements.txt
6175
"${python_exe}" -m twine check --strict ~/package/*.whl
6276
@@ -83,12 +97,25 @@ jobs:
8397
path: ~/package
8498

8599
- uses: conda-incubator/setup-miniconda@v3
100+
if: ${{ inputs.python-version != '3.13t' }}
86101
with:
87102
python-version: ${{ inputs.python-version }}
88103
conda-remove-defaults: "true"
89104

105+
- uses: conda-incubator/setup-miniconda@v3
106+
if: ${{ inputs.python-version == '3.13t' }}
107+
with:
108+
python-version: '3.13'
109+
conda-remove-defaults: "true"
110+
90111
- name: Unit test
91112
run: |
113+
set -ex
114+
115+
if [[ "${{ inputs.free-threaded }}" == 'ft' ]]; then
116+
conda install -q -c conda-forge python-freethreading
117+
fi
118+
92119
# Install SPDL
93120
pip install $(find "${HOME}/package" -name '*.whl' -depth -maxdepth 1)
94121

.github/workflows/_build_linux_cuda.yml

+37-7
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,10 @@ on:
1818
python-version:
1919
required: true
2020
type: string
21+
free-threaded:
22+
description: 'Whether FT Python or not. Valid value is "ft" or not.'
23+
default: ''
24+
type: string
2125
cuda-version:
2226
required: true
2327
type: string
@@ -30,7 +34,7 @@ on:
3034
type: string
3135

3236
env:
33-
ARTIFACT: wheel-linux-py${{ inputs.python-version }}-cuda${{ inputs.cuda-version }}${{ inputs.use-nvdec }}
37+
ARTIFACT: wheel-linux-py${{ inputs.python-version }}${{ inputs.free-threaded }}-cuda${{ inputs.cuda-version }}${{ inputs.use-nvdec }}
3438
SPDL_USE_TRACING: 1
3539
SPDL_BUILD_STUB: 0
3640
SPDL_USE_CUDA: 1
@@ -65,8 +69,20 @@ jobs:
6569
source $HOME/.local/bin/env
6670
uv python list --only-installed
6771
68-
py_ver="$(echo '${{ inputs.python-version }}' | sed 's|[^0-9]*||g')"
69-
python_exe="/opt/python/cp${py_ver}-cp${py_ver}/bin/python"
72+
# note: 3.13t is in cp313-cp313t directory, others are in cp313-cp313 directory
73+
v=${{ inputs.python-version }}
74+
if [[ "${{ inputs.free-threaded }}" == 'ft' ]]; then
75+
dir="cp${v//[.t]/}-cp${v//[.]/}t"
76+
# tmp: for some reason when ft is enabled, uv picks 3.12.
77+
# so we delete others
78+
for d in `find /opt/python/ -depth 1 -type d -not -name "${dir}"`; do
79+
echo "Removing $d"
80+
rm -rf "$d"
81+
done
82+
else
83+
dir="cp${v//[.t]/}-cp${v//[.]/}"
84+
fi
85+
python_exe="/opt/python/${dir}/bin/python"
7086
uv venv --python "${python_exe}"
7187
uv build --all-packages --wheel
7288
@@ -83,9 +99,12 @@ jobs:
8399

84100
- name: Check package
85101
run: |
86-
py_ver="$(echo '${{ inputs.python-version }}' | sed 's|[^0-9]*||g')"
87-
python_exe="/opt/python/cp${py_ver}-cp${py_ver}/bin/python"
88-
102+
# CFFI is not available yet for 3.13t, which prevents the installation of twine
103+
# https://github.com/python-cffi/cffi/releases/tag/v1.17.0
104+
# So we use the regular 3.13
105+
v=${{ inputs.python-version }}
106+
dir="cp${v//[.t]/}-cp${v//[.t]/}"
107+
python_exe="/opt/python/${dir}/bin/python"
89108
"${python_exe}" -m pip install -r ./packaging/requirements.txt
90109
"${python_exe}" -m twine check --strict ~/package/*.whl
91110
@@ -112,14 +131,25 @@ jobs:
112131
path: ~/package
113132

114133
- uses: conda-incubator/setup-miniconda@v3
134+
if: ${{ inputs.python-version != '3.13t' }}
135+
with:
136+
python-version: ${{ inputs.python-version }}
137+
conda-remove-defaults: "true"
138+
139+
- uses: conda-incubator/setup-miniconda@v3
140+
if: ${{ inputs.python-version == '3.13t' }}
115141
with:
116-
python-version: "${{ inputs.python-version }}"
142+
python-version: '3.13'
117143
conda-remove-defaults: "true"
118144

119145
- name: Unit test
120146
run: |
121147
set -ex
122148
149+
if [[ "${{ inputs.free-threaded }}" == 'ft' ]]; then
150+
conda install -q -c conda-forge python-freethreading
151+
fi
152+
123153
# Install SPDL
124154
pip install $(find "${HOME}/package" -name '*.whl' -depth -maxdepth 1)
125155

.github/workflows/packaging.yml

+14-3
Original file line numberDiff line numberDiff line change
@@ -45,13 +45,18 @@ jobs:
4545
strategy:
4646
fail-fast: false
4747
matrix:
48-
python-version: ["3.10", "3.11", "3.12", "3.13"]
48+
python-version: ["3.10", "3.11", "3.12", "3.13", "3.13t"]
49+
free-threaded: [""]
50+
include:
51+
- python-version: "3.13"
52+
free-threaded: "ft"
4953
uses: ./.github/workflows/_build_linux.yml
5054
with:
5155
os: ubuntu-24.04-arm
5256
arch: aarch64
5357
python-version: "${{ matrix.python-version }}"
54-
run-test: "${{ matrix.python-version == '3.10'}}"
58+
free-threaded: "${{ matrix.free-threaded }}"
59+
run-test: "${{ matrix.python-version == '3.10' || matrix.free-threaded == 'ft' }}"
5560

5661
#############################################################################
5762
# Linux (CUDA)
@@ -64,10 +69,16 @@ jobs:
6469
python-version: ["3.10", "3.11", "3.12", "3.13"]
6570
cuda-version: ["12.6"]
6671
use-nvdec: ["nvdec"]
72+
free-threaded: [""]
73+
include:
74+
- python-version: "3.13"
75+
cuda-version: "12.6"
76+
free-threaded: "ft"
6777
uses: ./.github/workflows/_build_linux_cuda.yml
6878
with:
6979
build_container: "pytorch/manylinux2_28-builder:cuda${{ matrix.cuda-version }}"
7080
python-version: "${{ matrix.python-version }}"
81+
free-threaded: "${{ matrix.free-threaded }}"
7182
cuda-version: "${{ matrix.cuda-version }}"
7283
use-nvdec: "${{ matrix.use-nvdec }}"
73-
run-test: "${{ matrix.python-version == '3.11'}}"
84+
run-test: "${{ matrix.python-version == '3.11' || matrix.free-threaded == 'ft' }}"

0 commit comments

Comments
 (0)