Repository navigation
Conversation
Signed-off-by: zhaoch23 <[email protected]>
Signed-off-by: zhaoch23 <[email protected]>
Signed-off-by: zhaoch23 <[email protected]>
Signed-off-by: zhaoch23 <[email protected]>
There was a problem hiding this comment.
Summary of Changes
Hello @zhaoch23, 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!
I've updated the dashboard's GPU metric collection to improve accuracy and expand hardware compatibility. The primary change involves moving NVIDIA GPU monitoring from nvidia-smi to the pynvml library, which offers more detailed per-process utilization data. Additionally, I've introduced support for Huawei NPUs, enabling their metrics to be collected and displayed within the dashboard. These changes aim to provide a more comprehensive and reliable overview of accelerator resource usage.
Highlights
- NVIDIA GPU Metrics Transition: I've transitioned the NVIDIA GPU metrics collection from relying on
nvidia-smicommand-line parsing to using thepynvmllibrary. This change provides a more robust and direct interface for querying GPU information and per-process utilization. - Enhanced Per-Process GPU Metrics: I've enhanced the
pynvmlintegration to leverage new NVML functions that provide more detailed per-process GPU utilization (SM and memory usage), which was not readily available with previous methods. - Huawei NPU Support: I've added support for Huawei NPUs (Neural Processing Units) by integrating a new
pynpudcmilibrary. This allows Ray's dashboard to collect and report metrics for Huawei NPU devices, including utilization and memory usage, similar to how GPUs are monitored.
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 in your pull request via creating an issue comment (i.e. comment on the pull request page) using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands.
| 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 issue 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 or fill out our survey to provide feedback.
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
-
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. ↩
There was a problem hiding this comment.
Code Review
This pull request switches GPU metrics collection from nvidia-smi to pynvml and adds support for Huawei NPUs via pynpudcmi. The changes are generally well-implemented. My main concern is a potential regression in the NVIDIA GPU provider where GPUs with no running processes might not be reported in the metrics. I've also provided some suggestions to improve the maintainability of the new Huawei NPU provider code by using context managers for locks and decorators to reduce boilerplate. Additionally, there's a minor issue in the new tests with a duplicated test method name that should be corrected.
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com> Signed-off-by: zhilong <[email protected]>
Signed-off-by: zhaoch23 <[email protected]>
Signed-off-by: zhaoch23 <[email protected]>
Signed-off-by: zhaoch23 <[email protected]>
|
@zhaoch23 could you separate the GPU and NPU parts into two PRs? |
| else self._get_pynvml_gpu_usage() | ||
| ) | ||
|
|
||
| def _get_nvsmi_gpu_usage(self) -> List[GpuUtilizationInfo]: |
| self.assertEqual(gpu_info["processes_pids"][5678]["gpu_memory_usage"], 512) | ||
|
|
||
|
|
||
| class TestHuaweiNpuProvider(unittest.TestCase): |
|
This pull request has been automatically marked as stale because it has not had You can always ask for help on our discussion forum or Ray's public slack channel. If you'd like to keep this open, just leave any comment, and the stale label will be removed. |
|
This pull request has been automatically closed because there has been no more activity in the 14 days Please feel free to reopen or open a new pull request if you'd still like this to be addressed. Again, you can always ask for help on our discussion forum or Ray's public slack channel. Thanks again for your contribution! |
Why are these changes needed?
Switched to use NVML interface for GPU usage, which is claimed to be backward compatible.
Also added NPU DCMI support for NPU usage monitoring.
Related issue number
Follow up for #52102
Checks
git commit -s) in this PR.scripts/format.shto lint the changes in this PR.method in Tune, I've added it in
doc/source/tune/api/under thecorresponding
.rstfile.