[Inference] Add MCore inference examples and model wrappers#3897
Draft
cuichenx wants to merge 2 commits into
Draft
[Inference] Add MCore inference examples and model wrappers#3897cuichenx wants to merge 2 commits into
cuichenx wants to merge 2 commits into
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>
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
tess/inference-mcore4697tochcui/inference-mcore4697.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-filesbash -nfor the new launcher scripts and updated model inference wrapperspython -m py_compilefor the new Python examplesgit diff --checkexamples/inference/text_generation.pyand no longer callexamples/conversion/hf_to_megatron_generate_text.pyruff checkfor the new inference examplesruff format --checkfor the new inference examplesexamples/inference/text_generation.pyfor synchronous AutoBridge text generationexamples/inference/async_text_generation.pyfor direct MCore async text generationexamples/inference/openai_server.pyand verified the OpenAI-compatible server reached readinessexamples/inference/text_generation.pywith the same TP/PP/EP shape used byexamples/models/gpt_oss/inference.shModel Wrapper Runtime Notes
examples/models/gpt_oss/inference.shexamples/models/bailing/inference.shexamples/models/falcon_h1/inference.shexamples/models/glm47/inference.shexamples/models/sarvam/inference.shexamples/models/glm/glm5/slurm_inference.shexamples/models/glm47/slurm_inference.shexamples/models/minimax/minimax_m2/slurm_inference.shNote:
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.