{{ message }}
Repository navigation
feat(speechlm): support native RL checkpoints and frozen CTC export #16387
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
+1,667
−101
Merged
Changes from all commits
Commits
Show all changes
19 commits
Select commit
Hold shift + click to select a range
de7b885
feat(speechlm): support native RL update surfaces and export
vmendelev 5f55cf6
Merge remote-tracking branch 'origin/main' into task/gspo-ctc-refresh…
vmendelev 1a996c5
feat(speechlm): preserve frozen CTC checkpoints in full-scale GSPO
vmendelev 8fa4682
test(speechlm): fix speechlm2 GPU CI failures
vmendelev 6e7f73e
fix(speechlm): avoid mixed returns in HFHubMixin._save_pretrained
vmendelev a8165e7
docs(speechlm): fix speechlm2 RST heading warnings
vmendelev 8a1b217
docs(speechlm): reference the NeMo RL GSPO guide without an unpublish…
vmendelev 4fd4c20
refactor(speechlm): address review comments on docs, comments, and we…
vmendelev 758f9c6
fix(speechlm): keep selected FP32 perception and CTC weights exact; a…
vmendelev 8896150
Merge remote-tracking branch 'origin/main' into task/speechlm-rl-main
vmendelev 18fe624
feat(speechlm): use Automodel FreezeConfig for partial-model training
vmendelev 792b2a7
fix(export): omit training freeze policies from serving checkpoints
vmendelev 260c54a
test(speechlm): skip exact FreezeConfig tests on older Automodel
vmendelev a854a2c
Preserve portable Nemotron-H layer names in SpeechLM exports
vmendelev f1e185b
fix(speechlm): retain absent MTP heads without creating them
vmendelev 5fd0166
docs(speechlm): explain GSPO training and export workflow
vmendelev ce16985
docs(speechlm): defer RL instructions to NeMo-RL guide
vmendelev b3567d0
docs(speechlm): simplify post-training guide pointer
vmendelev 5bc0c79
test(speechlm): compare native export weights on CPU
pzelasko File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,56 @@ | ||
| # Copyright (c) 2026, NVIDIA CORPORATION. All rights reserved. | ||
| # SPDX-License-Identifier: Apache-2.0 | ||
| """Build canonical native-RL export configuration from the original local HF seed.""" | ||
|
|
||
| import argparse | ||
| import json | ||
| from pathlib import Path | ||
|
|
||
| from nemo.collections.speechlm2.parts.ctc_timestamp_checkpoint import read_ctc_timestamp_config | ||
|
|
||
|
|
||
| def prepare_config(seed: Path, world_size: int, expert_parallel_size: int) -> dict: | ||
| seed = seed.resolve() | ||
| if world_size < 1 or expert_parallel_size < 1 or world_size % expert_parallel_size: | ||
| raise ValueError('World size must be positive and divisible by expert parallel size') | ||
| model = json.loads((seed / 'config.json').read_text()) | ||
| if not (seed / 'llm_backbone' / 'config.json').is_file(): | ||
| raise FileNotFoundError(seed / 'llm_backbone' / 'config.json') | ||
| model['pretrained_llm'] = str(seed / 'llm_backbone') | ||
| model['tokenizer_path'] = str(seed) | ||
| ctc_config = read_ctc_timestamp_config(seed / 'model.safetensors') | ||
| if ctc_config is not None: | ||
| model['ctc_timestamp_artifact'] = ctc_config | ||
| strategy = { | ||
| '_target_': 'nemo.collections.speechlm2.parts.parallel.AutomodelParallelStrategy', | ||
| 'dp_size': world_size, | ||
| 'dp_replicate_size': 1, | ||
| 'tp_size': 1, | ||
| 'pp_size': 1, | ||
| 'cp_size': 1, | ||
| 'ep_size': expert_parallel_size, | ||
| } | ||
| return {'model': model, 'trainer': {'strategy': strategy}} | ||
|
|
||
|
|
||
| def main() -> None: | ||
| parser = argparse.ArgumentParser(description=__doc__) | ||
| parser.add_argument('--seed', type=Path, required=True) | ||
| parser.add_argument('--output', type=Path, required=True) | ||
| parser.add_argument('--world-size', type=int, default=8) | ||
| parser.add_argument('--expert-parallel-size', type=int, default=8) | ||
| parser.add_argument('--strategy-overrides', type=json.loads, default={}) | ||
| parser.add_argument('--backend-config', type=json.loads) | ||
| args = parser.parse_args() | ||
| config = prepare_config(args.seed, args.world_size, args.expert_parallel_size) | ||
| config['trainer']['strategy'].update(args.strategy_overrides) | ||
| if args.backend_config is not None: | ||
| config['model']['automodel_backend'] = args.backend_config | ||
| args.output.parent.mkdir(parents=True, exist_ok=True) | ||
| with args.output.open('x') as output: | ||
| json.dump(config, output, indent=2) | ||
| output.write('\n') | ||
|
|
||
|
|
||
| if __name__ == '__main__': | ||
| main() |
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
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
Oops, something went wrong.
Oops, something went wrong.
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.
You can’t perform that action at this time.

Uh oh!
There was an error while loading. Please reload this page.