Skip to content

[bugfix] fix GLM 5.1 FP8#132

Merged
Jintao-Huang merged 3 commits into
modelscope:mainfrom
Jintao-Huang:_patch_dsa
Jun 22, 2026
Merged

[bugfix] fix GLM 5.1 FP8#132
Jintao-Huang merged 3 commits into
modelscope:mainfrom
Jintao-Huang:_patch_dsa

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 refactors the DSAIndexer patching logic by moving it from a dynamic patch in patcher.py into a dedicated module under src/mcore_bridge/model/modules/dsa_indexer.py and registering it in register.py. The review feedback highlights a few critical issues: first, inheriting from None when megatron-core is not available will cause a TypeError at import time, which can be fixed by falling back to torch.nn.Module; second, unpacking packed_seq_params directly when it is None will raise a TypeError; and third, accessing nested attributes of dsa_spec during registration should be done defensively to prevent potential AttributeError exceptions.

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/modules/dsa_indexer.py
Comment thread src/mcore_bridge/model/modules/dsa_indexer.py
Comment thread src/mcore_bridge/model/register.py Outdated
@Jintao-Huang Jintao-Huang changed the title patch dsa [bugfix] fix GLM 5.1 FP8 Jun 22, 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 refactors the DSA Indexer implementation by moving it from a dynamic patch in patcher.py to a dedicated module in dsa_indexer.py and registering it in register.py. The review feedback highlights three important issues: a potential TypeError at import time if McoreDSAIndexer is None, a TypeError when unpacking packed_seq_params if it is None, and a potential AttributeError in register.py due to unsafe nested attribute access on dsa_spec.

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/modules/dsa_indexer.py
Comment thread src/mcore_bridge/model/modules/dsa_indexer.py
Comment thread src/mcore_bridge/model/register.py
@Jintao-Huang Jintao-Huang merged commit 3a4d0d3 into modelscope:main Jun 22, 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.

2 participants