Skip to content

[CI/Build] Enable hosted XPU CI Stage 1 - #5078

Merged
stmatengss merged 7 commits into
kvcache-ai:mainfrom
VincyZhang:ci/xpu-stage-1
Nov 11, 2026
Merged

stmatengss merged 7 commits into
kvcache-ai:mainfrom
VincyZhang:ci/xpu-stage-1

Conversation

@VincyZhang

@VincyZhang VincyZhang commented Oct 29, 2026 •

Copy link
Copy Markdown
Contributor

Description

Implement Stage 1 (hosted build and packaging) of RFC #5036:
#5036

  • Add a reusable XPU wheel builder using an Ubuntu 24.04 hosted CPU runner and a pinned Intel PyTorch job container, following the existing ROCm container-job pattern. Install oneAPI DPC++ 2026.1 and build with CPython 3.12.
  • Build XPU/TENT, Store and native EP, and produce the distinct mooncake-transfer-engine-xpu distribution using the existing wheel builder. The Python import remains mooncake.
  • Expose native XPU/TENT capability flags and guard the x86 CRC32C intrinsic path from SYCL device compilation.
  • Run 30 existing host-side C++ cases (19 configuration lifecycle, 6 EP dispatch slots and 5 CRC32C), requiring exact counts and rejecting failed, disabled or skipped cases.
  • Verify a clean wheel installation outside the source tree, including RECORD hashes, native imports/capabilities, Store facade selection, and packaged master startup.
  • Compile and package four XPU TENT test executables plus pybind_client_test, dependency/test inventories, hashes and source/toolchain provenance for a later hardware consumer. Only enumerate their tests; do not execute GPU test bodies.
  • Wire the builder into path-selected PR/main CI and nightly with required gates and nightly version stamping.
  • Preserve the build tree with FREE_BUILD_DIR=0, so auditwheel can resolve libtent_metrics.so and the later native-artifact step still has its inputs. Keep existing cleanup defaults for other callers.
  • Add CPU-only regression tests for CI gates, reports, wheel validation, cleanup and native packaging.

Scope: This is host-only, artifact-only validation. It does not add XPU hardware runners, GPU execution, RDMA/GDS/multi-node coverage, vLLM E2E, release-workflow integration, or PyPI/TestPyPI publication. Hardware core coverage and expanded nightly/release readiness remain Stages 2 and 3 of the RFC.

Related work: The fork-only validation PR VincyZhang#1 temporarily disables unrelated CI to exercise the same XPU builder. This upstream PR retains normal Linux/macOS CI and does not include that isolation change. Existing XPU runtime/transport PRs, including #3935 and #4881, cover runtime functionality rather than this hosted packaging pipeline.

Suggested Merge Priority

Module

  • Transfer Engine (mooncake-transfer-engine)
  • Mooncake Store (mooncake-store)
  • Mooncake Conductor (mooncake-conductor)
  • Reshard (mooncake-reshard)
  • Mooncake EP (mooncake-ep)
  • Mooncake PG (mooncake-pg)
  • Integration (mooncake-integration)
  • P2P Store (mooncake-p2p-store)
  • Python Wheel (mooncake-wheel)
  • Common (mooncake-common)
  • Mooncake RL (mooncake-rl)
  • CI/CD
  • Docs
  • Other

Type of Change

  • Bug fix
  • New feature
  • Refactor
  • Breaking change
  • Documentation update
  • Performance improvement
  • Other

How Has This Been Tested?

Test commands:

python -m unittest discover -s scripts/ci/tests -v
bash -n scripts/build_wheel.sh
go run github.com/rhysd/actionlint/cmd/actionlint@v1.7.11 -shellcheck= \
  .github/workflows/ci.yml .github/workflows/ci_xpu.yml .github/workflows/nightly.yml
pre-commit run --files $(git diff --name-only --diff-filter=ACMR upstream/main...HEAD)
git diff upstream/main...HEAD --check

Test results:

  • Unit tests pass: 49 CI helper tests, including all 16 XPU CI regression tests.
  • Integration tests pass (if applicable): GPU/hardware integration is intentionally not executed in Stage 1.
  • Manual testing done (describe below).

Hosted end-to-end validation of the identical reusable XPU workflow, wheel builder, wheel verifier and XPU regression-test implementation passed in the fork:
https://github.com/VincyZhang/Mooncake/actions/runs/40897415848

That run built and repaired the wheel, passed all 30 host cases and the clean-install smoke check, packaged native tests and uploaded artifacts. Downloaded wheel/archive SHA256 checks and all 60 native-bundle file checks passed. Its source is fork PR merge commit 4a2b58670be1fe5278a15eaf538bff7a45b70306, which contains fix 629cf3ecc88c6245ee4724da60764e173f8c0bb2; it is not a hosted run of this upstream PR's exact SHA. Normal CI/nightly wiring is covered locally; upstream PR checks are pending.

Pre-commit, actionlint, Bash syntax and diff-whitespace checks pass. The C++ formatting hook passed on PR-changed line ranges. A non-mutating merge check against current upstream main also passed.

Checklist

  • I have performed a self-review of my own code
  • I have formatted my code using ./scripts/code_format.sh (via the repository's pre-commit C++ formatting hook)
  • I have run pre-commit on the files changed in this PR and all hooks pass
  • I have updated the documentation (if applicable)
  • I have added tests to prove my changes are effective
  • For changes >500 LOC: I have filed an RFC issue — [RFC]: Intel XPU CI Coverage and Resource Allocation Proposal #5036

Draft pending human submitter review of every changed line. The self-review checkbox is intentionally left unchecked; automated review does not substitute for the required human review. Rollout scope and limitations are recorded above and in the RFC; no new standalone XPU README is included.

AI Assistance Disclosure

  • No AI tools were used
  • AI tools were used (specify below)

Copilot assisted with implementation, debugging, test execution and PR preparation. The human submitter remains responsible for reviewing, understanding and defending all changes.

@github-actions github-actions Bot added the size/M 100-1000 changed lines (additions + deletions) label Oct 29, 2026
@VincyZhang
VincyZhang marked this pull request as ready for review October 29, 2026 16:09
Copilot AI balanced review requested due to automatic review settings October 29, 2026 16:09

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Approval recommended

The hosted CPU-only XPU build and packaging changes have no active review issues.

No open issues 🎉

What changed in this PR

Implements the hosted, CPU-only build and packaging stage of RFC #5036, adding XPU validation alongside existing CI. GPU execution and package publication remain out of scope.

Changes:

  • Adds a reusable XPU wheel builder with path-selected PR/main CI, nightly version stamping, and required gates.
  • Validates 30 host-side C++ cases and clean wheel installation, then packages native tests with inventories, hashes, and provenance for later hardware testing.
  • Adds XPU packaging support, native capability flags, a SYCL compilation guard, and CPU-only regression tests.
File Description
scripts/​e2e/​python/​verify_xpu_wheel.py Checks installed wheel integrity, native capabilities, Store selection, and master startup.
scripts/​ci/​tests/​test_xpu_ci.py Adds regression coverage for gates, reports, cleanup, wheel checks, and native packaging.
scripts/​build_wheel.sh Adds the XPU distribution variant and an explicit build-directory preservation option.
python/​mooncake/​engine.pyi Declares XPU and TENT capability flags.
mooncake-wheel/​pyproject.toml Updates the metadata-maintenance comment to include ROCm and XPU variants.
mooncake-store/​include/​crc32c.h Excludes x86 CRC32C intrinsics from SYCL device compilation.
mooncake-integration/​transfer_engine/​transfer_engine_py.cpp Exposes native XPU and TENT capability flags.
.gitignore Ignores XPU CI build and output directories.
.github/​workflows/​nightly.yml Adds the version-stamped XPU build to the nightly gate without publication.
.github/​workflows/​ci.yml Adds XPU path selection, reusable workflow invocation, and strict result gating.
.github/​workflows/​ci_xpu.yml Defines hosted XPU builds, host tests, wheel validation, and artifact packaging.

Review effort: Balanced

Add a reusable CPU-only XPU builder, dedicated wheel identity, strict host test and clean installation checks, and SHA-bound native test artifacts. Wire PR/main and nightly gates without enabling hardware jobs or publication.

Keep x86 CRC32C feature detection out of the SYCL device pass and document the three-stage rollout from RFC kvcache-ai#5036.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Signed-off-by: VincyZhang <wenxin.zhang@intel.com>

@Aionw Aionw left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for splitting this out as Stage 1. The hosted builder looks sound, and CI is green (build-wheel-xpu at ~18.5 min, off the critical path). I checked the __SYCL_DEVICE_ONLY__ guard in crc32c.h, the FREE_BUILD_DIR=0 semantics (defaults unchanged for other callers), and the auditwheel excludes for the SYCL/Level Zero runtimes. All three look fine.

My main concerns are maintainability. The path selection duplicates src, the host-test counts are hardcoded, and the regression tests are tightly coupled to the text of the scripts they test. Details are inline.

Comment thread .github/workflows/ci.yml Resolved
Comment thread .github/workflows/ci_xpu.yml Resolved
Comment thread .github/workflows/ci_xpu.yml Resolved
Comment thread scripts/ci/tests/test_xpu_ci.py Resolved
Comment thread scripts/ci/tests/test_xpu_ci.py Resolved
Comment thread .github/workflows/ci_xpu.yml Resolved
Allow FREE_BUILD_DIR=0 to override automatic CI build-tree cleanup and use it in the XPU wheel step. Keep shared dependencies available to auditwheel and native binaries available to the following artifact step. Add regression coverage for CI and local cleanup defaults.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Signed-off-by: VincyZhang <wenxin.zhang@intel.com>
(cherry picked from commit 629cf3e)
@VincyZhang

Copy link
Copy Markdown
Contributor Author

The latest CI failure is irrelevant to this PR code changes, seems introduced by #5064 and #5038

Reuse the shared source selector and CI gate, enable compiler caching with memory-aware parallelism, and remove fixed host-test counts. Make cleanup directly testable and improve diagnostic uploads and dependency reproducibility.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Signed-off-by: VincyZhang <wenxin.zhang@intel.com>
Signed-off-by: VincyZhang <wenxin.zhang@intel.com>
VincyZhang and others added 3 commits November 4, 2026 14:08
Resolve the CRC32C SYCL guard conflict using the upstream implementation.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Signed-off-by: VincyZhang <wenxin.zhang@intel.com>
Signed-off-by: VincyZhang <wenxin.zhang@intel.com>

# Conflicts:
#	scripts/build_wheel.sh
Signed-off-by: VincyZhang <wenxin.zhang@intel.com>
@stmatengss
stmatengss merged commit d6a738d into kvcache-ai:main Nov 11, 2026
68 of 70 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants