Skip to content

Commit c589c66

Browse files
committed
Add free threaded build
1 parent 1091e3d commit c589c66

4 files changed

Lines changed: 20 additions & 5 deletions

File tree

.github/actions/test-linux/action.yml

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,15 +9,29 @@ inputs:
99
runs:
1010
using: "composite"
1111
steps:
12+
# FIXME: The distributed tests fail with free-threading Python.
13+
- name: Check free-threading Python
14+
id: is-free-threading
15+
shell: bash
16+
run: |
17+
echo "::group::Check free-threading Python"
18+
if python -VV 2>&1 | grep "free-threading"; then
19+
echo "result=true" >> $GITHUB_OUTPUT
20+
else
21+
echo "result=false" >> $GITHUB_OUTPUT
22+
fi
23+
echo "::endgroup::"
24+
1225
- name: Run MPI tests
26+
if: ${{ steps.is-free-threading.outputs.result == 'false' }}
1327
shell: bash
1428
run: |
1529
echo "::group::MPI tests"
1630
mpirun --bind-to none --allow-run-as-root -host localhost:8 -np 8 python python/tests/mpi_test_distributed.py
1731
echo "::endgroup::"
1832
1933
- name: Run distributed tests
20-
if: ${{ inputs.has-gpu == 'false' }}
34+
if: ${{ steps.is-free-threading.outputs.result == 'false' }}
2135
shell: bash
2236
run: |
2337
echo "::group::Distributed tests"

.github/workflows/nightly.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ jobs:
4141
strategy:
4242
fail-fast: false
4343
matrix:
44-
python_version: ["3.11", "3.12", "3.13", "3.14"]
44+
python_version: ["3.11", "3.12", "3.13", "3.14", "3.14t"]
4545
runner:
4646
- ubuntu-22.04
4747
- ubuntu-22.04-arm
@@ -59,7 +59,7 @@ jobs:
5959
if: github.repository == 'ml-explore/mlx'
6060
strategy:
6161
matrix:
62-
python-version: ["3.10", "3.13"]
62+
python-version: ["3.10", "3.13", "3.14t"]
6363
runs-on: [self-hosted, macos]
6464
steps:
6565
- uses: actions/checkout@v6

.github/workflows/release.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ jobs:
4747
if: github.repository == 'ml-explore/mlx'
4848
strategy:
4949
matrix:
50-
python_version: ["3.10", "3.11", "3.12", "3.13", "3.14"]
50+
python_version: ["3.10", "3.11", "3.12", "3.13", "3.13t", "3.14", "3.14t"]
5151
arch: ['x86_64', 'aarch64']
5252
runs-on: ${{ matrix.arch == 'x86_64' && 'ubuntu-22.04' || 'ubuntu-22.04-arm' }}
5353
env:
@@ -83,7 +83,7 @@ jobs:
8383
if: github.repository == 'ml-explore/mlx'
8484
strategy:
8585
matrix:
86-
python-version: ["3.10", "3.11", "3.12", "3.13", "3.14"]
86+
python-version: ["3.10", "3.11", "3.12", "3.13", "3.13t", "3.14", "3.14t"]
8787
runs-on: [self-hosted, macos]
8888
env:
8989
PYPI_RELEASE: 1

python/src/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ nanobind_add_module(
22
core
33
NB_STATIC
44
STABLE_ABI
5+
FREE_THREADED
56
LTO
67
NOMINSIZE
78
NB_DOMAIN

0 commit comments

Comments
 (0)