Skip to content

[bugfix] Fix deepseek-v4 fp8#133

Merged
Jintao-Huang merged 7 commits into
modelscope:mainfrom
Jintao-Huang:fix_deepseek_fp8
Jun 23, 2026
Merged

[bugfix] Fix deepseek-v4 fp8#133
Jintao-Huang merged 7 commits into
modelscope:mainfrom
Jintao-Huang:fix_deepseek_fp8

Conversation

@Jintao-Huang

Copy link
Copy Markdown
Collaborator

No description provided.

@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 the Compressor and CSAIndexer modules to customize FP8 initialization for DeepSeek-V4 and integrates them into the transformer layer specification. Feedback on the changes highlights a missing import for DSv4HybridMLP that will cause a runtime NameError, unsafe getattr calls that could raise AttributeError when configuring attention submodules, and potential TypeError exceptions in compressor.py if the base classes fallback to object upon import failure.

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 Outdated
Comment thread src/mcore_bridge/model/modules/compressor.py
Comment thread src/mcore_bridge/model/modules/compressor.py
@Jintao-Huang Jintao-Huang changed the title [bugfix] Fix deepseek fp8 [bugfix] Fix deepseek-v4 fp8 Jun 23, 2026
@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 FP8 support for DeepSeek-V4 within the mcore_bridge package. Key changes include the integration of transformer_engine's GroupedLinear for grouped output projections, the addition of custom Compressor and CSAIndexer modules to handle FP8 initialization, and compatibility updates for RoPE. The review feedback highlights critical issues regarding tensor parallel training (where tp_size > 1). Specifically, te.GroupedLinear must be initialized with the local number of groups (self.o_local_groups) rather than the global count to prevent runtime crashes, and the state dict conversion logic in _set_o_group_proj_grouped needs to be updated to correctly slice and gather weights across tensor parallel ranks.

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
@Jintao-Huang Jintao-Huang merged commit 4e1d75d into modelscope:main Jun 23, 2026
1 check passed
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.

1 participant