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.
- configure mcc_wrapper and Torch-MUSA dependencies from setup.py - use Jammy package names and tolerate third-party diagnostics - skip unsupported Python torch-op registration on MUSA
- include the Torch-MUSA device, allocator, stream, and guard headers - report the native MUSA device type through the platform abstraction
- call the translated MUSA block-copy symbol from the runtime - retain paged-KV host tensors for graph planning
- avoid unsupported aggregate and structured-binding constructions - fix macro expansion, lock types, and source-location compatibility
…usa-python-overlay-20260819
5dad901 to
a4056bc
Compare
…-musa-python-overlay-20260819
Description
After #2179 (
USE_MUSAindependent of CUDA), this PR makes the MUSA tree link and adds compile-only GitHub Actions CI.Layers stay on
layers/common. This does not add a separate MUSA linear/MLP/attention/Qwen3 stack.Kernels (
xllm/core/kernels/musa)Stop compiling CUDA sources that do not build under mcc, and replace them with MUSA implementations:
../cuda/block_copy.cupaged_cache.cu(block_copy)../cuda/norm.curms_norm/fused_add_rms_normingemma_norm.cu../cuda/moe/moe_fused_topk.cumoe_fused_topk.cu../cuda/reshape_paged_cache.cuAlso add
musa_ops_library.cppsoensure_xllm_ops_registeredandkernel::cuda::block_copy(called fromworker_impl.cpp) still link on MUSA.Graph executor
musa_graph_executor_implreads paged-KV host mirrors fromattn_metadata->fa3_metadatainstead of the oldAttentionHostInputfields.CI
Same shape as NPU/CUDA:
cibuild/build_musa.shdoesdocker pullthendocker runagainst a public registry image. Build logic and clang/mcc overlays are versioned in-tree undercibuild/musa*(not only inside the image).xllm-cpu-only-cicdregistry.mthreads.com/presale/devtech/xllm:CICD-build-0813(compiler, vcpkg, third_party snapshot)submodules: recursive(gitcode is unreachable from CI). The in-tree script seedsthird_partyfrom/opt/xllm-third_partyand logs repo gitlinks vscibuild/musa/third_party_seed.txt.cibuild/musa/build.sh(cmake + ninja, nosetup.py). No--runtime=mthreads.This PR touches
.github/cibuild, so the MUSA build job waits for review approval (same sensitive-file rule as NPU). Later code-only PRs pull the image automatically.Related Issues
N/A
Change Type
Pull Request Checklist
Thank you for contributing to xLLM. Before requesting review, please make sure the following items are complete.
PR Title and Commit Messages
<type>: <subject>.Pre-commit Checks
pre-commitby runningpip install pre-commitor an equivalent command.pre-commit install.pre-commit run --all-filesand fixed any reported issues.Self Review
.agents/skills/code-review/references/custom-code-style.md, especially code written or assisted by AI.mainbranch.Build and Test Coverage
python setup.py build testhas passed on a CUDA machine.python setup.py build testhas passed on an NPU machine.python setup.py build testhas passed on an MLU machine.Reviewer Notes
Please review CMake/kernel wiring and the workflow (no recursive submodules). Clang/mcc workarounds are image-local overlays, not common-header changes.