-
Notifications
You must be signed in to change notification settings - Fork 3.7k
[HiCache] add GPU id to IB dev topo for mooncake storage backend #13112
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[HiCache] add GPU id to IB dev topo for mooncake storage backend #13112
Conversation
Summary of ChangesHello @stmatengss, 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 enhances the Mooncake storage backend by providing a more flexible and granular way to configure InfiniBand devices, especially in tensor parallel deployments. It allows users to explicitly define which IB devices should be used by each tensor parallel rank through a JSON configuration, improving resource management and potentially optimizing data transfer performance in distributed environments. The changes include both the implementation of the parsing logic and comprehensive documentation for the new feature. Highlights
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.
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 adds support for user-defined, per-tensor-parallel-rank InfiniBand device configurations for the Mooncake storage backend. This is achieved by allowing the device_name parameter to be a JSON string that maps ranks to device names. The implementation correctly parses this configuration to select the appropriate device for the current rank, and the documentation has been updated accordingly.
My review includes a correction for an invalid JSON example in the README and a suggestion to simplify the device lookup logic in the Python code to remove a redundant check. Overall, the changes are well-implemented and introduce a valuable feature.
| - For tensor parallel deployments where different ranks should use different devices, you can specify device configurations using JSON format: | ||
| ```json | ||
| { | ||
| "device_name": "{0: \"ib0,ib1\", 1: \"ib2,ib3\", 2: \"ib4,ib5\"}" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The JSON example for device_name is invalid. The value for device_name should be a string containing valid JSON, which requires keys to be double-quoted strings. The current example is a string representation of a Python dictionary and will fail to parse with json.loads.
For consistency with the environment variable example, please update the JSON example.
| "device_name": "{0: \"ib0,ib1\", 1: \"ib2,ib3\", 2: \"ib4,ib5\"}" | |
| "device_name": "{\"0\": \"ib0,ib1\", \"1\": \"ib2,ib3\", \"2\": \"ib4,ib5\"}" |
| device_name = device_config.get(tp_rank, "") | ||
| if not device_name: | ||
| device_name = device_config.get(str(tp_rank), "") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The json.loads function always produces a dictionary with string keys. Therefore, looking up with an integer tp_rank will always fail. You can simplify this logic to only use str(tp_rank) for the lookup.
Additionally, the comment on line 200 is misleading and should be updated or removed.
| device_name = device_config.get(tp_rank, "") | |
| if not device_name: | |
| device_name = device_config.get(str(tp_rank), "") | |
| device_name = device_config.get(str(tp_rank), "") |
|
cc @ykwd |
Thanks |
Motivation
Support user-defined per-TP IB devicecs config.
Modifications
Accuracy Tests
Benchmarking and Profiling
Checklist