feat: add MUSA CICD supports. - #2235
Conversation
| timeout-minutes: 5 | ||
| uses: actions/checkout@v4 | ||
| # Intentionally omit submodules: recursive. gitcode is unreachable from CI; | ||
| # the MUSA image seeds third_party from /opt/xllm-third_party. |
There was a problem hiding this comment.
Since third_party is sourced from /opt/xllm-third_party in the image instead of the repository submodules, changes to third_party revisions in the PR won't be reflected in MUSA CI. Could we make the bundled third-party revisions traceable to the xLLM revision being tested?
There was a problem hiding this comment.
Agreed this was a real gap. The runner cannot submodules: recursive because gitcode is unreachable, so CI still seeds third_party from /opt/xllm-third_party in the image. The seed is now stamped in-tree at cibuild/musa/third_party_seed.txt (xLLM 6f702778 / CICD-build-0813), and cibuild/musa/_build_cuda_graph_musa.sh logs git ls-tree gitlinks next to that stamp so a mismatch is visible in the job log. Bumping submodule revisions still requires rebuilding the image; we cannot fetch those repos from this runner.
| timeout-minutes: 180 | ||
| run: | | ||
| chmod +x ./cibuild/build_musa.sh | ||
| bash cibuild/build_musa.sh 'bash /opt/xllm-musa-build/_build_cuda_graph_musa.sh' |
There was a problem hiding this comment.
The actual build script comes from /opt/xllm-musa-build/_build_cuda_graph_musa.sh inside the image, so the build logic is no longer tied to the xLLM commit. Could we put the build commands directly in the workflow instead, so that the build logic is versioned together with the xLLM code?
There was a problem hiding this comment.
Moved the build logic into the xLLM tree. cibuild/build_musa.sh only pulls/runs the image; cibuild/musa/_build_cuda_graph_musa.sh (cmake + ninja, no setup.py), ninja/link wrappers, and clang/mcc overlays under cibuild/musa-compat/ are invoked from the checkout so they version with the commit. The image stays the compiler / vcpkg / third_party snapshot.
5dad901 to
a4056bc
Compare
cdf8891 to
11bdc2b
Compare
Align the MUSA host launcher with the existing NPU build script. Keep only the MUSA runtime, workspace and vcpkg mounts, device/build environment, UID/GID handoff, and image entrypoint. Remove redundant runtime/workspace probes, ccache branching, container-name bookkeeping, and duplicate outer cleanup while preserving vcpkg source isolation and child-shell failure propagation.
The launcher already uses the host IPC namespace, so Docker shm-size does not affect the container. Keep the MUSA-specific memlock limit required by the runtime while matching the NPU launcher more closely.
Remove the single-use error helper and keep the empty-command check as one direct NPU-style guard.
The workflow always passes the fixed MUSA build command, so the launcher only needs to forward it to the image entrypoint.
Let the required docker run invocation report Docker availability and runtime failures directly, matching the minimal NPU launcher flow.
Forward the fixed workflow command directly into the container command instead of storing it in a single-use variable.
Reduce the compile-only launcher to the fixed image and one foreground docker run. Keep only the MUSA runtime, host network required for GitCode access, bounded build parallelism, workspace/cache mounts, ownership handoff, and the image entrypoint.
Remove unused job state, default checkout options, duplicate build conditions and timeouts, and no-op setup commands. Skip the diff checkout for trusted push and manual events while retaining the sensitive-file approval gate, current-head review validation, persistent-runner submodule cleanup, and recursive checkout.
Summary
Add compile-only MUSA CI using the same high-level flow as the existing NPU/MLU jobs:
python setup.py build --device musa.This revision is limited to three focused files. It does not modify the SMHasher submodule or bundle third-party source snapshots.
.github/workflows/build_x86_64_musa.yamlcibuild/build_musa.shthird_party/CMakeLists.txtNPU/MLU alignment
.git/modules; removes stale submodule locks, checks outsubmodules: recursive, and cleans submodule worktrees./export/home/musa_vcpkg_cache:/root/.cache/vcpkg.archivesanddownloadsdirectories on first use; no cache snapshot must be uploaded in advance.Dependency and image contract
VCPKG_ROOT,DEPENDENCES_ROOT, and related source overrides.Validation
Passed:
bash -n cibuild/build_musa.sh.github/workflows/build_x86_64_musa.yamlgit diff --check/export/home/musa_vcpkg_cache/archivesanddownloadsbefore the container startsregistry.mthreads.com/presale/devtech/xllm:musa-cicd-20260820was pushed to Harbor and verified (digestsha256:a03d91ad323026b96fe4dac9145302dd534bbee803d314c485a686f102b05030)python setup.py build --device musacommand was executed with that image; CMake selectedmcc_wrapper, and nonvccwas usedSMHasherSupport(includingSpeedTest.o) with-Wno-registerThe previous full Python build stopped at
third_party/smhasher/src/SpeedTest.cpp:153because the MUSA compiler promoted SMHasher's legacy C++17registerwarning to an error. This is fixed inthird_party/CMakeLists.txtwith a MUSA-only-Wno-registeroption scoped toSMHasherSupport; the incremental full build now reaches and completes the SMHasher library.The same incremental build then exposes separate existing compatibility diagnostics in
xllm/core/util/tensor_helper.h(Torch-MUSA source-location API) and cpprest's-Wunused-valuechecks. Those are outside this focused SMHasher/CI wiring fix and are not masked here.The image entrypoint applies the bundled Mooncake compatibility overlay only to the pinned
dd44a5223a9011cbf37217dcecfe03c3ab01ffdbgitlink and restores the submodule on exit. The MUSA build remains approval-gated for sensitive workflow/launcher changes and will run after a trusted reviewer approves the exact current head.Review focus
Please review the three-file CI contract, especially recursive submodule traceability, the host vcpkg cache mount, the sensitive-input approval gate, and graceful container cleanup.