ci: factor ET MLX build-config (patches × CPU-OFF) #1
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: MLX build-config repro | |
| # BISSECTION DES ARGS DE BUILD — sans build ExecuTorch (~20-30 min par leg, | |
| # legs en parallèle). Le libmlx.a d'ExecuTorch diffère du build pip par : | |
| # (a) deux patchs de source appliqués par PATCH_COMMAND | |
| # (backends/mlx/patches/*.patch) | |
| # (b) -DMLX_BUILD_CPU=OFF (pip compile le backend CPU) | |
| # Trois legs factorisent les deux causes en un seul workflow. | |
| # | |
| # À poser sur ci-mlx-check en .github/workflows/mlx-config-repro.yml | |
| # (à côté du reste — ne touche pas au job long). | |
| on: | |
| workflow_dispatch: | |
| push: | |
| branches: | |
| - ci-mlx-check | |
| paths: | |
| - mlx_gather_mm_repro.py | |
| - .github/workflows/mlx-config-repro.yml | |
| permissions: | |
| contents: read | |
| jobs: | |
| repro: | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| include: | |
| - leg: patched # (a) seul | |
| apply_patches: "yes" | |
| cmake_args: "" | |
| - leg: cpu-off # (b) seul | |
| apply_patches: "no" | |
| cmake_args: "-DMLX_BUILD_CPU=OFF" | |
| - leg: patched-cpu-off # (a) + (b) = config effective ET (hors JIT, | |
| apply_patches: "yes" # déjà hors de cause : ON et OFF échouent | |
| cmake_args: "-DMLX_BUILD_CPU=OFF" # identiquement côté ET) | |
| runs-on: macos-14 | |
| timeout-minutes: 90 | |
| name: repro-${{ matrix.leg }} | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| submodules: recursive | |
| - uses: actions/setup-python@v5 | |
| with: | |
| python-version: "3.12" | |
| - name: Preuve — état de la source | |
| run: | | |
| set -eux | |
| git -C backends/mlx/third-party/mlx log -1 --format='%H %d' | |
| git -C backends/mlx/third-party/mlx status --short | head -5 | |
| - name: Appliquer les patchs ExecuTorch (leg ${{ matrix.leg }}) | |
| if: matrix.apply_patches == 'yes' | |
| run: | | |
| set -eux | |
| bash backends/mlx/patches/apply.sh \ | |
| backends/mlx/third-party/mlx \ | |
| backends/mlx/patches/mlx_nax_has_include.patch \ | |
| backends/mlx/patches/mlx_qmm_splitk_bk_align.patch | |
| git -C backends/mlx/third-party/mlx diff --stat | |
| - name: Build MLX (pip install du sous-module) | |
| run: | | |
| set -eux | |
| python -m pip install --upgrade pip | |
| pip install numpy setuptools wheel "nanobind>=2.0" | |
| export CMAKE_BUILD_PARALLEL_LEVEL=3 | |
| export CMAKE_ARGS="${{ matrix.cmake_args }}" | |
| pip install ./backends/mlx/third-party/mlx -v 2>&1 | tail -20 | |
| python -c "import mlx.core as mx; print('mlx', mx.__version__, '| device:', mx.default_device())" | |
| - name: Repro gather_mm sorted (leg ${{ matrix.leg }}) | |
| run: | | |
| set -eux | |
| python mlx_gather_mm_repro.py |