[Inference] Add MCore inference examples and model wrappers#3897
Merged
Conversation
Signed-off-by: Chen Cui <chcui@nvidia.com>
|
Auto-sync is disabled for draft pull requests in this repository. Workflows must be run manually. Contributors can view more details about this message here. |
Signed-off-by: Chen Cui <chcui@nvidia.com>
Signed-off-by: Chen Cui <chcui@nvidia.com>
Signed-off-by: Chen Cui <chcui@nvidia.com>
…4697 Signed-off-by: Chen Cui <chcui@nvidia.com> # Conflicts: # 3rdparty/Megatron-LM
Signed-off-by: Chen Cui <chcui@nvidia.com>
Signed-off-by: Chen Cui <chcui@nvidia.com>
Signed-off-by: Chen Cui <chcui@nvidia.com>
Signed-off-by: Chen Cui <chcui@nvidia.com>
yaoyu-33
approved these changes
May 29, 2026
vasunvidia
pushed a commit
to vasunvidia/Megatron-Bridge
that referenced
this pull request
Jun 10, 2026
…eMo#3897) Signed-off-by: Chen Cui <chcui@nvidia.com> Signed-off-by: Vasudevan Rengasamy <vrengasamy@nvidia.com>
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.
Summary
examples/inference/text_generation.py.examples/inference/.examples/inference/text_generation.pyas the efficient inference entry point.examples/conversion/hf_to_megatron_generate_text.pyas a debugging/parity-forward path rather than the primary inference path.Dependency
Depends on unmerged MCore PR: NVIDIA/Megatron-LM#4697
The new examples import the high-level inference APIs from that PR, including
MegatronLLM,MegatronAsyncLLM, andServeConfig.Validation
uv run --no-sync pre-commit run --all-filesModel Wrapper Runtime Notes
examples/models/gpt_oss/inference.shtext_generation.py --use-legacy-generation --attention-backend localcheck produced good chat-template outputs (4forWhat is 2+2?and a coherent greeting). Dynamic generation runs but produces repetitive output; TEunfusedstatic generation runs but produced empty text.examples/models/bailing/inference.shinclusionAI/Ling-flash-2.0withTP=1 EP=8; generated text:I'm trying to solve this programming problem.examples/models/falcon_h1/inference.shtiiuae/Falcon-H1-0.5B-Instruct; generated text:**Answer:** Artificial intelligence.examples/models/glm47/inference.shexamples/models/sarvam/inference.shAI is a broad field of computer science that aims to create machines that can.examples/models/glm/glm5/slurm_inference.shzai-org/GLM-5.1withTP=2 EP=32and reaches model load/inference setup, but does not produce generated text; both 100-token and 1-token runs timed out at the 30-minute job limit.examples/models/glm47/slurm_inference.shexamples/models/minimax/minimax_m2/slurm_inference.shMiniMaxAI/MiniMax-M2withTP=1 EP=16andinference_moe_token_dispatcher_type=nccl; generated text:AI.examples/models/nemotron/nemotron_3/nano/nvidia/NVIDIA-Nemotron-3-Nano-30B-A3B-Base-BF16, but the short sample was weak:What is machine learning? What is deep.examples/models/nemotron/nemotron_3/super/nvidia/NVIDIA-Nemotron-3-Super-120B-A12B-BF16withinference_moe_token_dispatcher_type=nccl; generated text:AI is the ability.Note:
uv run pre-commit run --all-fileswithout--no-syncwas not usable in the local environment because dependency resolution requires a platform-specificnvidia-resiliency-ext==0.6.0wheel that is unavailable there.