fix bailing_moe with enable_dp_attention#10860
Conversation
Summary of ChangesHello @GuoweiWangU, 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 resolves a critical inference hang issue encountered when running the 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.
Code Review
This pull request addresses a hang issue when using DP attention with the Bailing-MoE model. The root cause was an incorrect tensor parallel group being used for all-reduce in the VocabParallelEmbedding layer. The fix correctly disables tensor parallelism for the word_embeddings layer when DP attention is enabled, which is a simple and effective way to resolve the issue. The change also includes a minor cleanup by removing an unused import. The fix appears correct and well-targeted, though it comes with a minor performance trade-off.
| quant_config=quant_config, | ||
| prefix=add_prefix("word_embeddings", prefix), | ||
| use_attn_tp_group=global_server_args_dict["enable_dp_lm_head"], | ||
| enable_tp=not is_dp_attention_enabled(), |
There was a problem hiding this comment.
Motivation
Inference hang with dp attention.
python -m sglang.launch_server --model {path_to_bailing_moe} --tp 4 --dp 2 --enable-dp-attention --enable-dp-lm-headThe core reason is the #5558 , which leads to embedding forward errors.
Modifications
Use
enable_tpinstead ofuse_attn_tp_groupforVocabParallelEmbeddingChecklist