Register cp-atten-allgather buffers with symm memory#17756
Register cp-atten-allgather buffers with symm memory#17756ShangmingCai merged 19 commits intosgl-project:mainfrom
Conversation
Signed-off-by: wangfakang <fakangwang@gmail.com>
Summary of ChangesHello @wangfakang, 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 introduces symmetric memory allocation for buffers involved in 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. 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.
Code Review
This pull request enables symmetric memory for cp-attention-allgather operations by wrapping buffer allocations in a use_symmetric_memory context. The changes look good in principle.
However, I've identified a potential issue in both modified functions (cp_attn_tp_all_gather_reorganazied_into_tensor and cp_all_gather_rerange_output). When symmetric memory is enabled, the input tensors for the all-gather operations are not consistently allocated in symmetric memory. This could lead to errors or performance degradation if the underlying communication library expects registered buffers. I've left specific comments with suggestions on how to address this. Please take a look.
|
Friendly ping @merrymercy @Fridge003 Could you help me review this? Thanks! |
nvcastet
left a comment
There was a problem hiding this comment.
Minor comments, otherwise looks good to me! Thanks!
Signed-off-by: wangfakang <fakangwang@gmail.com>
|
/tag-and-rerun-ci |
|
After reviewing the failed CI logs, most errors appear to be related to missing |
|
@ishandhanani @Fridge003 I agree with @wangfakang, the CI failures are unrelated to this PR. |
|
@wangfakang In fact, can you add back |
|
/tag-and-rerun-ci |
|
@nvcastet @merrymercy @Fridge003 @ShangmingCai |
LGTM |
|
/rerun-stage stage-c-test-8-gpu-h200 |
|
✅ Triggered |
|
/rerun-stage stage-c-test-8-gpu-h20 |
|
✅ Triggered |
|
/rerun-stage unit-test-backend-4-gpu-b200 |
|
✅ Triggered |
|
/rerun-stage stage-c-test-4-gpu-b200 |
|
✅ Triggered |
|
/rerun-stage stage-c-test-4-gpu-gb200 |
|
✅ Triggered |
|
Since our CI is flaky currently, I think we can bypass CI and merge this PR. If any bug has been reported, please ping me to fix or revert. |
Signed-off-by: wangfakang <fakangwang@gmail.com>
Signed-off-by: wangfakang <fakangwang@gmail.com>
Signed-off-by: wangfakang <fakangwang@gmail.com>
Signed-off-by: wangfakang <fakangwang@gmail.com>
Motivation
To enhance the communication performance of cp-attention-allgather by adding symmetric memory (symm) support. Benchmark results for the 16K input scenario show that enabling symmetric memory reduces allgather communication latency by 50%.
CC @merrymercy @Fridge003 @nvcastet
Before optimization allgather took 27.584μs
After optimization allgather took 13.696μs

Modifications
Accuracy Tests
Benchmarking and Profiling
Checklist
Review Process
/tag-run-ci-label,/rerun-failed-ci,/tag-and-rerun-ci