Skip to content

Verify EMA checkpoint resume compatibility - #16410

Closed
pzelasko wants to merge 1 commit into
mainfrom
codex/improve-ema-checkpoint-loading
Closed

pzelasko wants to merge 1 commit into
mainfrom
codex/improve-ema-checkpoint-loading

Conversation

@pzelasko

@pzelasko pzelasko commented Oct 20, 2026 •

Copy link
Copy Markdown
Collaborator

What does this PR do ?

Add dedicated EMA companion-checkpoint regression coverage and documentation for the implementation already merged into main in #16504.

Collection: Common, ASR.

Implementation is already in main via #16504. This PR targets main and adds only EMA regression tests and documentation; it makes no additional runtime changes.

Changelog

  • Test plain, structured CTC, and structured multitask configurations with SGD and Adam companion checkpoints.
  • Check restored EMA tensors, step counters, optimizer options, Adam moments, and path metadata.
  • Retain rejected-object/reducer, interpolation, and registration-preservation coverage.
  • Verify validation, testing, and prediction do not require companion optimizer state.
  • Document EMA resume and evaluation behavior in the existing callback guide.

Usage

Existing EMA training and evaluation interfaces remain unchanged. The loading implementation and schema registrations were delivered by #16504; this follow-up adds their dedicated regression coverage and callback guide.

GitHub Actions CI

This follow-up targets main after #16504 merged. CI and review apply to the current published head.

Before your PR is "Ready for review"

Pre checks:

  • Followed contributor guidelines and verified exact published author/DCO identity matches.
  • Added regression tests, including the requested multitask optimizer cases.
  • Updated the existing callback documentation.
  • Kept collection-specific schema registration in its source modules in the parent.

PR Type:

  • Bugfix
  • Documentation

Additional Information

Validation previously run on these changes with Lightning/PyTorch Lightning 2.6.6, before the parent merged:

  • CUDA_VISIBLE_DEVICES='' OMP_NUM_THREADS=2 python -m pytest tests/collections/common/test_ema_checkpoint_security.py tests/collections/common/test_ema.py tests/utils/test_lightning_callback_defaults.py tests/core/test_lightning_checkpoint_compatibility.py tests/core/test_dependency_compatibility.py --cpu -q -m 'not pleasefixme' --timeout=180: 90 passed, 14 skipped.
  • PYTHONPATH=/tmp/speech-checkpoint-loading CUDA_VISIBLE_DEVICES='' python -m sphinx -b html -W --keep-going -E docs/source /tmp/nov6-stack-docs: passed.
  • pre-commit run --from-ref origin/codex/update-training-dependency-compatibility --to-ref HEAD, full-branch pre-commit run --from-ref origin/main --to-ref HEAD, and diff checks: passed.
  • Published ancestry, a single child commit, and exact author/sign-off identity verification: passed.

The new multitask and evaluation cases reproduced failures before the corresponding parent support was aligned. GPU/distributed workloads and released Canary inference fixtures were not validated locally; the relevant model assets are available to CI. Existing device-dependent tests remain skipped locally.

@copy-pr-bot

copy-pr-bot Bot commented Oct 20, 2026

Copy link
Copy Markdown

This pull request requires additional validation before any workflows can run on NVIDIA's runners.

Pull request vetters can view their responsibilities here.

Contributors can view more details about this message here.

@pzelasko

Copy link
Copy Markdown
Collaborator Author

/ok to test 484af90

@pzelasko

Copy link
Copy Markdown
Collaborator Author

/review

@svcnvidia-nemo-ci svcnvidia-nemo-ci left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed all three changed files and the affected checkpoint save/load paths. One blocking compatibility regression remains: restricted loading rejects structured configuration metadata that NeMo itself writes.

The new security test covers executable-reducer rejection, but the compatibility fixtures use only untyped configurations and miss this producer case. The callback documentation describes the intended restricted-loading policy; its compatibility promise needs the correction below.

Static source review only; tests were not executed.

Note: formal approval is not available for this request, so this review is posted as a comment only.

Review generated by codex. This was a full review. Request a full review with /review reset=true.

@github-actions

Copy link
Copy Markdown
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.

@github-actions github-actions Bot added the ASR label Nov 2, 2026
@pzelasko

pzelasko commented Nov 2, 2026

Copy link
Copy Markdown
Collaborator Author

/ok to test 2d6a4a6

@pzelasko

pzelasko commented Nov 2, 2026

Copy link
Copy Markdown
Collaborator Author

/review

@pzelasko

pzelasko commented Nov 2, 2026

Copy link
Copy Markdown
Collaborator Author

/review

@svcnvidia-nemo-ci svcnvidia-nemo-ci left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The structured-configuration fix addresses the previous blocker. No unresolved prior finding or eligible new regression remains, so I recommend approval within this follow-up’s scope.

I inspected all six changed files and compared the follow-up changes with the previously reviewed head. The schema registration and expanded typed-node allowlist address the concrete CTC configuration failure from review 5700855628/comment 4414690353. The regression fixture now covers that configuration with SGD and Adam, including EMA tensors, current step, optimizer options, and Adam moments.

I also traced schema import order, companion checkpoint production, optimizer restoration, restricted annotation loading, and registration preservation. The EMA loader retains weights_only=True and changes optimizer state only after successful loading. The callback documentation remains consistent with that path.

This was a follow-up review, retaining the historical moderate-impact threshold for new findings—not a fresh broad review. Static source review only; I did not execute tests, build the documentation, or independently verify commit-author/sign-off identities.

Review generated by codex. This was a findings-only review. Request a full review with /review reset=true.

@github-actions

github-actions Bot commented Nov 3, 2026

Copy link
Copy Markdown
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.

@pzelasko pzelasko added the r3.1.0 Auto-cherrypick to release branch. Apply before merge; cherrypick happens after merge. label Nov 4, 2026

@nithinraok nithinraok left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The restricted EMA load improves checkpoint safety, but it needs to support the structured MultiTaskDecodingConfig that EncDecMultiTaskModel can add to its own config. Please register that trusted schema and add a companion-checkpoint resume test for it. Keep the existing tests that reject unsupported pickle objects.

The new tests cover CTC structured config, SGD and Adam state, and rejected reducers. They do not cover the multitask schema. The callback guide describes the restricted loading policy, but the supported NeMo-generated config case needs the compatibility fix above.

@nithinraok nithinraok mentioned this pull request Nov 6, 2026
5 tasks done
@pzelasko

pzelasko commented Nov 6, 2026

Copy link
Copy Markdown
Collaborator Author

/ok to test c0dc27b

@pzelasko

pzelasko commented Nov 6, 2026

Copy link
Copy Markdown
Collaborator Author

/review

@pzelasko pzelasko changed the title Improve EMA checkpoint loading Verify EMA checkpoint resume compatibility Nov 6, 2026
@pzelasko
pzelasko force-pushed the codex/improve-ema-checkpoint-loading branch from c0dc27b to 08ea606 Compare November 6, 2026 18:33
@pzelasko
pzelasko requested a review from a team as a code owner November 6, 2026 18:33
@pzelasko
pzelasko changed the base branch from main to codex/update-training-dependency-compatibility November 6, 2026 18:33
@pzelasko

pzelasko commented Nov 6, 2026

Copy link
Copy Markdown
Collaborator Author

/ok to test 08ea606

@pzelasko

pzelasko commented Nov 6, 2026

Copy link
Copy Markdown
Collaborator Author

/review

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

only test case addition?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes—this PR now adds only tests and documentation. During deduplication, the shared serialization/schema support and EMA loading implementation were consolidated into #16504, which has since merged into main. I verified that main contains both restricted EMA loading and MultiTaskDecodingConfig registration. This follow-up adds the dedicated plain/CTC/multitask SGD/Adam resume regressions, rejection cases, evaluation coverage, and callback documentation. I updated the description to remove the stale stack instructions and make that scope explicit.

@github-actions

github-actions Bot commented Nov 6, 2026

Copy link
Copy Markdown
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.

Base automatically changed from codex/update-training-dependency-compatibility to main November 9, 2026 14:21
@pzelasko
pzelasko force-pushed the codex/improve-ema-checkpoint-loading branch from 08ea606 to af4deb7 Compare November 9, 2026 14:21
@pzelasko pzelasko closed this Nov 12, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

r3.1.0 Auto-cherrypick to release branch. Apply before merge; cherrypick happens after merge.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants