From f4e9bb01de39dda517c8555640696bd9a9758be2 Mon Sep 17 00:00:00 2001 From: Kunshang Ji Date: Wed, 12 Aug 2026 11:45:06 +0800 Subject: [PATCH] [CI/Release][1/N][XPU] Publish XPU Triton shim index (#51759) Signed-off-by: Kunshang Ji Co-authored-by: GitHub Copilot --- .buildkite/release-pipeline.yaml | 8 ++ .buildkite/scripts/xpu/publish-triton-shim.sh | 87 +++++++++++++++++++ 2 files changed, 95 insertions(+) create mode 100644 .buildkite/scripts/xpu/publish-triton-shim.sh diff --git a/.buildkite/release-pipeline.yaml b/.buildkite/release-pipeline.yaml index 6b97bc57da..4c7186e247 100644 --- a/.buildkite/release-pipeline.yaml +++ b/.buildkite/release-pipeline.yaml @@ -164,6 +164,14 @@ steps: env: DOCKER_BUILDKIT: "1" + - label: "Publish XPU Triton shim index" + key: publish-xpu-triton-shim + depends_on: ~ + agents: + queue: cpu_queue_release + commands: + - "bash .buildkite/scripts/xpu/publish-triton-shim.sh" + - label: "Generate and upload wheel indices" key: generate-wheel-indices depends_on: "build-wheels" diff --git a/.buildkite/scripts/xpu/publish-triton-shim.sh b/.buildkite/scripts/xpu/publish-triton-shim.sh new file mode 100644 index 0000000000..6124e9ae93 --- /dev/null +++ b/.buildkite/scripts/xpu/publish-triton-shim.sh @@ -0,0 +1,87 @@ +#!/usr/bin/env bash +# SPDX-License-Identifier: Apache-2.0 +# SPDX-FileCopyrightText: Copyright contributors to the vLLM project + +set -euo pipefail + +readonly BUCKET="vllm-wheels" +readonly PREFIX="xpu" +readonly WHEEL_URL="https://github.com/intel/intel-xpu-backend-for-triton/releases/download/v3.7.2/triton-3.7.2+xpu-py3-none-any.whl" +readonly WHEEL_SHA256="3c822f73e9870512f59a6ecf5dc305a4bcab11fa623f9ce91011f604315227e9" +readonly WHEEL_FILENAME="${WHEEL_URL##*/}" +readonly ENCODED_WHEEL_FILENAME="${WHEEL_FILENAME/+/%2B}" +readonly S3_PREFIX="s3://${BUCKET}/${PREFIX}/" +readonly DRY_RUN="${DRY_RUN:-0}" + +if [[ "$DRY_RUN" != "0" && "$DRY_RUN" != "1" ]]; then + echo "DRY_RUN must be 0 or 1" >&2 + exit 2 +fi + +cd "$(dirname "${BASH_SOURCE[0]}")/../../.." + +work_dir=$(mktemp -d) +trap 'rm -rf "$work_dir"' EXIT + +wheel_path="$work_dir/$WHEEL_FILENAME" +objects_path="$work_dir/objects.json" +index_output_dir="$work_dir/$PREFIX" +index_generator="$work_dir/generate-nightly-index.py" + +curl --fail --location --retry 3 --output "$wheel_path" "$WHEEL_URL" + +if command -v sha256sum >/dev/null 2>&1; then + actual_sha=$(sha256sum "$wheel_path") +else + actual_sha=$(shasum -a 256 "$wheel_path") +fi +actual_sha=${actual_sha%% *} +if [[ "$actual_sha" != "$WHEEL_SHA256" ]]; then + echo "SHA256 mismatch for $WHEEL_FILENAME" >&2 + echo "Expected: $WHEEL_SHA256" >&2 + echo "Actual: $actual_sha" >&2 + exit 1 +fi + +if [[ "$DRY_RUN" == "1" ]]; then + printf '{"Contents":[{"Key":"%s/%s"}]}' \ + "$PREFIX" "$WHEEL_FILENAME" > "$objects_path" +else + aws s3 cp "$wheel_path" "$S3_PREFIX" + aws s3api list-objects-v2 \ + --bucket "$BUCKET" \ + --prefix "$PREFIX/" \ + --delimiter / \ + --output json > "$objects_path" +fi + +# Pick Python >= 3.12 locally or use the container fallback. +# shellcheck source=../lib/select-python.sh +source .buildkite/scripts/lib/select-python.sh +select_python + +# The index generator only needs stdlib re here. Keep the tracked source intact. +sed 's/import regex as re/import re/' \ + .buildkite/scripts/generate-nightly-index.py > "$index_generator" + +# shellcheck disable=SC2086 +$PYTHON "$index_generator" \ + --version "$PREFIX" \ + --wheel-dir "$PREFIX" \ + --current-objects "$objects_path" \ + --output-dir "$index_output_dir" \ + --comment "XPU Triton shim" + +grep -Fq 'href="triton/"' "$index_output_dir/index.html" +grep -Fq "href=\"../$ENCODED_WHEEL_FILENAME\"" \ + "$index_output_dir/triton/index.html" +grep -Fq "\"filename\": \"$WHEEL_FILENAME\"" \ + "$index_output_dir/triton/metadata.json" + +if [[ "$DRY_RUN" == "1" ]]; then + echo "Dry run succeeded; generated files:" + find "$index_output_dir" -type f -print | sort +else + aws s3 cp --recursive "$index_output_dir/" "$S3_PREFIX" + echo "Published XPU Triton shim index to https://wheels.vllm.ai/$PREFIX/" +fi \ No newline at end of file