Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
40 changes: 24 additions & 16 deletions .github/workflows/ci_xpu.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ on:
value: ${{ jobs.build-wheel-xpu.outputs.artifact_id }}
artifact_digest:
value: ${{ jobs.build-wheel-xpu.outputs.artifact_digest }}
artifact_attempt:
value: ${{ jobs.build-wheel-xpu.outputs.artifact_attempt }}
workflow_dispatch:

permissions:
Expand All @@ -36,14 +38,15 @@ jobs:
source_sha: ${{ steps.source.outputs.sha }}
artifact_id: ${{ steps.artifact.outputs.artifact-id }}
artifact_digest: ${{ steps.artifact.outputs.artifact-digest }}
artifact_attempt: ${{ steps.source.outputs.attempt }}
env:
XPU_BUILD: "1"
PYTHON_VERSION: "3.12"
BUILD_DIR: build-xpu-ci
OUTPUT_DIR: dist-xpu-ci
DEBIAN_FRONTEND: noninteractive
SCCACHE_GHA_ENABLED: "true"
# Match the other wheel builders: PRs read shared entries but do not evict them.
SCCACHE_GHA_ENABLED: ${{ inputs.checkout_ref == '' && (github.event_name == 'push' || github.event_name == 'schedule') }}
ENABLE_SCCACHE: ${{ inputs.checkout_ref == '' && (github.event_name == 'push' || github.event_name == 'schedule') && 'ON' || 'OFF' }}
SCCACHE_GHA_RW_MODE: ${{ (github.event_name == 'push' || github.event_name == 'schedule') && 'READ_WRITE' || 'READ_ONLY' }}
steps:
# As in ROCm CI, git must exist before checkout to avoid a source tarball.
Expand All @@ -64,6 +67,7 @@ jobs:
run: |
git config --global --add safe.directory "$GITHUB_WORKSPACE"
echo "sha=$(git rev-parse HEAD)" >> "$GITHUB_OUTPUT"
echo "attempt=$GITHUB_RUN_ATTEMPT" >> "$GITHUB_OUTPUT"

- name: Install toolchain and dependencies
run: |
Expand All @@ -84,6 +88,7 @@ jobs:
"$RUNNER_TEMP/xpu-build-env/bin/python" -m pip install numpy==2.5.4

- name: Set up compiler cache
if: inputs.checkout_ref == '' && (github.event_name == 'push' || github.event_name == 'schedule')
uses: ./.github/actions/setup-sccache

- name: Configure and build project
Expand All @@ -103,7 +108,7 @@ jobs:
cmake -G Ninja -S . -B "$BUILD_DIR" \
-DCMAKE_C_COMPILER=icx -DCMAKE_CXX_COMPILER=icpx \
-DPython3_EXECUTABLE="$(command -v python)" \
-DCMAKE_BUILD_TYPE=Release -DENABLE_DEBUG_SYMBOLS=OFF -DENABLE_SCCACHE=ON \
-DCMAKE_BUILD_TYPE=Release -DENABLE_DEBUG_SYMBOLS=OFF -DENABLE_SCCACHE="$ENABLE_SCCACHE" \
-DUSE_XPU=ON -DUSE_TENT=ON -DUSE_CUDA=OFF -DUSE_XPU_GDS=OFF \
-DWITH_EP=ON -DMOONCAKE_EP_XPU_AOT_DEVICES=bmg \
-DWITH_STORE=ON -DWITH_STORE_RUST=OFF -DWITH_STORE_RS=OFF \
Expand Down Expand Up @@ -132,18 +137,10 @@ jobs:
--gtest_output=xml:xpu-ci-output/reports/ep.xml
"$BUILD_DIR/mooncake-store/tests/crc32c_test" \
--gtest_output=xml:xpu-ci-output/reports/crc32c.xml
python - <<'PY'
import xml.etree.ElementTree as ET
for name in ("config", "ep", "crc32c"):
cases = ET.parse(f"xpu-ci-output/reports/{name}.xml").findall(".//testcase")
if not cases:
raise RuntimeError(f"{name}: no tests executed")
for case in cases:
if (case.get("status"), case.get("result")) != ("run", "completed") or any(
case.find(tag) is not None for tag in ("failure", "error", "skipped")
):
raise RuntimeError(f"{name}: test did not pass: {case.attrib}")
PY
python scripts/e2e/python/verify_xpu_ci.py reports \
xpu-ci-output/reports/config.xml \
xpu-ci-output/reports/ep.xml \
xpu-ci-output/reports/crc32c.xml

- name: Apply wheel version override
if: inputs.version_override != ''
Expand Down Expand Up @@ -174,7 +171,17 @@ jobs:
"$smoke_venv/bin/python" -m pip install xpu-ci-output/*.whl
# Do not expose build libraries or the source package to the check.
cd "$RUNNER_TEMP"
"$smoke_venv/bin/python" "$GITHUB_WORKSPACE/scripts/e2e/python/verify_xpu_wheel.py"
"$smoke_venv/bin/python" "$GITHUB_WORKSPACE/scripts/e2e/python/verify_xpu_ci.py"

- name: Package Python dependencies for hardware
run: |
set -euo pipefail
out=xpu-ci-output/python-deps
mkdir -p "$out"
for wheel in xpu-ci-output/*.whl; do
python -m pip download --only-binary=:all: --dest "$out" "$wheel"
rm "$out/$(basename "$wheel")"
done

- name: Package native tests
run: |
Expand All @@ -184,6 +191,7 @@ jobs:
export LD_LIBRARY_PATH="$library_dirs:${LD_LIBRARY_PATH:-}"
out=xpu-ci-output/native-tests
mkdir -p "$out/lib"
cp -R xpu-ci-output/python-deps "$out/"
cp xpu-ci-output/provenance.txt "$out/"
for binary in \
"$BUILD_DIR"/mooncake-transfer-engine/tent/tests/tent_xpu_{platform,transport,engine,ipc_process}_test \
Expand Down
25 changes: 25 additions & 0 deletions .github/workflows/e2e-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,29 @@ concurrency:
cancel-in-progress: true

jobs:
build-wheel-xpu:
if: >
github.event_name == 'workflow_dispatch' ||
github.event.label.name == 'run-e2e-ci'
permissions:
contents: read
uses: ./.github/workflows/ci_xpu.yml
with:
checkout_ref: ${{ inputs.pr_sha || github.event.pull_request.head.sha || github.sha }}
Comment thread
VincyZhang marked this conversation as resolved.
Resolved

xpu-integration-test:
needs: build-wheel-xpu
permissions:
contents: read
actions: read
uses: ./.github/workflows/integration-test-xpu.yml
with:
checkout_sha: ${{ inputs.pr_sha || github.event.pull_request.head.sha || github.sha }}
source_sha: ${{ needs.build-wheel-xpu.outputs.source_sha }}
artifact_id: ${{ needs.build-wheel-xpu.outputs.artifact_id }}
artifact_digest: ${{ needs.build-wheel-xpu.outputs.artifact_digest }}
artifact_attempt: ${{ needs.build-wheel-xpu.outputs.artifact_attempt }}

ascend-test:
if: >
github.event_name == 'workflow_dispatch' ||
Expand Down Expand Up @@ -93,6 +116,8 @@ jobs:
- integration-test
- rocm-integration-test
- integration-test-tent
- build-wheel-xpu
- xpu-integration-test
runs-on: ubuntu-latest
steps:
- name: Check E2E results
Expand Down
104 changes: 104 additions & 0 deletions .github/workflows/integration-test-xpu.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,104 @@
name: Integration test (XPU core)

on:
workflow_call:
inputs:
checkout_sha:
type: string
required: true
source_sha:
type: string
required: true
artifact_id:
type: string
required: true
artifact_digest:
type: string
required: true
artifact_attempt:
type: string
required: true

permissions:
contents: read
actions: read

jobs:
core:
runs-on: xpu
timeout-minutes: 90
env:
XPU_IMAGE: intel/pytorch:xpu-2.13.0-ubuntu24.04-20260907@sha256:7366f264bd7aaa7f0df7d1bfba43be7c84c126df21ba448ae5445a34c2def4f9
steps:
- name: Check out trusted harness
uses: actions/checkout@v4
with:
ref: ${{ github.workflow_sha }}
path: xpu-control
persist-credentials: false

- name: Allocate run directory
id: run
shell: bash
run: |
set -euo pipefail
directory=$(mktemp -d "$RUNNER_TEMP/xpu-core.XXXXXX")
echo "directory=$directory" >> "$GITHUB_OUTPUT"

- name: Download exact build artifact
shell: bash
env:
GH_TOKEN: ${{ github.token }}
ARTIFACT_ID: ${{ inputs.artifact_id }}
ARTIFACT_DIGEST: ${{ inputs.artifact_digest }}
XPU_BUILD_ATTEMPT: ${{ inputs.artifact_attempt }}
SOURCE_SHA: ${{ inputs.source_sha }}
CHECKOUT_SHA: ${{ inputs.checkout_sha }}
RUN_DIRECTORY: ${{ steps.run.outputs.directory }}
run: |
set -euo pipefail
[[ "$ARTIFACT_ID" =~ ^[0-9]+$ ]] || { echo "::error::Invalid artifact ID"; exit 1; }
[[ "$CHECKOUT_SHA" =~ ^[0-9a-f]{40}$ ]] || { echo "::error::Invalid checkout SHA"; exit 1; }
[ "$SOURCE_SHA" = "$CHECKOUT_SHA" ] || { echo "::error::Build SHA differs from requested SHA"; exit 1; }
gh api "repos/$GITHUB_REPOSITORY/actions/artifacts/$ARTIFACT_ID" > "$RUN_DIRECTORY/artifact.json"
gh api "repos/$GITHUB_REPOSITORY/actions/artifacts/$ARTIFACT_ID/zip" > "$RUN_DIRECTORY/artifact.zip"
python3 xpu-control/scripts/e2e/python/verify_xpu_ci.py unpack \
"$RUN_DIRECTORY" "$CHECKOUT_SHA" "$ARTIFACT_ID" "$ARTIFACT_DIGEST"

- name: Check out test source
uses: actions/checkout@v4
with:
ref: ${{ inputs.checkout_sha }}
path: xpu-tested-source
persist-credentials: false

- name: Execute isolated two-B60 core
shell: bash
env:
RUN_DIRECTORY: ${{ steps.run.outputs.directory }}
CHECKOUT_SHA: ${{ inputs.checkout_sha }}
run: |
bash xpu-control/scripts/xpu/run_core.sh run

- name: Recheck current-run container cleanup
if: always() && steps.run.outputs.directory != ''
shell: bash
env:
RUN_DIRECTORY: ${{ steps.run.outputs.directory }}
run: |
bash xpu-control/scripts/xpu/run_core.sh cleanup

- name: Preserve hardware diagnostics
if: always() && steps.run.outputs.directory != ''
uses: actions/upload-artifact@v4
with:
name: xpu-core-${{ inputs.checkout_sha }}-${{ github.run_id }}-${{ github.run_attempt }}
path: |
${{ steps.run.outputs.directory }}/output/*.json
${{ steps.run.outputs.directory }}/output/*.xml
${{ steps.run.outputs.directory }}/output/*.log
${{ steps.run.outputs.directory }}/output/*.list
${{ steps.run.outputs.directory }}/output/*.ldd
${{ steps.run.outputs.directory }}/artifact.json
if-no-files-found: error
retention-days: 14
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ repos:
hooks:
- id: codespell
exclude: '^(extern/|FAST25-release/)'
args: ['--ignore-words-list=te,mooncake,KVCache,cann,hsa,crate,coo']
args: ['--ignore-words-list=te,mooncake,KVCache,cann,hsa,crate,coo,renderd']

- repo: https://github.com/cheshirekow/cmake-format-precommit
rev: v0.6.13
Expand Down
Loading
Loading