Add norm before up projection for LatentMoE - #6819
Open
i-riyad wants to merge 2 commits into
Open
Conversation
i-riyad
marked this pull request as ready for review
August 24, 2026 21:06
i-riyad
force-pushed
the
rislam/mimo-checkpoint-compat-main
branch
from
August 24, 2026 21:11
910e062 to
0ceddb7
Compare
Add an optional Transformer Engine normalization layer after expert-output combination and before the latent MoE up-projection. This preserves the architecture encoded by GDP checkpoints while leaving the existing path unchanged by default. Signed-off-by: Riyad Islam <rislam@nvidia.com>
Force moe_use_norm_before_up_proj from checkpoint arguments alongside moe_latent_size so inference constructs and consumes the checkpoint's fc2_norm weights. Signed-off-by: Riyad Islam <rislam@nvidia.com>
i-riyad
force-pushed
the
rislam/mimo-checkpoint-compat-main
branch
from
August 24, 2026 22:45
0ceddb7 to
d4eee06
Compare
yaox12
approved these changes
Aug 26, 2026
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?
Add an optional normalization layer after LatentMoE expert-output combination and before the latent up-projection:
The option is exposed as
moe_use_norm_before_up_projand remains disabled by default, so existing LatentMoE models are unchanged.When enabled,
TENormselects LayerNorm or RMSNorm from the existing transformer configuration and usesmoe_latent_sizeas the normalized dimension. The LatentMoE projection path already requires Transformer Engine.This PR also restores
moe_use_norm_before_up_projfrom checkpoint arguments alongsidemoe_latent_size. This ensures checkpoint loading reconstructs the norm module and consumes savedmlp.fc2_norm.weighttensors. Without restoring the option, strict checkpoint auditing reports those tensors as unconsumed because the runtime model does not constructfc2_norm.Regression coverage exercises normalized LatentMoE execution across dispatcher, expert implementation, grouped-GEMM, and latent-size combinations, plus checkpoint-argument restoration.
Related PR: #6449 proposes similar normalized-LatentMoE behavior under the configuration name
moe_latent_output_normand targetsdev. This PR retainsmoe_use_norm_before_up_projbecause that key is persisted in existing GDP checkpoint metadata. The naming or compatibility approach can be aligned during review.Issue tracking
Linked issue: N/A — compatibility fix for existing LatentMoE checkpoints.
Testing
BASE_REF=main CHECK_ONLY=true SKIP_DOCS=false bash tools/autoformat.sh557079:TestLatentMoELayer::test_latent_moe_layeracross all 12 parameter combinationstest_load_args_restores_latent_moe_norm_from_checkpointacross both parameter combinationsContribution process
Pre-checks
Code review
Feel free to message or comment @NVIDIA/mcore-oncall to help accelerate review.
All PRs start as draft. Mark this PR ready only after CI is passing.