Skip to content

[bugfix] fix deepseek v4 fp8#135

Merged
Jintao-Huang merged 1 commit into
modelscope:mainfrom
Jintao-Huang:fix_deepseek_v4_fp8
Jun 24, 2026
Merged

[bugfix] fix deepseek v4 fp8#135
Jintao-Huang merged 1 commit into
modelscope:mainfrom
Jintao-Huang:fix_deepseek_v4_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 modifies deepseek_v4.py by directly accessing config.fp8_param instead of using getattr and by casting concatenated weights to torch.float8_e4m3fn when setting wo_a.weight. The reviewer raised two important concerns: first, removing getattr when checking fp8_param can lead to an AttributeError if standard configurations are passed; second, unconditionally calling .view(torch.float8_e4m3fn) on the concatenated weights can cause failures or data corruption if the parameters are not FP8, suggesting a guard check on the tensor's data type.

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 980c417 into modelscope:main Jun 24, 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