SALM with NeMo Automodel integration for Nemotron Nano V3 LLM backbone#15447
Merged
SALM with NeMo Automodel integration for Nemotron Nano V3 LLM backbone#15447
Conversation
Signed-off-by: Piotr Żelasko <pzelasko@nvidia.com>
Signed-off-by: Piotr Żelasko <pzelasko@nvidia.com>
Signed-off-by: Piotr Żelasko <petezor@gmail.com>
…eechlm-yifan-mod-port
Signed-off-by: Piotr Żelasko <petezor@gmail.com>
Signed-off-by: Piotr Żelasko <petezor@gmail.com>
Signed-off-by: Piotr Żelasko <petezor@gmail.com>
Signed-off-by: Piotr Żelasko <petezor@gmail.com>
Signed-off-by: Piotr Żelasko <petezor@gmail.com>
Signed-off-by: Piotr Żelasko <petezor@gmail.com>
Signed-off-by: Piotr Żelasko <petezor@gmail.com>
Signed-off-by: Piotr Żelasko <petezor@gmail.com>
Signed-off-by: Piotr Żelasko <petezor@gmail.com>
Signed-off-by: Piotr Żelasko <pzelasko@nvidia.com>
Signed-off-by: Piotr Żelasko <petezor@gmail.com>
…IDIA-NeMo/NeMo into speechlm2-with-nemo-automodel
Signed-off-by: Piotr Żelasko <petezor@gmail.com>
Signed-off-by: Piotr Żelasko <petezor@gmail.com>
Signed-off-by: Piotr Żelasko <petezor@gmail.com>
Signed-off-by: Piotr Żelasko <petezor@gmail.com>
Signed-off-by: Piotr Żelasko <petezor@gmail.com>
…automodel's utility Signed-off-by: Piotr Żelasko <petezor@gmail.com>
…full LLM Signed-off-by: Piotr Żelasko <petezor@gmail.com>
Signed-off-by: Piotr Żelasko <petezor@gmail.com>
Signed-off-by: Piotr Żelasko <pzelasko@nvidia.com>
Signed-off-by: Piotr Żelasko <petezor@gmail.com>
Signed-off-by: Piotr Żelasko <petezor@gmail.com>
Signed-off-by: Piotr Żelasko <petezor@gmail.com>
Signed-off-by: Piotr Żelasko <petezor@gmail.com>
Signed-off-by: pzelasko <pzelasko@users.noreply.github.com>
Signed-off-by: Piotr Żelasko <pzelasko@nvidia.com>
Signed-off-by: Piotr Żelasko <petezor@gmail.com>
Signed-off-by: Piotr Żelasko <pzelasko@nvidia.com>
Signed-off-by: pzelasko <pzelasko@users.noreply.github.com>
Signed-off-by: Piotr Żelasko <petezor@gmail.com>
nithinraok
previously approved these changes
Apr 14, 2026
Member
nithinraok
left a comment
There was a problem hiding this comment.
LGTM.
Pls move common AutoModel classes to common collection for re-use later.
Signed-off-by: Piotr Żelasko <petezor@gmail.com>
…tainer Signed-off-by: Piotr Żelasko <petezor@gmail.com>
Signed-off-by: Piotr Żelasko <pzelasko@nvidia.com>
Contributor
|
[🤖]: Hi @pzelasko 👋, We wanted to let you know that a CICD pipeline for this PR just finished successfully. So it might be time to merge this PR or get some approvals. |
stevehuang52
approved these changes
Apr 17, 2026
Collaborator
stevehuang52
left a comment
There was a problem hiding this comment.
Thanks for the great work, LGTM~!
By the way, do we have any kind of CI on the uv.lock file? Seems unsafe if all PRs need to change this file for few thousands of lines...
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.
Important
The
Update branchbutton must only be pressed in very rare occassions.An outdated branch is never blocking the merge of a PR.
Please reach out to the automation team before pressing that button.
What does this PR do ?
Add
SALMAutomodel— a new SALM variant that uses NeMo Automodel instead of HuggingFace Transformers for the LLM backbone, enabling efficient training and inference of Speech LLMs with MoE architectures (e.g., Nemotron Nano V3 30B/3B) via native FSDP2, TP, EP, and Grouped GEMM support. CP support will be added later and PP support is not planned.Collection: speechlm2, common
Changelog
SALMAutomodelmodel class (nemo/collections/speechlm2/models/salm_automodel.py) — aLightningModulethat replaces HFAutoModelForCausalLMwith NeMo Automodel's distributed LLM loader, supporting deferred initialization viaconfigure_model()for memory-efficient per-GPU shard loading.AutomodelParallelStrategy(nemo/collections/speechlm2/parts/parallel.py) — a custom LightningModelParallelStrategythat delegates device mesh creation to NeMo Automodel, supporting FSDP2, TP, PP, CP, EP (MoE), and HSDP.nemo/collections/speechlm2/parts/automodel_lora.py) — replaces HuggingFace PEFT with Automodel's built-inModuleMatcher-based LoRA, applied before FSDP2 sharding for correct meta-device handling.FlashPrecisionplugin (nemo/utils/trainer_utils.py) — a newbf16-flash/fp16-flashprecision mode that sets module dtype without mutatingtorch.set_default_dtype, preventing dtype conflicts with Automodel's internal initialization.FlashOptimcompatibility patch (nemo/core/optim/flash_optim.py) — fixesDTensor.from_local()shape inference for unevenly-sharded FSDP2 parameters during DCP save/load.NemotronNanoV3PromptFormatter(nemo/collections/common/prompts/nemotron_nano_v3.py) with<think>reasoning support.dp_replicate/dp_shardnaming).init_from_checkpointsupport for fine-tuning from DCP directories, HuggingFace directories, and single-file.ckptcheckpoints.to_hf.pysupport for distributed models (gathering DTensor shards before export).speechlm2pip extra inpyproject.toml/setup.pyand uv index configuration for torch CUDA sources.tutorials/speechlm2/SpeechLM_With_NeMo_Automodel.ipynb).docs/source/speechlm2/(models, configs, training/scaling, mixed precision).examples/speechlm2/conf/salm_automodel.yamlwith Nemotron Nano V3 defaults.test_salm_automodel.py,test_salm_automodel_lora.py,test_parallel.py,test_datamodule_parallel.py,test_init_from_checkpoint.py,test_flash_optim.py,test_flash_precision.py,test_nemotron_nano_v3_prompt_formatter.py, and CI integration test script.SALMandSALMAutomodelinto independent classes (no inheritance), selectable viamodel.use_nemo_automodelconfig flag.Usage
GitHub Actions CI
The Jenkins CI system has been replaced by GitHub Actions self-hosted runners.
The GitHub Actions CI will run automatically when the "Run CICD" label is added to the PR.
To re-run CI remove and add the label again.
To run CI on an untrusted fork, a NeMo user with write access must first click "Approve and run".
Before your PR is "Ready for review"
Pre checks:
PR Type:
If you haven't finished some of the above items you can still open "Draft" PR.
Who can review?
Anyone in the community is free to review the PR once the checks have passed.
Contributor guidelines contains specific people who can review PRs to various areas.
Additional Information
nemo_automodelis added as an optional dependency via thespeechlm2pip extra (pip install nemo_toolkit[speechlm2]).FlashPrecisionplugin (renamed fromAutomodelPrecision) is placed innemo/utils/trainer_utils.pyfor reuse by other collections (e.g., TTS) in subsequent PRs.uv.lockchanges are large due to adding thenemo_automodeldependency tree; the actual code changes are ~5,966 lines added across 59 files (excluding lock file).