Skip to content

fix(moe): preserve MLP dispatch through checkpoint wrappers#2955

Merged
akoumpa merged 6 commits into
mainfrom
akoumparouli/fix/am-370-moe-dispatch
Jul 9, 2026
Merged

fix(moe): preserve MLP dispatch through checkpoint wrappers#2955
akoumpa merged 6 commits into
mainfrom
akoumparouli/fix/am-370-moe-dispatch

Conversation

@akoumpa

@akoumpa akoumpa commented Jul 7, 2026

Copy link
Copy Markdown
Contributor

What does this PR do ?

Fix GPT-OSS and Qwen3-MoE MLP dispatch after activation checkpointing wraps the decoder block's mlp module.

Root cause

The decoder blocks selected the dense or MoE call signature with a forward-time isinstance(self.mlp, ...) check. Activation checkpointing replaces self.mlp with a CheckpointWrapper before FSDP2 sharding, so the wrapped module is no longer recognized as MLP or MoE and the MoE assertion fails on the first forward pass.

The block already knows whether it is dense or MoE during construction. This change records that role and uses it for dispatch, independent of later wrappers.

Changelog

  • Preserve the GPT-OSS and Qwen3-MoE layer role through checkpoint wrapping.
  • Dispatch the dense and MoE call signatures from the construction-time role.
  • Add CPU regression coverage for checkpoint-wrapped GPT-OSS and Qwen3-MoE dispatch.
  • Update existing tests that replace a block's MLP to set the corresponding layer role.

Validation

nemo-ci pipeline references

Before your PR is "Ready for review"

Pre checks:

  • Read and followed the contributor guidelines.
  • Added regression tests.
  • Documentation is not required for this internal dispatch fix.

Additional Information

Signed-off-by: Alexandros Koumparoulis <akoumparouli@nvidia.com>
@copy-pr-bot

copy-pr-bot Bot commented Jul 7, 2026

Copy link
Copy Markdown

This pull request requires additional validation before any workflows can run on NVIDIA's runners.

Pull request vetters can view their responsibilities here.

Contributors can view more details about this message here.

@akoumpa

akoumpa commented Jul 7, 2026

Copy link
Copy Markdown
Contributor Author

/ok to test dabb4e1

Signed-off-by: Alexandros Koumparoulis <akoumparouli@nvidia.com>
@akoumpa

akoumpa commented Jul 7, 2026

Copy link
Copy Markdown
Contributor Author

/ok to test 26c8ed5

@akoumpa

akoumpa commented Jul 8, 2026

Copy link
Copy Markdown
Contributor Author

/ok to test 439295d

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