Skip to content

Comments

feat: Add AMD ROCm GPU hardware monitoring support#1389

Merged
Zeyi-Lin merged 13 commits intoSwanHubX:mainfrom
KMnO4-zx:main
Dec 26, 2025
Merged

feat: Add AMD ROCm GPU hardware monitoring support#1389
Zeyi-Lin merged 13 commits intoSwanHubX:mainfrom
KMnO4-zx:main

Conversation

@KMnO4-zx
Copy link
Contributor

Summary

Add AMD ROCm GPU hardware monitoring support for SwanLab, supporting both Linux and Windows systems. 🎯

Main Changes

  • New AMD GPU monitoring module swanlab/data/run/metadata/hardware/rocm/amd.py
  • Supported metrics: GPU utilization, memory usage percentage, memory usage (MB), temperature, power consumption 📊
  • Linux system: Collects data via sysfs interface instead of calling rocm-smi, improving stability and avoiding crashes 🛡️
  • Windows system: Uses hipinfo tool to get GPU information 🪟
  • Documentation: Updated README with AMD ROCm support info 📝

Highlights

Prioritizes sysfs file reading over command-line calls, solving the instability issues of rocm-smi in certain ROCm versions. ✨

Merry Christmas Eve! 🎄🎅✨

Wishing you peace, joy, and happy coding! May your holidays be filled with warm moments and bug-free commits. 🎁

@gemini-code-assist
Copy link
Contributor

Summary of Changes

Hello @KMnO4-zx, 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 integrates AMD ROCm GPU hardware monitoring capabilities into SwanLab, enabling users to track critical performance metrics for their AMD GPUs. The implementation is designed for robustness, particularly on Linux, by leveraging direct system file access for data collection, and uses the hipinfo utility for Windows. This enhancement broadens SwanLab's compatibility and provides more comprehensive insights into AI training environments.

Highlights

  • AMD ROCm GPU Monitoring: Introduces comprehensive hardware monitoring support for AMD ROCm GPUs on both Linux and Windows systems.
  • Enhanced Stability on Linux: Prioritizes reading GPU metrics directly from the Linux sysfs interface, significantly improving stability and avoiding crashes often associated with rocm-smi in certain ROCm versions.
  • Windows Support via hipinfo: Implements GPU information collection on Windows by utilizing the hipinfo tool.
  • Key Metrics Collected: Monitors essential GPU metrics including utilization percentage, memory usage (both percentage and MB), temperature, and power consumption.
  • Documentation Update: The README.md and README_EN.md files have been updated to reflect the newly added AMD ROCm support.

🧠 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.

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
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 introduces support for AMD ROCm GPU hardware monitoring for both Linux and Windows systems, which is a valuable addition. The approach of using sysfs on Linux for stability is commendable. My review focuses on improving the robustness and completeness of the implementation. Key points include addressing incomplete metric collection on Windows, replacing unsafe bare except clauses with except Exception, and improving the hardware detection logic on Linux to be more reliable and provide better quality data. There is also a minor formatting suggestion for the README_EN.md file.

@SAKURA-CAT SAKURA-CAT requested a review from Zeyi-Lin December 25, 2025 15:28
@SAKURA-CAT SAKURA-CAT assigned SAKURA-CAT and KMnO4-zx and unassigned SAKURA-CAT Dec 25, 2025
@SAKURA-CAT SAKURA-CAT added 💪 enhancement New feature or request ✈️ integration Integration other frameworks labels Dec 25, 2025
@Zeyi-Lin Zeyi-Lin requested a review from SAKURA-CAT December 26, 2025 03:48
@SAKURA-CAT
Copy link
Member

Our frontend also needs to display this hardware information. I wonder if there are any similar demos available to facilitate our debugging?

@Zeyi-Lin Zeyi-Lin merged commit ac2ee6d into SwanHubX:main Dec 26, 2025
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

💪 enhancement New feature or request ✈️ integration Integration other frameworks

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants