[CI] Build macOS arm64 CPU wheel natively on the macmini queue (#48289)

Signed-off-by: mgoin <mgoin64@gmail.com>
This commit is contained in:
Michael Goin
2026-07-14 19:40:26 +00:00
committed by GitHub
parent 32e632dfeb
commit 0b54201a04
4 changed files with 90 additions and 6 deletions
+43
View File
@@ -76,6 +76,49 @@ steps:
env:
DOCKER_BUILDKIT: "1"
- label: "Build wheel - macOS arm64 - CPU"
depends_on: ~
id: build-wheel-macos-arm64-cpu
agents:
queue: macmini
timeout_in_minutes: 90
commands:
- "bash .buildkite/scripts/build-macos-wheel.sh"
- "mkdir -p artifacts/transfer"
- "basename artifacts/dist/*.whl > artifacts/transfer/wheel.name"
- "shasum -a 256 artifacts/dist/*.whl > artifacts/transfer/wheel.sha256"
- "split -b 1m artifacts/dist/*.whl artifacts/transfer/wheel.part."
env:
BUILDKITE_ARTIFACT_UPLOAD_CONCURRENCY: "1"
BUILDKITE_NO_HTTP2: "true"
artifact_paths:
- "artifacts/transfer/*"
- label: "Upload wheel - macOS arm64 - CPU"
depends_on: build-wheel-macos-arm64-cpu
id: upload-wheel-macos-arm64-cpu
agents:
queue: small_cpu_queue_release
timeout_in_minutes: 15
commands:
- 'buildkite-agent artifact download "artifacts/transfer/*" .'
- "mkdir -p artifacts/dist artifacts/reassembled"
- 'wheel_name=$$(cat artifacts/transfer/wheel.name)'
- '[[ "$$wheel_name" =~ ^[A-Za-z0-9][A-Za-z0-9._+-]*\.whl$$ && "$$wheel_name" != *..* ]]'
- 'expected_sha=$$(awk ''{print $$1}'' artifacts/transfer/wheel.sha256)'
- '[[ "$$expected_sha" =~ ^[0-9a-f]{64}$$ ]]'
- 'cat artifacts/transfer/wheel.part.* > artifacts/reassembled/wheel'
- 'actual_sha=$$(shasum -a 256 artifacts/reassembled/wheel | awk ''{print $$1}'')'
- '[[ "$$actual_sha" == "$$expected_sha" ]]'
- 'mv artifacts/reassembled/wheel "artifacts/dist/$$wheel_name"'
- "aws sts get-caller-identity"
- "VLLM_WHEEL_PLATFORM=macos bash .buildkite/scripts/upload-nightly-wheels.sh"
- 'bash .buildkite/scripts/annotate-build-artifact.sh "$$BUILDKITE_LABEL" "s3://vllm-wheels/$$BUILDKITE_COMMIT/$(cd artifacts/dist && echo *.whl)"'
plugins:
- aws-assume-role-with-web-identity#v1.6.0:
role-arn: arn:aws:iam::936637512419:role/vllm-release-macos-wheel-uploader
region: us-west-2
- label: "Build wheel - x86_64 - CUDA 12.9"
depends_on: ~
id: build-wheel-x86-cuda-12-9
+32
View File
@@ -0,0 +1,32 @@
#!/usr/bin/env bash
# SPDX-License-Identifier: Apache-2.0
# SPDX-FileCopyrightText: Copyright contributors to the vLLM project
#
# Build the macOS arm64 CPU wheel natively on a macOS agent (the `macmini`
# queue) into artifacts/dist/ for upload-nightly-wheels.sh.
set -euo pipefail
# The Rust frontend build needs protoc.
if ! command -v protoc >/dev/null 2>&1; then
brew install protobuf
fi
# upload-nightly-wheels.sh expects exactly one wheel.
rm -rf artifacts/dist
mkdir -p artifacts/dist
export VLLM_TARGET_DEVICE=cpu
export VLLM_REQUIRE_RUST_FRONTEND=1
export MACOSX_DEPLOYMENT_TARGET=11.0
# uv's CPython is universal2; force an arm64-only build and tag so the wheel
# isn't mislabelled universal2 and installed on Intel Macs where import fails.
export ARCHFLAGS="-arch arm64"
export _PYTHON_HOST_PLATFORM="macosx-11.0-arm64"
export CMAKE_BUILD_PARALLEL_LEVEL="${CMAKE_BUILD_PARALLEL_LEVEL:-4}"
uv venv --python 3.12
uv pip install -r requirements/build/cpu.txt --index-strategy unsafe-best-match
uv build --wheel --no-build-isolation -o artifacts/dist
ls -l artifacts/dist/*.whl
+12 -4
View File
@@ -6,8 +6,14 @@ set -ex
# manylinux platform tag with auditwheel.
# Index generation is handled separately by generate-and-upload-nightly-index.sh.
# shellcheck source=lib/manylinux.sh
source .buildkite/scripts/lib/manylinux.sh
# auditwheel is Linux-only; macOS wheels already carry a valid tag, so skip the
# manylinux retag for them.
WHEEL_PLATFORM="${VLLM_WHEEL_PLATFORM:-linux}"
if [[ "$WHEEL_PLATFORM" == "linux" ]]; then
# shellcheck source=lib/manylinux.sh
source .buildkite/scripts/lib/manylinux.sh
fi
BUCKET="vllm-wheels"
SUBPATH=$BUILDKITE_COMMIT
@@ -27,8 +33,10 @@ wheel="${wheel_files[0]}"
# ========= detect manylinux tag and rename ==========
wheel="$(apply_manylinux_tag "$wheel")"
echo "Renamed wheel to: $wheel"
if [[ "$WHEEL_PLATFORM" == "linux" ]]; then
wheel="$(apply_manylinux_tag "$wheel")"
echo "Renamed wheel to: $wheel"
fi
# Extract the version from the wheel
version=$(unzip -p "$wheel" '**/METADATA' | grep '^Version: ' | cut -d' ' -f2)
+3 -2
View File
@@ -570,7 +570,8 @@ TORCH_LIBRARY_EXPAND(TORCH_EXTENSION_NAME, ops) {
#endif
// fused moe
#if defined(__AVX512F__) || (defined(ARM_BF16_SUPPORT))
#if defined(__AVX512F__) || \
(defined(__aarch64__) && !defined(__APPLE__) && defined(ARM_BF16_SUPPORT))
ops.def(
"prepack_moe_weight(Tensor weight, Tensor(a1!) packed_weight, str isa) "
"-> ()");
@@ -581,7 +582,7 @@ TORCH_LIBRARY_EXPAND(TORCH_EXTENSION_NAME, ops) {
"bool skip_weighted, "
"str act, str isa) -> ()");
ops.impl("cpu_fused_moe", torch::kCPU, &cpu_fused_moe);
#endif // #if defined(__AVX512F__) || (defined(ARM_BF16_SUPPORT))
#endif
ops.def(
"mla_decode_kvcache("
" Tensor! out, Tensor query, Tensor kv_cache,"