[CI] Build macOS arm64 CPU wheel natively on the macmini queue (#48289)
Signed-off-by: mgoin <mgoin64@gmail.com>
This commit is contained in:
@@ -76,6 +76,49 @@ steps:
|
|||||||
env:
|
env:
|
||||||
DOCKER_BUILDKIT: "1"
|
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"
|
- label: "Build wheel - x86_64 - CUDA 12.9"
|
||||||
depends_on: ~
|
depends_on: ~
|
||||||
id: build-wheel-x86-cuda-12-9
|
id: build-wheel-x86-cuda-12-9
|
||||||
|
|||||||
Executable
+32
@@ -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
|
||||||
@@ -6,8 +6,14 @@ set -ex
|
|||||||
# manylinux platform tag with auditwheel.
|
# manylinux platform tag with auditwheel.
|
||||||
# Index generation is handled separately by generate-and-upload-nightly-index.sh.
|
# Index generation is handled separately by generate-and-upload-nightly-index.sh.
|
||||||
|
|
||||||
# shellcheck source=lib/manylinux.sh
|
# auditwheel is Linux-only; macOS wheels already carry a valid tag, so skip the
|
||||||
source .buildkite/scripts/lib/manylinux.sh
|
# 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"
|
BUCKET="vllm-wheels"
|
||||||
SUBPATH=$BUILDKITE_COMMIT
|
SUBPATH=$BUILDKITE_COMMIT
|
||||||
@@ -27,8 +33,10 @@ wheel="${wheel_files[0]}"
|
|||||||
|
|
||||||
# ========= detect manylinux tag and rename ==========
|
# ========= detect manylinux tag and rename ==========
|
||||||
|
|
||||||
wheel="$(apply_manylinux_tag "$wheel")"
|
if [[ "$WHEEL_PLATFORM" == "linux" ]]; then
|
||||||
echo "Renamed wheel to: $wheel"
|
wheel="$(apply_manylinux_tag "$wheel")"
|
||||||
|
echo "Renamed wheel to: $wheel"
|
||||||
|
fi
|
||||||
|
|
||||||
# Extract the version from the wheel
|
# Extract the version from the wheel
|
||||||
version=$(unzip -p "$wheel" '**/METADATA' | grep '^Version: ' | cut -d' ' -f2)
|
version=$(unzip -p "$wheel" '**/METADATA' | grep '^Version: ' | cut -d' ' -f2)
|
||||||
|
|||||||
@@ -570,7 +570,8 @@ TORCH_LIBRARY_EXPAND(TORCH_EXTENSION_NAME, ops) {
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
// fused moe
|
// fused moe
|
||||||
#if defined(__AVX512F__) || (defined(ARM_BF16_SUPPORT))
|
#if defined(__AVX512F__) || \
|
||||||
|
(defined(__aarch64__) && !defined(__APPLE__) && defined(ARM_BF16_SUPPORT))
|
||||||
ops.def(
|
ops.def(
|
||||||
"prepack_moe_weight(Tensor weight, Tensor(a1!) packed_weight, str isa) "
|
"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, "
|
"bool skip_weighted, "
|
||||||
"str act, str isa) -> ()");
|
"str act, str isa) -> ()");
|
||||||
ops.impl("cpu_fused_moe", torch::kCPU, &cpu_fused_moe);
|
ops.impl("cpu_fused_moe", torch::kCPU, &cpu_fused_moe);
|
||||||
#endif // #if defined(__AVX512F__) || (defined(ARM_BF16_SUPPORT))
|
#endif
|
||||||
ops.def(
|
ops.def(
|
||||||
"mla_decode_kvcache("
|
"mla_decode_kvcache("
|
||||||
" Tensor! out, Tensor query, Tensor kv_cache,"
|
" Tensor! out, Tensor query, Tensor kv_cache,"
|
||||||
|
|||||||
Reference in New Issue
Block a user