Skip to content

support deepseek_v4 packing/CP#140

Merged
Jintao-Huang merged 9 commits into
modelscope:mainfrom
Jintao-Huang:support_deepseek_v4_packing
Jul 8, 2026
Merged

support deepseek_v4 packing/CP#140
Jintao-Huang merged 9 commits into
modelscope:mainfrom
Jintao-Huang:support_deepseek_v4_packing

Conversation

@Jintao-Huang

@Jintao-Huang Jintao-Huang commented Jul 8, 2026

Copy link
Copy Markdown
Collaborator

@gemini-code-assist

Copy link
Copy Markdown

Warning

You have reached your daily quota limit. Please wait up to 24 hours and I will start processing your requests again!

@Jintao-Huang

Copy link
Copy Markdown
Collaborator Author

NVIDIA/Megatron-LM#5706

@Jintao-Huang

Copy link
Copy Markdown
Collaborator Author

/gemini review

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown

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 introduces support for Context Parallel (CP) in DeepSeek-V4 attention by implementing boundary hidden state and rotary position embedding exchanges, supporting contiguous CP partitioning in split_cp_inputs, and adjusting RoPE application for packed sequences. The code reviewer provided valuable feedback to improve robustness, suggesting to handle potential None values for cp_group to avoid AttributeError, use getattr when accessing cp_partition_mode on packed_seq_params, and wrap the import of csa_cp_utils in a try-except block to gracefully handle older Megatron-Core versions.

Important

The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.

Comment thread src/mcore_bridge/model/gpts/deepseek_v4.py
Comment thread src/mcore_bridge/model/gpts/deepseek_v4.py
Comment thread src/mcore_bridge/model/gpts/deepseek_v4.py
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants