diff --git a/.github/actions/test-linux/action.yml b/.github/actions/test-linux/action.yml index b2d3e17d..ad1eadce 100644 --- a/.github/actions/test-linux/action.yml +++ b/.github/actions/test-linux/action.yml @@ -9,7 +9,21 @@ inputs: runs: using: "composite" steps: + # FIXME: The distributed tests fail with free-threading Python. + - name: Check free-threading Python + id: is-free-threading + shell: bash + run: | + echo "::group::Check free-threading Python" + if python -VV 2>&1 | grep "free-threading"; then + echo "result=true" >> $GITHUB_OUTPUT + else + echo "result=false" >> $GITHUB_OUTPUT + fi + echo "::endgroup::" + - name: Run MPI tests + if: ${{ steps.is-free-threading.outputs.result == 'false' }} shell: bash run: | echo "::group::MPI tests" @@ -17,7 +31,7 @@ runs: echo "::endgroup::" - name: Run distributed tests - if: ${{ inputs.has-gpu == 'false' }} + if: ${{ steps.is-free-threading.outputs.result == 'false' && inputs.has-gpu == 'false' }} shell: bash run: | echo "::group::Distributed tests" diff --git a/.github/workflows/nightly.yml b/.github/workflows/nightly.yml index 8266140d..fb5ef293 100644 --- a/.github/workflows/nightly.yml +++ b/.github/workflows/nightly.yml @@ -41,7 +41,7 @@ jobs: strategy: fail-fast: false matrix: - python_version: ["3.11", "3.12", "3.13", "3.14"] + python_version: ["3.11", "3.12", "3.13", "3.14", "3.14t"] runner: - ubuntu-22.04 - ubuntu-22.04-arm @@ -59,7 +59,7 @@ jobs: if: github.repository == 'ml-explore/mlx' strategy: matrix: - python-version: ["3.10", "3.13"] + python-version: ["3.10", "3.13", "3.14t"] runs-on: [self-hosted, macos] steps: - uses: actions/checkout@v6 diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index b6434b1e..84297ff0 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -47,7 +47,7 @@ jobs: if: github.repository == 'ml-explore/mlx' strategy: matrix: - python_version: ["3.10", "3.11", "3.12", "3.13", "3.14"] + python_version: ["3.10", "3.11", "3.12", "3.13", "3.13t", "3.14", "3.14t"] arch: ['x86_64', 'aarch64'] runs-on: ${{ matrix.arch == 'x86_64' && 'ubuntu-22.04' || 'ubuntu-22.04-arm' }} env: @@ -83,7 +83,7 @@ jobs: if: github.repository == 'ml-explore/mlx' strategy: matrix: - python-version: ["3.10", "3.11", "3.12", "3.13", "3.14"] + python-version: ["3.10", "3.11", "3.12", "3.13", "3.13t", "3.14", "3.14t"] runs-on: [self-hosted, macos] env: PYPI_RELEASE: 1 diff --git a/python/src/CMakeLists.txt b/python/src/CMakeLists.txt index 44727150..0798add4 100644 --- a/python/src/CMakeLists.txt +++ b/python/src/CMakeLists.txt @@ -2,6 +2,7 @@ nanobind_add_module( core NB_STATIC STABLE_ABI + FREE_THREADED LTO NOMINSIZE NB_DOMAIN