[bugfix][AMD] Fix PPMissingLayer AttributeError for deepseek v2/v3 in aiter_gfx95 code path#21194
[bugfix][AMD] Fix PPMissingLayer AttributeError for deepseek v2/v3 in aiter_gfx95 code path#21194RolaoDenthu wants to merge 2 commits intosgl-project:mainfrom
Conversation
Use getattr for safe attribute access on embed_tokens.embedding_dim and layers[i].mlp inside the _use_aiter_gfx95 block, preventing AttributeError when these are PPMissingLayer placeholders in pipeline parallel mode on AMD gfx950 GPUs. Made-with: Cursor
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 critical bug preventing DeepSeek-V2/V3 models from initializing correctly on AMD gfx950 GPUs when Pipeline Parallelism is enabled. The fix involves enhancing the robustness of attribute access within the model's initialization logic, ensuring that the system gracefully handles cases where certain layers are not present on specific parallel ranks, thereby preventing an AttributeError and allowing the models to load successfully. 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 correctly addresses the AttributeError for PPMissingLayer objects when using pipeline parallelism with DeepSeek-V2/V3 on AMD gfx950 GPUs. The use of getattr with default values is the right approach to safely access attributes that may not exist on non-owning pipeline ranks.
I've added one suggestion to refactor a block of code to improve its readability and efficiency. The core logic of your fix is sound.
|
/tag-and-rerun-ci |
Motivation
When running DeepSeek-V2/V3 with Pipeline Parallelism (PP) on AMD gfx950 GPUs (MI300/MI350), the server crashes during model initialization with:
AttributeError: 'PPMissingLayer' object has no attribute 'embedding_dim'.This is because the
_use_aiter_gfx95code block inDeepseekV2Model.__init__directly accessesself.embed_tokens.embedding_dimandself.layers[i].mlp, which arePPMissingLayerplaceholders on non-owning PP ranks.Modifications
Replace 4 bare attribute accesses inside the
_use_aiter_gfx95block with safegetattrcallsChecklist
Review Process
/tag-run-ci-label,/rerun-failed-ci,/tag-and-rerun-ci