Repository navigation
fix(glm5_next): align Core mHC configuration and config copying - #246
Open
WangKangAandy wants to merge 2 commits into
Open
WangKangAandy wants to merge 2 commits into
WangKangAandy wants to merge 2 commits into
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Align GLM-5.3-Flash (
glm5_next) configuration with the mHC fields and per-layer configuration copying used by the target Megatron Core main snapshot.enable_mhc_connections/mhc_num_residual_streamswhen Core exposes the enable field, and disable mHC on MTP's copied configuration without changing the backbone configuration.ModelConfig.__deepcopy__, so copyingconfig.__dict__does not traverse its process groups.Published checkpoint mappings remain unchanged.
Compatibility
Core main introduced these mHC fields in #4531; they differ from the earlier dev/HybridModel
enable_hyper_connectionsinterface. #6313 introduced the per-layerfrom_config()path that copiesconfig.__dict__directly.Target: Transformers 5.16.1 and Megatron-LM
01ac4e83from source. Model construction on that snapshot also needs mcore-bridge #245; the focused tests below do not. Field detection does not supply missing GLM hybrid implementations in other Core versions.Validation
python -m pytest -q tests/test_glm5_next.py \ -k "parser_preserves or deepcopy_shares or mtp_layer_disables or mtp_layer_is_filtered"4 passed, 43 deselected on Python 3.12 with the target Core. Tests cover mHC configuration, sharing the bridge during deepcopy, disabling mHC on MTP's configuration copy, and MTP weight filtering. Whitespace checks pass.
These tests isolate configuration and copy behavior without constructing models or process groups. Full training, checkpoint round-trip, and a real Core-version runtime matrix have not been validated for this change.