Skip to content

[megatron] integrate MCore blackwell linear_cross_entropy fusion kernel#5130

Open
HaochenYuan wants to merge 2 commits intoverl-project:mainfrom
HaochenYuan:main
Open

[megatron] integrate MCore blackwell linear_cross_entropy fusion kernel#5130
HaochenYuan wants to merge 2 commits intoverl-project:mainfrom
HaochenYuan:main

Conversation

@HaochenYuan
Copy link
Contributor

@HaochenYuan HaochenYuan commented Jan 30, 2026

What does this PR do?

  • Integrate fused lm_head & cross-entropy kernel from megatron link. Currently only support blackwell.
  • Add GB300/B300 flops data.

The test is done on B300 with Qwen3-30B-A3B.

Checklist Before Starting

  • Search for similar PRs. Paste at least one query link here: ...
  • Format the PR title as [{modules}] {type}: {description} (This will be checked by the CI)
    • {modules} include fsdp, megatron, veomni, sglang, vllm, rollout, trainer, ci, training_utils, recipe, hardware, deployment, ray, worker, single_controller, misc, perf, model, algo, env, tool, ckpt, doc, data, cfg, reward
    • If this PR involves multiple modules, separate them with , like [megatron, fsdp, doc]
    • {type} is in feat, fix, refactor, chore, test
    • If this PR breaks any API (CLI arguments, config, function signature, etc.), add [BREAKING] to the beginning of the title.
    • Example: [BREAKING][fsdp, megatron] feat: dynamic batching

Test

For changes that can not be tested by CI (e.g., algorithm implementation, new model support), validate by experiment(s) and show results like training curve plots, evaluation results, etc.

API and Usage Example

Demonstrate how the API changes if any, and provide usage example(s) if possible.

# Add code snippet or script demonstrating how to use this

Design & Code Changes

Demonstrate the high-level design if this PR is complex, and list the specific changes.

Checklist Before Submitting

Important

Please check all the following items before requesting a review, otherwise the reviewer might deprioritize this PR for review.

@ISEEKYAN
Copy link
Collaborator

ISEEKYAN commented Feb 3, 2026

Hi @HaochenYuan, I would like to remove the verl/models/mcore/model_forward_fused.py and make this fused kernel called inside mcore, so we don't need to maintain another forward_function as a entrance, the only need is to add a transformer_config to enable this kernel.
But existing kernel only supports Blackwell, it will be necessary to Hopper for RL workloads now. NVIDIA/Megatron-LM#3076

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