Skip to content

Commit ea1b9df

Browse files
committed
Add 3.13t build CI jobs for Linux
1 parent fb2d5c2 commit ea1b9df

File tree

3 files changed

+93
-16
lines changed

3 files changed

+93
-16
lines changed

.github/workflows/_build_linux.yml

+37-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
@@ -54,9 +64,18 @@ jobs:
5464
overwrite: true
5565

5666
- name: Check package
67+
# CFFI is not available yet for 3.13t, which prevents the installation of twine
68+
# https://github.com/python-cffi/cffi/releases/tag/v1.17.0
69+
if: ${{ inputs.python-version != '3.13t' }}
5770
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"
71+
# note: 3.13t is in cp313-cp313t directory, others are in cp313-cp313 directory
72+
v=${{ inputs.python-version }}
73+
if [[ "${{ inputs.free-threaded }}" == 'ft' ]]; then
74+
dir="cp${v//[.t]/}-cp${v//[.]/}t"
75+
else
76+
dir="cp${v//[.t]/}-cp${v//[.]/}"
77+
fi
78+
python_exe="/opt/python/${dir}/bin/python"
6079
"${python_exe}" -m pip install -r ./packaging/requirements.txt
6180
"${python_exe}" -m twine check --strict ~/package/*.whl
6281
@@ -83,12 +102,25 @@ jobs:
83102
path: ~/package
84103

85104
- uses: conda-incubator/setup-miniconda@v3
105+
if: ${{ inputs.python-version != '3.13t' }}
86106
with:
87107
python-version: ${{ inputs.python-version }}
88108
conda-remove-defaults: "true"
89109

110+
- uses: conda-incubator/setup-miniconda@v3
111+
if: ${{ inputs.python-version == '3.13t' }}
112+
with:
113+
python-version: '3.13'
114+
conda-remove-defaults: "true"
115+
90116
- name: Unit test
91117
run: |
118+
set -ex
119+
120+
if [[ "${{ inputs.free-threaded }}" == 'ft' ]]; then
121+
conda install -q -c conda-forge python-freethreading
122+
fi
123+
92124
# Install SPDL
93125
pip install $(find "${HOME}/package" -name '*.whl' -depth -maxdepth 1)
94126

.github/workflows/_build_linux_cuda.yml

+36-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
@@ -27,7 +31,7 @@ on:
2731
type: string
2832

2933
env:
30-
ARTIFACT: wheel-linux-py${{ inputs.python-version }}-cuda${{ inputs.cuda-version }}
34+
ARTIFACT: wheel-linux-py${{ inputs.python-version }}${{ inputs.free-threaded }}-cuda${{ inputs.cuda-version }}
3135
SPDL_USE_TRACING: 1
3236
SPDL_BUILD_STUB: 0
3337
SPDL_USE_CUDA: 1
@@ -61,8 +65,14 @@ jobs:
6165
source $HOME/.local/bin/env
6266
uv python list --only-installed
6367
64-
py_ver="$(echo '${{ inputs.python-version }}' | sed 's|[^0-9]*||g')"
65-
python_exe="/opt/python/cp${py_ver}-cp${py_ver}/bin/python"
68+
# note: 3.13t is in cp313-cp313t directory, others are in cp313-cp313 directory
69+
v=${{ inputs.python-version }}
70+
if [[ "${{ inputs.free-threaded }}" == 'ft' ]]; then
71+
dir="cp${v//[.t]/}-cp${v//[.]/}t"
72+
else
73+
dir="cp${v//[.t]/}-cp${v//[.]/}"
74+
fi
75+
python_exe="/opt/python/${dir}/bin/python"
6676
uv venv --python "${python_exe}"
6777
uv build --all-packages --wheel
6878
@@ -78,10 +88,18 @@ jobs:
7888
overwrite: true
7989

8090
- name: Check package
91+
# CFFI is not available yet for 3.13t, which prevents the installation of twine
92+
# https://github.com/python-cffi/cffi/releases/tag/v1.17.0
93+
if: ${{ inputs.python-version != '3.13t' }}
8194
run: |
82-
py_ver="$(echo '${{ inputs.python-version }}' | sed 's|[^0-9]*||g')"
83-
python_exe="/opt/python/cp${py_ver}-cp${py_ver}/bin/python"
84-
95+
# note: 3.13t is in cp313-cp313t directory, others are in cp313-cp313 directory
96+
v=${{ inputs.python-version }}
97+
if [[ "${{ inputs.free-threaded }}" == 'ft' ]]; then
98+
dir="cp${v//[.t]/}-cp${v//[.]/}t"
99+
else
100+
dir="cp${v//[.t]/}-cp${v//[.]/}"
101+
fi
102+
python_exe="/opt/python/${dir}/bin/python"
85103
"${python_exe}" -m pip install -r ./packaging/requirements.txt
86104
"${python_exe}" -m twine check --strict ~/package/*.whl
87105
@@ -108,14 +126,25 @@ jobs:
108126
path: ~/package
109127

110128
- uses: conda-incubator/setup-miniconda@v3
129+
if: ${{ inputs.python-version != '3.13t' }}
111130
with:
112-
python-version: "${{ inputs.python-version }}"
131+
python-version: ${{ inputs.python-version }}
132+
conda-remove-defaults: "true"
133+
134+
- uses: conda-incubator/setup-miniconda@v3
135+
if: ${{ inputs.python-version == '3.13t' }}
136+
with:
137+
python-version: '3.13'
113138
conda-remove-defaults: "true"
114139

115140
- name: Unit test
116141
run: |
117142
set -ex
118143
144+
if [[ "${{ inputs.free-threaded }}" == 'ft' ]]; then
145+
conda install -q -c conda-forge python-freethreading
146+
fi
147+
119148
# Install SPDL
120149
pip install $(find "${HOME}/package" -name '*.whl' -depth -maxdepth 1)
121150

.github/workflows/packaging.yml

+20-4
Original file line numberDiff line numberDiff line change
@@ -46,25 +46,35 @@ jobs:
4646
fail-fast: false
4747
matrix:
4848
python-version: ["3.10", "3.11", "3.12", "3.13"]
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-latest
5256
arch: x86_64
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
linux-aarch64:
5762
name: "Linux aarch64"
5863
strategy:
5964
fail-fast: false
6065
matrix:
61-
python-version: ["3.10", "3.11", "3.12", "3.13"]
66+
python-version: ["3.10", "3.11", "3.12", "3.13", "3.13t"]
67+
free-threaded: [""]
68+
include:
69+
- python-version: "3.13"
70+
free-threaded: "ft"
6271
uses: ./.github/workflows/_build_linux.yml
6372
with:
6473
os: ubuntu-24.04-arm
6574
arch: aarch64
6675
python-version: "${{ matrix.python-version }}"
67-
run-test: "${{ matrix.python-version == '3.10'}}"
76+
free-threaded: "${{ matrix.free-threaded }}"
77+
run-test: "${{ matrix.python-version == '3.10' || matrix.free-threaded == 'ft' }}"
6878

6979
#############################################################################
7080
# Linux (CUDA)
@@ -76,12 +86,18 @@ jobs:
7686
matrix:
7787
python-version: ["3.10", "3.11", "3.12", "3.13"]
7888
cuda-version: ["12.6"]
89+
free-threaded: [""]
90+
include:
91+
- python-version: "3.13"
92+
cuda-version: "12.6"
93+
free-threaded: "ft"
7994
uses: ./.github/workflows/_build_linux_cuda.yml
8095
with:
8196
os_build: ubuntu-latest
8297
os_test: "4-core-ubuntu-gpu-t4"
8398
container: "pytorch/manylinux2_28-builder:cuda${{ matrix.cuda-version }}"
8499
arch: x86_64
85100
python-version: "${{ matrix.python-version }}"
101+
free-threaded: "${{ matrix.free-threaded }}"
86102
cuda-version: "${{ matrix.cuda-version }}"
87-
run-test: "${{ matrix.python-version == '3.10'}}"
103+
run-test: "${{ matrix.python-version == '3.10' || matrix.python-version == '3.13t' }}"

0 commit comments

Comments
 (0)