feat: add vLLM ROCm variant for AMD GPUs#638
Conversation
doringeman
commented
Feb 5, 2026
Signed-off-by: Dorin Geman <dorin.geman@docker.com>
Summary of ChangesHello @doringeman, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request significantly enhances the model runner's compatibility by integrating vLLM support for AMD GPUs via ROCm. By introducing a new Docker variant and corresponding build/run commands, users with AMD hardware can now easily deploy and utilize vLLM, broadening the accessibility and utility of the project across different GPU architectures. Highlights
🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console. Changelog
Activity
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
There was a problem hiding this comment.
Code Review
This pull request introduces a vLLM ROCm variant for AMD GPU support by adding a new build stage in the Dockerfile and corresponding targets in the Makefile. The changes are generally sound, but I've identified a critical issue in the Makefile that will likely cause the build to fail due to an incorrect variable. Additionally, I've suggested a refactoring in the Dockerfile to improve maintainability by reducing code duplication. Addressing these points will make the implementation more robust and easier to manage.
| @$(MAKE) docker-build \ | ||
| DOCKER_TARGET=final-vllm-rocm \ | ||
| DOCKER_IMAGE=$(DOCKER_IMAGE_VLLM_ROCM) \ | ||
| LLAMA_SERVER_VARIANT=rocm \ |
There was a problem hiding this comment.
This LLAMA_SERVER_VARIANT value will likely cause the build to fail. The Dockerfile uses this variable to construct the path to the llama.cpp binary inside the llama-server image. Based on the llamacpp/native/rocm.Dockerfile provided in the context, the path includes the ROCm version (e.g., ...rocm7.0.2...), but here you are setting the variant to just rocm.
This will result in a path mismatch and a COPY failure in the Dockerfile.
To fix this, the LLAMA_SERVER_VARIANT should include the ROCm version. Assuming the version is 7.0.2 as per rocm.Dockerfile, this line should be updated.
LLAMA_SERVER_VARIANT=rocm7.0.2 \
| # --- vLLM ROCm variant --- | ||
| FROM llamacpp AS vllm-rocm | ||
|
|
||
| ARG VLLM_VERSION=0.15.1 | ||
|
|
||
| USER root | ||
|
|
||
| RUN apt update && apt install -y python3 python3-venv python3-dev curl ca-certificates build-essential && rm -rf /var/lib/apt/lists/* | ||
|
|
||
| RUN mkdir -p /opt/vllm-env && chown -R modelrunner:modelrunner /opt/vllm-env | ||
|
|
||
| USER modelrunner | ||
|
|
||
| # Install uv and vLLM with ROCm support | ||
| RUN curl -LsSf https://astral.sh/uv/install.sh | sh \ | ||
| && ~/.local/bin/uv venv --python /usr/bin/python3 --system-site-packages /opt/vllm-env \ | ||
| && ~/.local/bin/uv pip install --python /opt/vllm-env/bin/python \ | ||
| vllm==${VLLM_VERSION} --extra-index-url https://wheels.vllm.ai/rocm/ | ||
|
|
||
| RUN /opt/vllm-env/bin/python -c "import vllm; print(vllm.__version__)" > /opt/vllm-env/version |
There was a problem hiding this comment.
There's significant duplication between this new vllm-rocm stage and the existing vllm stage (lines 86-112). Many of the setup steps, such as installing system dependencies, creating directories, and installing uv, are identical.
To improve maintainability and reduce code duplication, consider creating a common base stage (e.g., vllm-base) from which both vllm and vllm-rocm can inherit. This base stage would handle the common setup, and the specific vllm and vllm-rocm stages would only contain the logic for installing their respective versions of the vllm package.
For example:
# --- vLLM base ---
FROM llamacpp AS vllm-base
USER root
RUN apt update && apt install -y python3 python3-venv python3-dev curl ca-certificates build-essential && rm -rf /var/lib/apt/lists/*
RUN mkdir -p /opt/vllm-env && chown -R modelrunner:modelrunner /opt/vllm-env
USER modelrunner
RUN curl -LsSf https://astral.sh/uv/install.sh | sh
# --- vLLM variant ---
FROM vllm-base AS vllm
# ... vllm specific install
...
# --- vLLM ROCm variant ---
FROM vllm-base AS vllm-rocm
# ... vllm-rocm specific install
...This would make the Dockerfile cleaner and easier to manage as more variants are added.
There was a problem hiding this comment.
It's a fair point about the duplication here
| LLAMA_SERVER_VARIANT := cpu | ||
| BASE_IMAGE := ubuntu:24.04 | ||
| VLLM_BASE_IMAGE := nvidia/cuda:13.0.2-runtime-ubuntu24.04 | ||
| VLLM_ROCM_BASE_IMAGE := rocm/pytorch:rocm6.3.4_ubuntu24.04_py3.12_pytorch_release_2.6.0 |
There was a problem hiding this comment.
vllm tends to pull it's own version of everything on install in the venv, etc. We might be able to use plain-old ubuntu for all vLLM images. Llama.cpp is a bit different, need to install the dependancies ourselves
There was a problem hiding this comment.
llama.cpp and vLLM can be on different ROCm versions if needs be. Hard to avoid that, we are moving to the one container image per backend model anyway.