Skip to content

Update rocm7.2 Dockerfile to install amdsmi for QuickReduce Initialization#19091

Merged
HaiShaw merged 2 commits intosgl-project:mainfrom
clintg6:fix_rocm7.2_dockerfile
Feb 23, 2026
Merged

Update rocm7.2 Dockerfile to install amdsmi for QuickReduce Initialization#19091
HaiShaw merged 2 commits intosgl-project:mainfrom
clintg6:fix_rocm7.2_dockerfile

Conversation

@clintg6
Copy link
Copy Markdown
Contributor

@clintg6 clintg6 commented Feb 20, 2026

Description:

This update modifies the rocm720.Dockerfile to include the AMD SMI Python package from the installed ROCm distribution. This enables QuickReduce to initialize properly when using the rocm7.2 Docker images.

Motivation:

The rocm7.2 rocm/sgl-dev images currently lack the AMD SMI package, preventing users from utilizing features like quantized allreduce (e.g., QuickReduce). This results in no improvements in latency or throughput for related tasks.

Current Issue:

The issue stems from using the base image rocm/pytorch:rocm7.2_ubuntu22.04_py3.10_pytorch_release_2.9.1, which is missing the amdsmi package. Without this package, QuickReduce cannot be initialized as intended.

Example Screenshot:

Missing amdsmi package
{89DF8C6F-EE1C-4834-BA22-9ED8E79CBF18}

Change Summary:

  • rocm720.Dockerfile: Added the installation of the AMD SMI Python package from the ROCm distribution.
  • This change does not impact kernels or other core functionality, so accuracy and performance testing are not applicable.

Before:

  • Users couldn’t initialize QuickReduce due to missing package.

After:

  • QuickReduce initialization is now supported, allowing for proper use of quantized allreduce operations.

Notes:

  • No changes to kernel code or algorithms, so performance tests and accuracy measurements are not applicable.
  • This fix only ensures that the amdsmi package is present and accessible for users working with AMD hardware.

Why This is Important:

This update ensures that users relying on QuickReduce for efficient allreduce will now have the necessary packages available, improving the usability of the ROCm 7.2 images in production and testing environments.

Added installation of AMD SMI Python package from ROCm distribution so that QuickReduce can initialize.
@gemini-code-assist
Copy link
Copy Markdown
Contributor

Summary of Changes

Hello @clintg6, 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 addresses a critical dependency issue within the rocm7.2 Docker images by integrating the AMD SMI Python package. This integration is crucial for enabling the proper functioning of QuickReduce, a feature vital for quantized allreduce operations. The update ensures that users can now fully utilize the capabilities of ROCm 7.2 for tasks requiring efficient allreduce, thereby improving the usability and functionality of the Docker environment for machine learning and high-performance computing workloads.

Highlights

  • AMD SMI Installation: The rocm720.Dockerfile now includes the installation of the AMD SMI Python package directly from the ROCm distribution, resolving a missing dependency issue.
  • QuickReduce Initialization Enabled: This change enables proper initialization of QuickReduce, allowing users to leverage features like quantized allreduce which were previously unavailable due to the missing AMD SMI package.
  • Development Tool Added: The vim text editor has been added to the list of installed packages in the Dockerfile, providing a common development utility within the container environment.

🧠 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
  • docker/rocm720.Dockerfile
    • Added a RUN command to install the AMD SMI Python package from /opt/rocm/share/amd_smi.
    • Included vim in the list of installed apt-get packages.
Using Gemini Code Assist

The 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 /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

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 .gemini/ folder in the base of the repository. Detailed instructions can be found here.

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

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request addresses an issue where QuickReduce fails to initialize in rocm7.2 Docker images due to a missing amdsmi package. The fix involves adding a RUN instruction to install this package from the ROCm distribution within the Dockerfile, and also adds vim to the list of installed packages. The changes are clear and directly address the problem. I have a couple of suggestions to further improve the Dockerfile based on best practices: using --no-cache-dir with pip install to optimize the Docker image size, and reconsidering the inclusion of vim in the image, as it can increase image size and attack surface, which is generally avoided for production environments.

RUN apt-get purge -y sccache; python -m pip uninstall -y sccache; rm -f "$(which sccache)"

# Install AMD SMI Python package from ROCm distribution
RUN cd /opt/rocm/share/amd_smi && python3 -m pip install .
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

To optimize Docker image size by preventing pip from storing downloaded packages in its cache, it's a good practice to use the --no-cache-dir flag with pip install.

RUN cd /opt/rocm/share/amd_smi && python3 -m pip install --no-cache-dir .

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

libprotobuf-dev protobuf-compiler libgflags-dev libsqlite3-dev \
python3 python3-dev python3-setuptools python3-pip python3-apt \
gcc libtinfo-dev zlib1g-dev libedit-dev libxml2-dev \
gcc libtinfo-dev zlib1g-dev libedit-dev libxml2-dev vim \
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

Adding vim is useful for debugging, but it increases the image size and attack surface. For production images, it's generally recommended to keep them as minimal as possible. If vim is only needed for development or debugging, consider creating a separate development Dockerfile or installing it on-the-fly when needed inside a running container.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

vim is standard in the rocm7.0 SGLang docker images

Updated pip install command for AMD SMI package to use --no-cache-dir.
@clintg6 clintg6 requested a review from yctseng0211 as a code owner February 20, 2026 23:59
@HaiShaw HaiShaw merged commit 3224836 into sgl-project:main Feb 23, 2026
43 checks passed
@akao-amd akao-amd mentioned this pull request Feb 24, 2026
5 tasks
xiaobaicxy added a commit to xiaobaicxy/sglang that referenced this pull request Feb 24, 2026
…o xverse_moe

* 'xverse_moe' of https://github.com/xiaobaicxy/sglang: (275 commits)
  fix: add missing blank line after docstring in serving_transcription.py (sgl-project#19206)
  Whisper model support & `/v1/audio/transcriptions` endpoint & benchmark (sgl-project#16983)
  fix: patch docker image fixes (sgl-project#19100)
  [PD-Disagg] Unify prefill info data transition flow, all with `PrefillServerInfo` (sgl-project#19195)
  [CI] Tiny enhance the dp attention load blance benchmark (sgl-project#19194)
  add new ci user (sgl-project#19133)
  [CI] fix the teardown output of disaggregation test (sgl-project#19193)
  [PD-Disagg] Support query dp rank from bootstrap server. (sgl-project#19168)
  [Kernel Slimming] Migrate AWQ marlin repack kernel to JIT (sgl-project#18949)
  [Diffusion] Match rotary_embedding module name style (sgl-project#19179)
  [Refactor] Split rotary_embedding.py into a modular package (sgl-project#19144)
  [NPU] bump sgl-kernel-npu to 2026.02.01.post2 (sgl-project#19178)
  Use single mma warp group for short q_len in FA to optimize decoding performance (sgl-project#18985)
  Reorganize topk logic to clean up code and expose logical experts (sgl-project#16945)
  [ROCm] Use unreg path for custom all-reduce during CUDA graph capture (sgl-project#19162)
  [diffusion] feat: detect Flux2 custom VAE path from component_paths (sgl-project#19170)
  [AMD] ENV flags tuning and cleanup (sgl-project#19176)
  Fix bench_one_batch_server by moving the print statements (sgl-project#19175)
  Update rocm7.2 Dockerfile to install amdsmi for QuickReduce Initialization (sgl-project#19091)
  Revert "Refactor graph input buffers (sgl-project#18991)" (sgl-project#19173)
  ...
magicYang1573 pushed a commit to magicYang1573/sglang that referenced this pull request Mar 9, 2026
Wangzheee pushed a commit to Wangzheee/sglang that referenced this pull request Mar 21, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants