File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 44set -euo pipefail
55
66output_dir=" ${1:? usage: build_metal_wheel.sh OUTPUT_DIR} "
7+ : " ${METAL_BUILD_PYTHON:? METAL_BUILD_PYTHON is required} "
78
89mkdir -p " $output_dir "
910rm -f " $output_dir " /* .whl
1011
11- # uv creates a new isolated build environment for every wheel. CMake otherwise
12- # keeps Torch paths from the previous environment, which uv removes after the
13- # build. Refresh only CMake's path cache and retain incremental build outputs.
14- find build -type f -name CMakeCache.txt -delete 2> /dev/null || true
12+ if [[ ! -x " $METAL_BUILD_PYTHON " ]] ; then
13+ echo " ::error::Metal build Python is not executable: ${METAL_BUILD_PYTHON} "
14+ exit 1
15+ fi
1516
1617APHRODITE_TARGET_DEVICE=metal \
1718APHRODITE_REQUIRE_RUST_FRONTEND=1 \
1819MACOSX_DEPLOYMENT_TARGET=" ${MACOSX_DEPLOYMENT_TARGET:- 14.0} " \
19- uv build --wheel --out-dir " $output_dir "
20+ uv build \
21+ --python " $METAL_BUILD_PYTHON " \
22+ --no-build-isolation \
23+ --wheel \
24+ --out-dir " $output_dir "
2025
2126wheel=" $( find " $output_dir " -maxdepth 1 -type f -name ' *.whl' -print -quit) "
2227test -n " $wheel "
Original file line number Diff line number Diff line change @@ -185,6 +185,13 @@ jobs:
185185 with :
186186 python-version : " 3.13"
187187
188+ - name : Create stable Metal build environment
189+ run : |
190+ uv venv --python 3.13 .metal-build-venv
191+ uv pip install \
192+ --python .metal-build-venv/bin/python \
193+ --requirements requirements/build/metal.txt
194+
188195 - name : Install Rust
189196 run : rustup toolchain install stable --profile minimal
190197
@@ -211,6 +218,7 @@ jobs:
211218 PLATFORM_ARCHITECTURE : aarch64
212219 PLATFORM_VERSION_LOCAL : metal
213220 PLATFORM_BUILD_SCRIPT : .github/scripts/build_metal_wheel.sh
221+ METAL_BUILD_PYTHON : ${{ github.workspace }}/.metal-build-venv/bin/python
214222 run : |
215223 .github/scripts/reconcile_platform_wheels.sh \
216224 dist/metal-aarch64 page-index
Original file line number Diff line number Diff line change 11[build-system ]
2- # Should be mirrored in requirements/build/cuda.txt
2+ # Should be mirrored in requirements/build/cuda.txt and requirements/build/metal.txt
33requires = [
44 " cmake>=3.26.1" ,
55 " ninja" ,
Original file line number Diff line number Diff line change 1+ # Should be mirrored in pyproject.toml
2+ cmake>=3.26.1
3+ ninja
4+ packaging>=24.2
5+ setuptools>=77.0.3,<81.0.0
6+ setuptools-scm>=8.0
7+ setuptools-rust>=1.9.0
8+ torch==2.13.0
9+ wheel
10+ jinja2
11+ mlx>=0.31.0,<0.32.0
12+ nanobind==2.10.2
You can’t perform that action at this time.
0 commit comments