Skip to content

[Build][Test] Fix icpx (USE_XPU) build and test portability - #5154

Merged
alogfans merged 1 commit into
kvcache-ai:mainfrom
XinyuYe-Intel:fix/icpx-build-test-portability
Nov 5, 2026
Merged

alogfans merged 1 commit into
kvcache-ai:mainfrom
XinyuYe-Intel:fix/icpx-build-test-portability

Conversation

@XinyuYe-Intel

@XinyuYe-Intel XinyuYe-Intel commented Nov 2, 2026 •

Copy link
Copy Markdown
Contributor

Description

A full USE_XPU=ON build with icpx (oneAPI 2026.1) failed to compile two test targets, and seven tests failed for reasons unrelated to XPU. Upstream CI does not catch these: the main CI builds without USE_XPU or TENT, and the TENT CI runs only selected Store tests.

Problem Cause Fix
tent_hp_tcp_transport_test does not compile The bundled asio enables co_await on clang only with the legacy coroutines TS Define ASIO_HAS_CO_AWAIT for clang when it implements C++20 coroutines (__cpp_impl_coroutine)
dfs_posix_test.cpp does not compile clang rejects narrowing int -> uint64_t in braced initializers Explicit casts
default_config_test Resolves its fixture relative to the working directory (assumes <src>/build) Pass the source directory via MOONCAKE_COMMON_TESTS_DIR
tebench_build_tree_help, tent_python_send_probe_test, tent_python_first_buffer_test Clear or replace LD_LIBRARY_PATH, dropping the oneAPI runtime libraries Keep the configure-time path for USE_XPU builds; append the inherited path for the Python tests
transfer_scatter_tent_test (any compiler) Scatter needs a cancellable transport (#3964). Without RDMA, the default TENT config installs only TCP, which is not cancellable, so every fragment fails with NotImplemented Run the test with HP_TCP instead of TCP

The crc32c.h fix that was originally part of this PR landed separately in #5176; this PR is rebased on top of it.

Suggested Merge Priority

  • P0 — Urgent: Critical security vulnerability, data loss/corruption, or widespread production outage requiring immediate action
  • P1 — High: Significant correctness or stability issue in existing functionality, or a regression blocking users without a practical workaround
  • P2 — Normal: Routine bug fix, validated performance/compatibility improvement, or new feature for a confirmed use case
  • P3 — Low: Experimental feature, optional enhancement, refactoring, or cleanup with no urgent user impact

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:

source /opt/intel/oneapi/setvars.sh
cmake -G Ninja -DCMAKE_C_COMPILER=icx -DCMAKE_CXX_COMPILER=icpx -DUSE_XPU=ON \
  -DUSE_TENT=ON -DWITH_STORE=ON -DBUILD_UNIT_TESTS=ON -DCMAKE_BUILD_TYPE=Release ..
ninja && ctest -j

Test results (on 16fb473b; rebased onto 6a345d22 without conflicts):

  • icpx, USE_XPU=ON: all 1089 targets build, and ctest passes 352/355. Without the fix, 2 test targets fail to compile.
  • gcc, without XPU (Store + TENT): all 1074 targets build, and the 8 affected tests pass.

The 3 remaining icpx failures come from the build environment, not from icpx:

  • tent_io_uring_transport_test (8 cases, new in [TENT] Add an opt-in pinned staging pool to the io_uring transport #5012): the pinned staging pool allocates through the XPU platform, which needs a Level Zero GPU, and the builder has none. On a B60 node all 9 staging cases pass.

  • tebench_multinode_script_test (new in [TransferEngine] Add multi-node tebench launcher #4649): checks with kill -0 that a timed-out process is gone. The builder container has no init process, so the zombie is never reaped. It passes in a container started with --init.

  • master_service_test DfsOnlyLifecyclePathsReleaseTheExtent: a timing assertion that fails under parallel ctest load. It passes when run alone.

  • Unit tests pass (see above)

  • Integration tests pass (if applicable)

  • Manual testing done (if applicable)

Checklist

  • I have performed a self-review of my own code
  • I have formatted my code using ./scripts/code_format.sh
  • 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

cmake-format also rewraps some pre-existing lines in two of the touched CMake files (mooncake-store/tests, mooncake-transfer-engine/benchmark). Those lines are not changed by this PR, so I left the rewrites out.

AI Assistance Disclosure

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

GitHub Copilot helped diagnose the build and test failures, write the patch, and run the builds. I reviewed the change and the results.

Copilot AI balanced review requested due to automatic review settings November 2, 2026 06:41
@github-actions github-actions Bot added the size/S 0-99 changed lines (additions + deletions) label Nov 2, 2026

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

No active review issues were identified for the build-compatibility and test-portability changes.

No open issues 🎉

What changed in this PR

This PR improves icpx/USE_XPU build compatibility and test portability across Mooncake’s Common, Store, Transfer Engine, and integration components.

Changes:

  • Guard host-only CRC32C intrinsics during SYCL device compilation, enable Clang C++20 coroutine support in the HP_TCP test, and fix narrowing conversions.
  • Resolve configuration fixtures independently of the build directory and preserve configure-time runtime library paths where needed.
  • Configure the TENT scatter test to use cancellable HP_TCP instead of TCP.
File Description
mooncake-transfer-engine/​tent/​tests/​hp_tcp_transport_test.cpp Enables Asio coroutine templates for Clang with C++20 coroutine support.
mooncake-transfer-engine/​benchmark/​CMakeLists.txt Preserves configure-time library paths for the XPU benchmark help test.
mooncake-store/​tests/​dfs_posix_test.cpp Explicitly casts descriptor offsets to avoid narrowing errors.
mooncake-store/​tests/​CMakeLists.txt Enables HP_TCP and disables TCP for the TENT scatter test.
mooncake-store/​include/​crc32c.h Excludes the SSE4.2 path from SYCL device compilation.
mooncake-integration/​CMakeLists.txt Appends configure-time library paths to two Python tests.
mooncake-common/​tests/​default_config_test.cpp Loads fixtures using the configured source-directory path.
mooncake-common/​tests/​CMakeLists.txt Defines the source-directory path for configuration fixtures.

Review effort: Balanced

A full USE_XPU=ON build with icpx (oneAPI 2026.1) failed to compile two
test targets, and seven tests failed for reasons unrelated to XPU.

Build:
- dfs_posix_test: clang rejects narrowing int -> uint64_t in braced
  initializers; cast explicitly.
- hp_tcp_transport_test: the bundled asio enables ASIO_HAS_CO_AWAIT for
  clang only with the legacy coroutines TS. Define it for clang when the
  compiler implements C++20 coroutines (__cpp_impl_coroutine).

Tests:
- default_config_test resolved its fixture relative to the working
  directory; pass the source directory via MOONCAKE_COMMON_TESTS_DIR.
- tebench_build_tree_help and two Python integration tests cleared or
  replaced LD_LIBRARY_PATH, dropping the oneAPI runtime libraries. Keep
  the configure-time path for USE_XPU builds and append the inherited
  path for the Python tests.
- transfer_scatter_tent_test needs a cancellable transport. Without RDMA
  the default TENT config only installs TCP, which is not cancellable, so
  every fragment failed with NotImplemented on any compiler. Enable
  HP_TCP instead of TCP for that test.

The crc32c.h SYCL device-pass fix originally in this change landed
separately in kvcache-ai#5176; this is rebased on top of it.

@alogfans alogfans 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.

LGTM

@alogfans
alogfans merged commit 681b03c into kvcache-ai:main Nov 5, 2026
32 of 33 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