Skip to content

musa: build the docker image and CI container from the MUSA SDK images - #29624

Merged
JohannesGaessler merged 4 commits into
ggml-org:masterfrom
yeahdongcn:xd/musa-docker-sdk-split
Sep 29, 2026
Merged

JohannesGaessler merged 4 commits into
ggml-org:masterfrom
yeahdongcn:xd/musa-docker-sdk-split

Conversation

@yeahdongcn

@yeahdongcn yeahdongcn commented Sep 29, 2026 •

Copy link
Copy Markdown
Collaborator

Overview

The MUSA SDK images are published now, so use them instead of the PyTorch image:

  • registry.mthreads.com/mcconline/musa_sdk:5.2.0-devel-ubuntu22.04-s5000 — docker image build stage and MUSA CI container
  • registry.mthreads.com/mcconline/musa_sdk:5.2.0-runtime-ubuntu22.04-s5000 — runtime stage

#29481 based both stages on the PyTorch image because it was the only one available, so the runtime stage pulled in the devel image and the published images carry the MUSA toolchain that only the build stage needs.

The SDK images do not ship everything the PyTorch image provides, so the MUSA backend needs a few packages on top:

  • musa-mualg-5-2 and musa-muthrust-5-2 — the CUB and Thrust headers that ggml-cuda sources include
  • libmthreads-compute — provides libmusa.so.1 in /usr/lib/x86_64-linux-gnu, required for linking and at run time
  • /etc/ld.so.conf.d/musa-runtime.conf — the runtime image does not register /usr/local/musa/lib, where libmusart.so.5 lives

Testing Done

  • CI musa job, which builds inside the new devel container: pass, 16m30s — https://github.com/ggml-org/llama.cpp/actions/runs/36516634750/job/109240484839 (cuda and hip pass as well)
  • Publish Docker image for MUSA only, on a fork test branch, from this branch's Dockerfile: all three images built and pushed — https://github.com/yeahdongcn/llama.cpp/actions/runs/36526644817
  • That image (full, revision c6e3901f0, 12.3 GiB) on an MTT S5000, driver 5.2.0-server, on one leased card, with Qwen3-0.6B-Q4_K_M:
    • inside the image ldconfig -p resolves libmusart.so.5, libmublas.so.1 and libmusa.so.1, and ldd /app/libggml-musa.so reports no missing library
    • llama-bench -ngl 999 -dev MUSA0 -sm none: pp512 8064.34 ± 139.44 t/s, tg128 143.11 ± 0.09 t/s
    • llama-server: /health ok and /v1/chat/completions answers Paris.
    • the run also logs layer 0 is assigned to device MUSA0 but Flash Attention is assigned to device CPU, so these are functional numbers on a single non-exclusive card, not a performance measurement

Additional information

docs/docker.md needs no change: it only refers to the Dockerfile, not to a base image.

Requirements

Use registry.mthreads.com/mcconline/musa_sdk:5.2.0-{devel,runtime}-ubuntu22.04-s5000
instead of registry.mthreads.com/mcconline/inference/pytorch:2.9.1.post1-py3.10-musa5.2.0-mp31-devel-ubuntu22.04-amd64
for the MUSA docker image and the MUSA CI container, and let the runtime stage use the
runtime image instead of reusing the devel one, which drops the MUSA toolchain from the
published images.
@github-actions github-actions Bot added documentation Improvements or additions to documentation devops improvements to build systems and github actions labels Sep 29, 2026
musa_sdk:5.2.0-*-s5000 does not ship the cub and thrust headers that the MUSA
backend builds against, and its runtime image does not register
/usr/local/musa/lib with the dynamic loader.

Install both header packages in the build stage and in the MUSA CI container,
and write the loader path in the runtime stage.
The MUSA SDK images do not install libmthreads-compute, which provides
libmusa.so.1 in /usr/lib/x86_64-linux-gnu, so linking anything against the
MUSA backend fails.
The MUSA runtime image does not install libmthreads-compute, so the published
images would have no libmusa.so.1 at run time.
@yeahdongcn
yeahdongcn marked this pull request as ready for review September 29, 2026 07:04
@yeahdongcn
yeahdongcn requested review from a team, ggerganov and ngxson as code owners September 29, 2026 07:04
@yeahdongcn

Copy link
Copy Markdown
Collaborator Author

Hi @CISC, this PR addresses your comments in #29481. Please take a look when you have a chance. Thanks!

@JohannesGaessler
JohannesGaessler merged commit 18b74ff into ggml-org:master Sep 29, 2026
6 checks passed
edwardyoon pushed a commit to edwardyoon/focus-llama that referenced this pull request Oct 7, 2026
ggml-org#29624)

* musa: build the docker image and CI container from the MUSA SDK images

Use registry.mthreads.com/mcconline/musa_sdk:5.2.0-{devel,runtime}-ubuntu22.04-s5000
instead of registry.mthreads.com/mcconline/inference/pytorch:2.9.1.post1-py3.10-musa5.2.0-mp31-devel-ubuntu22.04-amd64
for the MUSA docker image and the MUSA CI container, and let the runtime stage use the
runtime image instead of reusing the devel one, which drops the MUSA toolchain from the
published images.

* musa: install the MUSA headers and loader path the SDK images omit

musa_sdk:5.2.0-*-s5000 does not ship the cub and thrust headers that the MUSA
backend builds against, and its runtime image does not register
/usr/local/musa/lib with the dynamic loader.

Install both header packages in the build stage and in the MUSA CI container,
and write the loader path in the runtime stage.

* musa: install libmthreads-compute for the MUSA runtime library

The MUSA SDK images do not install libmthreads-compute, which provides
libmusa.so.1 in /usr/lib/x86_64-linux-gnu, so linking anything against the
MUSA backend fails.

* musa: install libmthreads-compute in the runtime stages

The MUSA runtime image does not install libmthreads-compute, so the published
images would have no libmusa.so.1 at run time.

---------

Co-authored-by: yeahdongcn <yeahdongcn@users.noreply.github.com>
(cherry picked from commit 18b74ff)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

devops improvements to build systems and github actions documentation Improvements or additions to documentation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants