Repository navigation
refactor(model): build Hy V3 and MiniMax-M2 from builder-backed model configs - #6392
Open
kamran-nvidia wants to merge 3 commits into
Open
kamran-nvidia wants to merge 3 commits into
kamran-nvidia wants to merge 3 commits into
Conversation
Contributor
Author
|
/ok to test d44b78b |
This was referenced Oct 9, 2026
kamran-nvidia
marked this pull request as ready for review
October 13, 2026 15:54
Move Hy V3 onto the ModelConfig/ModelBuilder path, following Muse Glimmer: - HYV3Bridge maps Hugging Face configs in hf_config_to_model_config_kwargs(). The builder's default MoE layer spec is the GPT decoder block spec, which honors the dense-first moe_layer_freq; the deprecated provider path keeps its explicit decoder block spec. USE_MODEL_CONFIG_FOR_CONVERSION = True. - Add Hy V3 bridge unit tests (none existed). Signed-off-by: Kamran Jafari <kjafarisadeg@nvidia.com> Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Move MiniMax-M2 onto the ModelConfig/ModelBuilder path, following Muse Glimmer. MiniMaxM2Bridge maps Hugging Face configs in hf_config_to_model_config_kwargs(), including the full-dimension QK-norm layer spec, and the deprecated provider path reuses the same kwargs. USE_MODEL_CONFIG_FOR_CONVERSION = True. Signed-off-by: Kamran Jafari <kjafarisadeg@nvidia.com> Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…configs After #6305, MODEL_CONFIG_CLASS defaults to None and each family opts in. Set MODEL_CONFIG_CLASS = BridgeGPTModelConfig on the bridges this PR migrates, matching Qwen3 and Llama, and assert it in their tests. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: Kamran Jafari <kjafarisadeg@nvidia.com>
2 of 5 tasks
kamran-nvidia
force-pushed
the
kjafarisadeg/hyv3-minimaxm2-model-config
branch
from
October 14, 2026 16:19
d44b78b to
3d8a518
Compare
Contributor
Author
|
/ok to test 3d8a518 |
Contributor
|
Automatic Claude reviews have been retired. To request a pull-request review, post a comment containing: Add |
This branch was successfully deployed
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.
What does this PR do ?
Moves Hy V3 and MiniMax-M2 onto the builder-backed
ModelConfig/ModelBuilderpath for checkpoint conversion, following Muse Glimmer. Neither family has library recipes.Changelog
MODEL_CONFIG_CLASSnow defaults toNone, so each migrated bridge setsMODEL_CONFIG_CLASS = BridgeGPTModelConfignext toUSE_MODEL_CONFIG_FOR_CONVERSION = True(as Qwen3 and Llama do), and its tests assert it.HYV3Bridge:provider_bridge()is replaced byhf_config_to_model_config_kwargs(), and the provider path reuses the same kwargs. The builder config leavestransformer_layer_specunset because MCore's builder default for MoE models is alreadyget_gpt_decoder_block_spec, which honors the dense-firstmoe_layer_freq. The deprecated provider path keeps its explicit decoder block spec inhf_config_to_provider_kwargs(). The forced bf16 dtype fields carry over.USE_MODEL_CONFIG_FOR_CONVERSION = True.MiniMaxM2Bridge: same kwargs migration. The builder config carriestransformer_layer_spec=minimax_m2_layer_spec; that spec reads only fields the builder config resolves (num_moe_experts,moe_grouped_gemm), so both paths build the full-dimension QK norm.rotary_dim→rotary_percenthandling is unchanged.USE_MODEL_CONFIG_FOR_CONVERSION = True.tests/unit_tests/models/hy_v3/; Hy V3 had no bridge unit tests. It covers the builder mapping, provider/builder parity for bf16 and fp16 sources, andmegatron_to_hf_configfrom a builder config.rotary_dim, and layer-spec equivalence between provider and builder config.Verification
Each family was validated separately on tiny random-weight checkpoints (single GB200 node, NeMo 26.10 container, transformers 5.15 for both HF models).
Conversion paths:
scripts/conversionGPU import at TP2 and export.AutoBridge.import_ckpt/export_ckpt.compare.py.roundtrip_checkpoint.Each was run on this branch and on
main.mainvs this branchrotary_dim)get_model_config()vs providermain)main)main-imported checkpoint)main, and this branch on amain-imported checkpointroundtrip_checkpointTP2Regression: 334 tests (1 skipped) across
models/hy_v3,models/minimax_m2,test_auto_bridge.py,test_gpt_model_config.py, the AutoBridge registration matrix,conversion/anddoc_consistency.Lint:
ruff checkandruff format --checkare clean (ruff 0.16.7;pre-commititself not run).Known, pre-existing: a bf16 source checkpoint exports the router expert bias (
mlp.expert_bias/e_score_correction_bias) as fp32, because Megatron keeps it in fp32. The values are identical after a cast, andmain's own code exports these checkpoints the same way (verified for both families).After rebasing onto
mainwith #6305 (Megatron Core a98aed553): 215 passed, 1 skipped, including #6305's all-bridges opt-in check intest_gpt_model_config.py;ruffclean.Before your PR is "Ready for review"
Pre checks:
Additional Information
maindirectly.🤖 Generated with Claude Code