Skip to content

Commit 933ae57

Browse files
committed
backport PR #986
1 parent cef4cf8 commit 933ae57

3 files changed

Lines changed: 17 additions & 4 deletions

File tree

.github/workflows/build-wheel.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ jobs:
3030
- "3.11"
3131
- "3.12"
3232
- "3.13"
33+
- "3.13t"
3334
name: py${{ matrix.python-version }}
3435
runs-on: ${{ (inputs.host-platform == 'linux-64' && 'linux-amd64-cpu8') ||
3536
(inputs.host-platform == 'linux-aarch64' && 'linux-arm64-cpu8') ||
@@ -116,6 +117,7 @@ jobs:
116117
CIBW_REPAIR_WHEEL_COMMAND_WINDOWS: "delvewheel repair --namespace-pkg cuda -w {dest_dir} {wheel}"
117118
CIBW_ENVIRONMENT: >
118119
CUDA_PYTHON_PARALLEL_LEVEL=${{ env.CUDA_PYTHON_PARALLEL_LEVEL }}
120+
CIBW_ENABLE: "cpython-freethreading"
119121
with:
120122
package-dir: ./cuda_core/
121123
output-dir: ${{ env.CUDA_CORE_ARTIFACTS_DIR }}
@@ -163,6 +165,7 @@ jobs:
163165
CUDA_PYTHON_PARALLEL_LEVEL=${{ env.CUDA_PYTHON_PARALLEL_LEVEL }}
164166
CIBW_BEFORE_BUILD_WINDOWS: "pip install delvewheel"
165167
CIBW_REPAIR_WHEEL_COMMAND_WINDOWS: "delvewheel repair --namespace-pkg cuda -w {dest_dir} {wheel}"
168+
CIBW_ENABLE: "cpython-freethreading"
166169
with:
167170
package-dir: ./cuda_bindings/
168171
output-dir: ${{ env.CUDA_BINDINGS_ARTIFACTS_DIR }}
@@ -223,6 +226,10 @@ jobs:
223226
# workaround for actions/runner-images#12377 (the cached 3.13.4 is buggy on Windows)
224227
python-version: ${{ matrix.python-version == '3.13' && '3.13.5' || matrix.python-version }}
225228

229+
- name: verify free-threaded build
230+
if: endsWith(matrix.python-verison, 't')
231+
run: python -c 'import sys; assert not sys._is_gil_enabled()'
232+
226233
- name: Set up Python include paths
227234
run: |
228235
if [[ "${{ inputs.host-platform }}" == linux* ]]; then

ci/tools/run-tests

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -75,12 +75,18 @@ elif [[ "${test_module}" == "core" ]]; then
7575
echo "Installing core wheel"
7676
pwd
7777
ls
78+
79+
FREE_THREADING=""
80+
if python -c 'import sys; assert not sys._is_gil_enabled()' 2> /dev/null; then
81+
FREE_THREADING+="-ft"
82+
fi
83+
7884
if [[ "${LOCAL_CTK}" == 1 ]]; then
7985
# We already installed cuda-bindings, and all CTK components exist locally,
8086
# so just install the test dependencies.
81-
pip install $(ls *.whl)["test-cu${TEST_CUDA_MAJOR}"]
87+
pip install $(ls *.whl)["test-cu${TEST_CUDA_MAJOR}${FREE_THREADING}"]
8288
else
83-
pip install $(ls *.whl)["cu${TEST_CUDA_MAJOR}","test-cu${TEST_CUDA_MAJOR}"]
89+
pip install $(ls *.whl)["cu${TEST_CUDA_MAJOR}","test-cu${TEST_CUDA_MAJOR}${FREE_THREADING}"]
8490
fi
8591
popd
8692
pushd ./cuda_core

cuda_bindings/pyproject.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
# SPDX-License-Identifier: LicenseRef-NVIDIA-SOFTWARE-LICENSE
33

44
[build-system]
5-
requires = ["setuptools>=77.0.0", "cython>=3.0,<3.1.0", "pyclibrary>=0.1.7"]
5+
requires = ["setuptools>=77.0.0", "cython>=3.1,<3.2", "pyclibrary>=0.1.7"]
66
build-backend = "setuptools.build_meta"
77

88
[project]
@@ -40,7 +40,7 @@ all = [
4040
]
4141

4242
test = [
43-
"cython>=3.0,<3.1.0",
43+
"cython>=3.1,<3.2",
4444
"setuptools>=77.0.0",
4545
"numpy>=1.21.1",
4646
"pytest>=6.2.4",

0 commit comments

Comments
 (0)