[ROCm][AMD][Installation] Add mooncake build to rocm base image - #52650
Merged
AndreasKaratzas merged 5 commits intoSep 2, 2026
Merged
Conversation
Signed-off-by: Giuseppe Grossi <ggrossi@amd.com>
Signed-off-by: Andreas Karatzas <akaratza@amd.com>
Signed-off-by: Andreas Karatzas <akaratza@amd.com>
Signed-off-by: Andreas Karatzas <akaratza@amd.com>
giuseppegrossi
marked this pull request as ready for review
August 26, 2026 18:08
giuseppegrossi
requested review from
AndreasKaratzas,
Harry-Chen,
dllehr-amd,
khluu and
tjtanaa
as code owners
August 26, 2026 18:08
1 task
Member
|
/amd-ci run nightly |
|
✅ Triggered Buildkite AMD CI #12535 for commit |
Member
|
/ci run |
|
✅ Triggered Buildkite CI #86737 for commit |
AndreasKaratzas
approved these changes
Sep 2, 2026
mylibrar
pushed a commit
to tanyuqian/vllm
that referenced
this pull request
Sep 3, 2026
…-project#52650) Signed-off-by: Giuseppe Grossi <ggrossi@amd.com> Signed-off-by: Andreas Karatzas <akaratza@amd.com> Co-authored-by: Andreas Karatzas <akaratza@amd.com>
sheralskumar
pushed a commit
to sheralskumar/vllm
that referenced
this pull request
Sep 8, 2026
…-project#52650) Signed-off-by: Giuseppe Grossi <ggrossi@amd.com> Signed-off-by: Andreas Karatzas <akaratza@amd.com> Co-authored-by: Andreas Karatzas <akaratza@amd.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Purpose
Add AMD ROCm support for Mooncake to the vLLM ROCm build so the
MooncakeConnectorandMooncakeStoreConnectorKV-transfer connectors are usable out of the box on ROCm images. Addresses issue #51193.Related is the addition of LMCache in #51208 and follows the existing in-image "build the wheel from source" pattern already used for aiter, MoRI, and FlashAttention. It is a short-term solution: once Mooncake publishes an official ROCm wheel, this stage can be replaced.
What this does
Build follows Mooncake's own wheel-publishing recipe
The stage deliberately reuses Mooncake's upstream ROCm wheel-publishing path rather than inventing our own packaging:
dependencies.sh— the project's own dependency bootstrapper.HIP_BUILD=1 ... scripts/build_wheel.sh— the exact script/flag Mooncake uses to emit a ROCm wheel (namedmooncake_transfer_engine_rocm).Tracking upstream's recipe means our wheel behaves like the one they will eventually publish, and the eventual migration to an official wheel is a straight swap.
Why the commit pin (not a tag)
ROCm wheel support was merged in kvcache-ai/Mooncake#3184 but has not been released. On every published tag,
HIP_BUILD=1is an unrecognized no-op and the build silently produces the CUDA-namedmooncake_transfer_enginepackage instead. We therefore pin the merge commitdf508641d76be20803349bf715d3bfc5205a7b58(viagit clone+git checkout, since--branchwon't take a SHA) to get the ROCm package. Revisit and move to a tag once a release includes #3184.Why we use the bundled
dependencies.shUsing Mooncake's own
dependencies.shinstead of a hand-maintainedapt installlist means:The one downside is that it installs Ubuntu 22.04's old patchelf, which we override immediately afterward (below).
Why we install a newer patchelf
dependencies.shpulls in patchelf 0.14.3 (Ubuntu 22.04), which has a bug that corruptsRPATHentries whenauditwheel repairrewrites them — it writes vendored library filenames into the RPATH instead of$ORIGIN-relative search paths. The failure is silent and dangerous:cmake --installalso scatters the libraries into/usr/local/libwhere they're found by accident.ImportError: lib...: cannot open shared object file.Installing
patchelf>=0.17afterdependencies.shfixes the RPATH to the correct$ORIGIN-based form, matching Mooncake's published wheels. (Upstream's ROCm CI wouldn't catch this — their smoke test only runsmooncake_master --versionand never imports the Python module.)Other notes
PLATFORM_TAG=auto: the base image's gcc-13 libstdc++ emitsGLIBCXX_3.4.32, which themanylinux_2_35policy the script would otherwise pick rejects.autolets auditwheel select a compatible policy; the wheel ends up dual-taggedmanylinux_2_35_x86_64.manylinux_2_39_x86_64and installs cleanly on our glibc 2.35 image.gfxdevice kernels, soPYTORCH_ROCM_ARCHdoes not affect it. Exactly one portable wheel is produced regardless of the arch list.Test plan
Build Image
docker build -f docker/Dockerfile.rocm --target vllm-openai \ --build-arg BASE_IMAGE=rocm/vllm-dev:base \ --build-arg ARG_PYTORCH_ROCM_ARCH=gfx950 \ --build-arg max_jobs=192 \ --network=host --progress plain \ -t vllm-rocm-mooncake:pr .Mooncake Cache
First run the image the was just created in a container.
docker run -it --rm --name mooncake-cache \ --network=host --ipc=host --shm-size=16g \ --device=/dev/kfd --device=/dev/dri --group-add video \ --security-opt seccomp=unconfined \ -v ~/.cache/huggingface:/root/.cache/huggingface \ --entrypoint bash vllm-rocm-mooncake:prInside the container start the master, write a config file (matches docs' sample) and serve.
Once the serve is up, we can send a request.
Test results
From within the container we get the following information.
=== versions.txt (mooncake) === MOONCAKE_BRANCH=df508641d76be20803349bf715d3bfc5205a7b58 MOONCAKE_REPO=https://github.com/kvcache-ai/Mooncake.git === mooncake wheel + engine === mooncake 0.3.12.post1 | SUPPORT_HIP True === store import === store import OK === master === mooncake_master version 0.3.12.post1 (git: df50864) === vllm + connectors === vllm 0.1.dev20069+g9610bea88 connectors: MooncakeStoreConnector + MooncakeConnectorAnd after running the prompt to the server we get the following sane result.