Repository navigation
Integrate OneLogger across NeMo Speech training - #16255
Conversation
Signed-off-by: Piotr Żelasko <[email protected]>
Signed-off-by: Piotr Żelasko <[email protected]>
Signed-off-by: Piotr Żelasko <[email protected]>
Signed-off-by: Piotr Żelasko <[email protected]>
Signed-off-by: Piotr Żelasko <[email protected]>
Signed-off-by: Piotr Żelasko <[email protected]>
Signed-off-by: Piotr Żelasko <[email protected]>
Signed-off-by: Piotr Żelasko <[email protected]>
Signed-off-by: Piotr Żelasko <[email protected]>
Signed-off-by: Piotr Żelasko <[email protected]>
…h-integration Signed-off-by: Piotr Żelasko <[email protected]>
Signed-off-by: Piotr Żelasko <[email protected]>
743652e to
5aed0ae
Compare
Signed-off-by: Piotr Żelasko <[email protected]>
Signed-off-by: Piotr Żelasko <[email protected]>
Signed-off-by: Piotr Żelasko <[email protected]>
Signed-off-by: Piotr Żelasko <[email protected]>
| transcribe_with_whisper_from_filepaths, | ||
| ) | ||
| from nemo.lightning.callback_group import CallbackGroup | ||
| from nemo.lightning.callback_group import with_callback_context |
There was a problem hiding this comment.
Do you know what these changes do?
There was a problem hiding this comment.
It adds a PTL callback that collects metrics and events+timing to report to OneLogger on relevant events (model/dataloader/optimizer init, training step begin/end, etc). I agree these names are way too vague, will improve.
Signed-off-by: Piotr Żelasko <[email protected]>
Signed-off-by: Piotr Żelasko <[email protected]>
svcnvidia-nemo-ci
left a comment
There was a problem hiding this comment.
The OneLogger integration has no eligible blockers in this follow-up. I recommend approval within the follow-up scope.
Compared with the latest reviewed head, the only change is adding tests/lightning to the CPU core test command. Production code, telemetry tests, dependencies, and documentation are unchanged. I traced the added test collection through the CI workflow, container dependencies, CPU settings, and coverage collection and found no qualifying introduced regression.
The previously verified fixes remain present: callback ordering and window accounting, codec sample rates and multiturn token counts, and MPI rank selection.
I inspected all changed files for coverage. Discovery remained limited to the follow-up changes, with new findings required to exceed the historical moderate-impact ceiling. I covered the collection-policy assignment directly because its delegated report wasn't available.
This was static source review. I didn't execute tests, build the container or documentation, measure coverage, run GPU/distributed workloads, or independently verify commit-author/sign-off matching.
Review generated by codex. This was a findings-only review. Request a full review with /review reset=true.
|
[🤖]: 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. |
Signed-off-by: Piotr Żelasko <[email protected]>
|
/ok to test 7fcea46 |
|
[🤖]: 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. |
Signed-off-by: Piotr Żelasko <[email protected]>
|
/ok to test f30c7e8 |
|
/review |
svcnvidia-nemo-ci
left a comment
There was a problem hiding this comment.
This adds opt-in OneLogger lifecycle and modality-aware throughput telemetry. I found no eligible blockers and recommend approval within the follow-up scope.
I checked the changes since the latest reviewed head:
- The strategy-loader wrapper preserves the concrete loader, bound signature, arguments, return value, and exception path. The new regression tests cover repeated attachment, checkpoint-policy arguments, failures, pickle round-trips, disabled operation, and real CPU Trainer resume. The documentation describes the added behavior.
- The main-merge reconciliation retains configuration snapshots, checkpoint scheduling state and argument forwarding, and opt-in callback registration.
- The earlier fixes remain present, including checkpoint and accumulation-window regressions, codec and multiturn work-unit assertions, and MPI rank-selection assertions.
I inspected all 44 changed files for coverage and traced the directly affected contracts. Discovery remained limited to changes after the clean baseline review; new findings had to exceed the historical moderate-impact ceiling.
This was static source review. I didn't execute tests, build documentation or containers, run GPU/distributed workloads, or independently verify commit-author/sign-off matching. Reported validation results weren't reproduced.
Review generated by codex. This was a findings-only review. Request a full review with /review reset=true.
|
[🤖]: 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. |
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 ?
Integrates opt-in OneLogger lifecycle and dynamic, modality-aware throughput telemetry across NeMo Speech without imposing LLM-specific batch or sequence assumptions.
Collection: ASR, TTS, SpeechLM2, Audio, Core/Lightning
Changelog
exp_managerfor ModelPT and plain LightningModule workflows whenNEMO_ONE_LOGGER_ENABLED=true.None.nemo-speech.speech_throughputmodule.multimodal_tokensfor every SALM variant.mean_batch_sizeover optimizer steps so gradient accumulation is included._per_examplemetrics.Usage
Set
NEMO_ONE_LOGGER_ENABLED=truebefore starting training. Entry points that callexp_manager()then attach the integration automatically, and rank zero exports telemetry.Throughput uses a minimum interval of 100 training batches by default, or a larger
trainer.log_every_n_stepsvalue. SetNEMO_ONE_LOGGER_THROUGHPUT_INTERVALto a positive batch count to override that minimum. With gradient accumulation, normal windows close at the next optimizer-step boundary.Validation
CUDA_VISIBLE_DEVICES='' OMP_NUM_THREADS=2 python -m pytest tests/lightning/test_speech_throughput.py tests/lightning/test_one_logger_callback.py --cpu -q --timeout=120on the pinned Lightning 2.4 environment: 73 passed.CUDA_VISIBLE_DEVICES='' OMP_NUM_THREADS=2 python -m pytest tests/core/test_dependency_compatibility.py tests/core/test_exp_manager.py tests/core/test_save_restore.py tests/core/test_serialization.py tests/lightning/test_one_logger_callback.py tests/lightning/test_speech_throughput.py tests/collections/asr/test_asr_ctcencdec_model.py tests/collections/asr/test_asr_ctc_encoder_model_bpe.py tests/collections/tts/models/test_magpietts_dataloader_config.py tests/core/test_optimizers_schedulers.py --cpu -q -m 'not pleasefixme' --timeout=180— 223 passed, 11 skipped, 2 deselected.False,True, andNoneforwarding.pre-commit run --from-ref origin/main --to-ref HEAD,git diff --check, and lock consistency checks passed.GitHub Actions CI
Trusted PRs run automatically through copy-pr-bot.
Before your PR is "Ready for review"
Pre checks:
PR Type:
Additional Information
Current main integration on Lightning/PyTorch Lightning 2.6.6 and Hydra 1.3.8:
CUDA_VISIBLE_DEVICES='' OMP_NUM_THREADS=2 python -m pytest tests/lightning --cpu -q -m 'not pleasefixme' --timeout=180: 93 passed.CUDA_VISIBLE_DEVICES='' OMP_NUM_THREADS=2 TORCH_FORCE_NO_WEIGHTS_ONLY_LOAD=1 python -m pytest tests/core tests/core_ptl tests/lightning tests/utils/test_lightning_callback_defaults.py --cpu -q -m 'not pleasefixme' --timeout=180: 569 passed, 8 skipped, 2 deselected.PYTHONPATH=/tmp/speech-onelogger-compat CUDA_VISIBLE_DEVICES='' python -m sphinx -b html -W --keep-going -E docs/source /tmp/nov9-onelogger-docs: passed.uv lock --check --python /tmp/speech-lightning26-env/bin/python, Pylint 4.1.3 and flake8 with the speech/other configurations on all changed sources, full-branch pre-commit, and diff checks: passed.Earlier validation:
No public API removals or incompatible configuration changes.
Review follow-up validation
Correct callback ordering and completed-batch accounting around checkpoint and validation boundaries. Require both window boundaries to align before reporting per-step means. Use codec output sample rates, count valid multiturn text tokens, and support MPI rank/world-size metadata. Update the telemetry documentation.
CUDA_VISIBLE_DEVICES='' OMP_NUM_THREADS=2 python -m pytest tests/lightning/test_one_logger_windows.py tests/lightning/test_speech_throughput.py tests/lightning/test_one_logger_callback.py --cpu -q --timeout=120: 86 passed. Includes a real Trainer/checkpoint integration and deferred-event cases.PYTHONPATH=/tmp/speech-onelogger-compat CUDA_VISIBLE_DEVICES='' python -m sphinx -b html -W --keep-going docs/source /tmp/onelogger-review-docs: passed without warnings.Local merge-order qualification with Update training dependency compatibility #16504 and Lightning/PyTorch Lightning 2.6.6:
CUDA_VISIBLE_DEVICES='' OMP_NUM_THREADS=2 python -m pytest tests/lightning/test_one_logger_windows.py tests/lightning/test_speech_throughput.py tests/lightning/test_one_logger_callback.py tests/core/test_exp_manager.py tests/collections/tts/data/test_audio_codec_dataset_lhotse.py tests/core/test_dependency_compatibility.py --cpu -q -m 'not pleasefixme' --timeout=180: 145 passed, 1 skipped, 1 deselected. In the temporary combined tree, callback registration and callback tests use this PR's versions to restore telemetry after Update training dependency compatibility #16504.Standalone broader validation with legacy Lightning: 124 passed, 1 failed, 1 skipped, 1 deselected. The existing
TestExpManager.test_last_checkpoint_saveddirect-load failure was reproduced unchanged on the previous published head; Update training dependency compatibility #16504 supplies the configuration registration it needs. The combined qualification above passes that test. Update training dependency compatibility #16504 is now merged into main; the current integration validation below covers both implementations together.Full collection suites were not run. SpeechLM2 GPU/distributed qualification is recorded below.
pre-commit run --from-ref origin/main --to-ref HEAD,git diff --check, and exact author/sign-off verification: passed.The final follow-up also simplifies test imports for static analysis; the same 86-test focused command and complete-branch formatting/DCO checks pass after that cleanup.
CI follow-up: include
tests/lightningin the existing CPU core test script so lifecycle and throughput regressions contribute to coverage. Workflow configuration and coverage thresholds are unchanged.CUDA_VISIBLE_DEVICES='' OMP_NUM_THREADS=2 TORCH_FORCE_NO_WEIGHTS_ONLY_LOAD=1 python -m pytest tests/core tests/core_ptl tests/lightning --cpu -q -m 'not pleasefixme' --timeout=180: 446 passed, 9 skipped, 2 deselected. The OneLogger directory alone passes 86 tests. A local coverage run over those 86 tests covers 590/647 (91.19%) changed executable lines within the patch gate's included paths, compared with the reported CI result of 38.37%; the published CI measurement must confirm the result. The temporary local coverage configuration removed only the/tmp/*omission because the checkout is under/tmp; the repository coverage configuration was not changed.bash -n tests/functional_tests/L0_Unit_Tests_CPU_Core.sh, full-branch pre-commit, diff checks, and remote author/sign-off verification passed. No production behavior or user documentation changed.SpeechLM2 GPU qualification (2026-11-05)
Checkpoint-load tracing is fixed in 7fcea46060. Six new regression checks fail on the previous head and pass after the fix; disabled-mode behavior stays unchanged.
nemo_speech.checkpoint_loadspan: 3600 ms. A real plain-Lightning checkpoint resume also emits exactly one completed load span: 1 ms. These checkpoint probes preserve existing checkpoint policies and use the real OneLogger SDK/FileExporter.Representative actual full-model throughput event (
policy=salm,scope=rank,rank=0, global step 10):The ten-step rank-zero trace reports 327,680 multimodal tokens in five windows. Median steady step time was 4.31 s; these short checks are not a statistical overhead benchmark. Full 33B model/optimizer checkpoint resume, recognition quality, other speechlm2 architectures, and multi-node scaling were not qualified; the small distributed probe exercises the exact Automodel DCP loader, while production-model training and dataloader restoration were checked separately.
The first in-allocation unit-test invocation inherited the smoke reporting interval of two batches, causing three tests that assume default windows to fail. Rerunning with
NEMO_ONE_LOGGER_THROUGHPUT_INTERVALunset passed all 93 tests, without further production changes.