Repository navigation
fix(glm5_next): probe KDA fields on the hybrid layer config - #245
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 was referenced Oct 29, 2026
Collaborator
|
Does this also happen on dev? We don't currently aim for Megatron main branch compatibility |
|
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.
Problem
NVIDIA/Megatron-LM#7054 added GLM-style KDA hybrid layers. Its merged implementation:
kda_two_stage_gatesonKDALayerConfig.Symbols.LAYER_CONFIG_MAP['K'].require_glm5_hybrid()only checksTransformerConfig.__dataclass_fields__, so it incorrectly rejects this supported layout and tells users to apply the Megatron patch.Fix
When
kda_two_stage_gatesis absent fromTransformerConfig, also check the config selected byLAYER_CONFIG_MAP['K']. Preserve support for the legacy field layout and continue rejecting missing required capabilities.Tests
Parameterized unit tests in
tests/test_glm5_next.pycover the legacy layout, the KDA-layer layout, a field missing from both, an unavailable layer-config module, and an unrelated required field still missing. They exercise the real guard with mocked config metadata, without constructing a model or process group.