[Streaming SpeechLM] Add audomodel support - #16045
Draft
stevehuang52 wants to merge 4 commits into
Draft
Conversation
…STT)
StreamingSTTModelAutomodel is to StreamingSTTModel what SALMAutomodel is to
SALM: same streaming recipe, but the LLM is loaded and parallelized by NeMo
Automodel (FSDP2/HSDP/EP) instead of HuggingFace + DDP.
* Deferred construction: __init__ builds only the tokenizer; the LLM and
perception are created in configure_model(), which the Lightning strategy
calls with the device mesh so Automodel shards while loading.
* embed_tokens stays inside the LLM; lookups go through F.embedding on the
all-gathered weight, declaring the gradient Partial("avg") so the trainable
embedding table (needed to learn <blank>) is DP-reduced — FSDP2 does not
reduce it, since the lookup happens outside the LLM's forward.
* Added special tokens reuse the checkpoint's spare embedding rows; a sharded
table cannot be resized.
* LoRA via Automodel's PEFT (dim/alpha/dropout); HF-PEFT keys are rejected with
an actionable error. Adapters installed inside from_pretrained are re-enabled
after the LLM-body freeze, otherwise freeze_and_subset drops them silently.
* TP and CP are rejected at fit start (the interleaved audio/text sequence must
stay on one rank and the streaming loss is not DTensor-safe).
StreamingSTTModel gains small backend-indirection hooks (_embed_tokens,
_embed_ref_tensor, _llm_forward, _move_embedding_ctx, _lm_head_module,
_resize_llm_embeddings) and its __init__ is split into reusable helpers; the
HF-backed behavior is unchanged.
streaming_stt_train.py dispatches on model.use_nemo_automodel, mirroring
salm_train.py. New config: examples/speechlm2/conf/streaming_stt_automodel.yaml.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Signed-off-by: He Huang <heh@nvidia.com>
Signed-off-by: He Huang <heh@nvidia.com>
…omodel Signed-off-by: He Huang <heh@nvidia.com>
Signed-off-by: He Huang <heh@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. |
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.
Add automodel support to current streaming speechlm work