[PG] force register local memory for P2P memory regions#1690
Conversation
Summary of ChangesHello, 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 bug in the PyTorch Backend ( 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. 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. Footnotes
|
There was a problem hiding this comment.
Code Review
This pull request introduces a location parameter to force registration of local memory for P2P memory regions with a specific location, instead of using a wildcard. The changes are straightforward and correctly implement the intended logic by passing the location from the MooncakeBackend down to the P2PProxy where it's used for memory registration.
My main feedback is regarding code formatting consistency. While the code was likely auto-formatted, there are some inconsistencies in how function calls are wrapped. I've added specific suggestions to improve readability and maintain a consistent style. Overall, the changes are good.
| int rc = engine_->registerLocalMemory(resources_.send_buffer_, | ||
| kP2PTotalBufferSize, location_); |
There was a problem hiding this comment.
To improve readability and maintain consistency, please consider reformatting this function call. The formatting of registerLocalMemory calls has become inconsistent in this file. This comment applies to other similar calls in this file.
| int rc = engine_->registerLocalMemory(resources_.send_buffer_, | |
| kP2PTotalBufferSize, location_); | |
| int rc = engine_->registerLocalMemory( | |
| resources_.send_buffer_, kP2PTotalBufferSize, location_); |
| rc = engine_->registerLocalMemory(resources_.recv_buffer_, | ||
| kP2PTotalBufferSize, location_); |
There was a problem hiding this comment.
| int rc = engine_->registerLocalMemory(resources_.send_buffer_, | ||
| kP2PTotalBufferSize, location_); |
There was a problem hiding this comment.
| rc = engine_->registerLocalMemory(resources_.recv_buffer_, | ||
| kP2PTotalBufferSize, location_); |
There was a problem hiding this comment.
| int rc = engine_->registerLocalMemory(resources_.ctrl_send_region_, | ||
| kMaxNumRanks * sizeof(P2PControlSlot), | ||
| kWildcardLocation); | ||
| location_); |
There was a problem hiding this comment.
Please reformat for consistency. This formatting is also inconsistent with other calls in this file (e.g. line 75).
| int rc = engine_->registerLocalMemory(resources_.ctrl_send_region_, | |
| kMaxNumRanks * sizeof(P2PControlSlot), | |
| kWildcardLocation); | |
| location_); | |
| int rc = engine_->registerLocalMemory( | |
| resources_.ctrl_send_region_, | |
| kMaxNumRanks * sizeof(P2PControlSlot), | |
| location_); |
| rc = engine_->registerLocalMemory(resources_.ctrl_recv_region_, | ||
| kMaxNumRanks * sizeof(P2PControlSlot), | ||
| kWildcardLocation); | ||
| location_); |
There was a problem hiding this comment.
Please reformat for consistency, as mentioned in the previous comments.
| rc = engine_->registerLocalMemory(resources_.ctrl_recv_region_, | |
| kMaxNumRanks * sizeof(P2PControlSlot), | |
| kWildcardLocation); | |
| location_); | |
| rc = engine_->registerLocalMemory( | |
| resources_.ctrl_recv_region_, | |
| kMaxNumRanks * sizeof(P2PControlSlot), | |
| location_); |
|
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
Description
Similar to #1656.
Module
mooncake-transfer-engine)mooncake-store)mooncake-ep)mooncake-integration)mooncake-p2p-store)mooncake-wheel)mooncake-pg)mooncake-rl)Type of Change
How Has This Been Tested?
Checklist
./scripts/code_format.shbefore submitting.