Skip to content

Megatron: Nemotron RL support - #51

Open
Zhichenzzz wants to merge 3 commits into
miles-mainfrom
mtp-hybrid
Open

Megatron: Nemotron RL support#51
Zhichenzzz wants to merge 3 commits into
miles-mainfrom
mtp-hybrid

Conversation

@Zhichenzzz

@Zhichenzzz Zhichenzzz commented Jun 3, 2026

Copy link
Copy Markdown

@Zhichenzzz Zhichenzzz changed the title nemotron_h: MTP support for hybrid (Mamba) models + RL training fixes Megatron: Nemotron RL support Jun 3, 2026
Zhichenzzz added 3 commits June 10, 2026 06:52
Squashed transplant of mtp-hybrid + cleanup pass:
- Design mirrors nvidia/main (parse_hybrid_pattern, mtp_model_layer rename,
  is_mtp_layer plumbing, standalone process_mtp_loss, MTP FLOPs accounting).
- Fixes the routing-replay MTP bypass regression (is_mtp_layer into the R3
  gate; the old Router.is_mtp flag had lost its only writer); removes dead
  set_is_mtp; upstream-form isinstance attn-mask validation; deduped
  arguments asserts; zero reformat-only churn.
- Carries the make_viewless_tensor dead-store fix and the vocab_size test
  typo fix.
- Rebased onto current miles-main (router layer_number / tid2eid / R3
  input_ids co-exist with is_mtp_layer).
The bridge/mamba path lacks the GPT provider's enable/disable dance
around MTP block construction, so MTP MoE routers registered replay
slots that the trainer-side fill (which only records main-decoder MoE
layers) never populates -- a main layer then pops an empty slot
(IndexError: len(top_indices_list)=0). Gate registration on
is_mtp_layer, mirroring the existing is_mtp bypass in topk routing.
The MambaStack layer builder passed is_mtp_layer to attention layers but
not to MoE layers, so MTP-block MoE routers saw is_mtp_layer=False --
defeating both the rollout-replay slot-registration skip and the
is_mtp topk bypass (the slot/fill desync then popped an empty replay:
IndexError len(top_indices_list)=0).
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.

1 participant