Skip to content

Add distillation checkpoint bundles - #2098

Closed
CharlelieLrt wants to merge 1 commit into
codex/diffusion-distribution-matchingfrom
codex/diffusion-checkpoint-bundle
Closed

CharlelieLrt wants to merge 1 commit into
codex/diffusion-distribution-matchingfrom
codex/diffusion-checkpoint-bundle

Conversation

@CharlelieLrt

@CharlelieLrt CharlelieLrt commented Oct 14, 2026 •

Copy link
Copy Markdown
Collaborator

Description

This PR adds CheckpointStateBundle so users can restart distillation with
their named models, optimizers, loss state, and optional random state.
The bundle composes the existing PhysicsNeMo checkpoint utilities without
changing their public API or saving private FastGen adapters:

bundle = CheckpointStateBundle(
    {"student": student, "fake_score": fake_score},
    optimizers={"student": student_optimizer, "fake_score": fake_optimizer},
    stateful={"loss": loss_fn},
)
bundle.save_checkpoint("checkpoints", epoch=20, include_rng=True)
bundle.load_checkpoint("checkpoints", epoch=20, restore_rng=True)

Users recreate matching components before loading and save at completed
optimizer updates. Distributed callers invoke the bundle on every rank and
restart with the same topology. The optional strategy in the next PR uses this
same bundle.

Checklist

  • This PR follows the contribution guidelines.
  • The documentation describes the API and its role in the stack.
  • This PR remains a draft.

Dependencies

If FastGen maintainers decline FastGen #44, we would close PhysicsNeMo #2100.
The preceding PhysicsNeMo stack would remain available.

Review process

Reviewers can compare this PR with its immediate parent. After a parent merges,
we update the remaining branches and their PR bases to keep each diff focused.

@CharlelieLrt CharlelieLrt added 2 - In Progress Currently a work in progress 5 - DO NOT MERGE Hold off on merging; see PR for details 5 - Merge After Dependencies Depends on another PR: do not merge out of order labels Oct 14, 2026
@copy-pr-bot

copy-pr-bot Bot commented Oct 14, 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.

@github-actions

Copy link
Copy Markdown
Contributor

CODEOWNERS review map

Current for commit b19f3dce85e4. An approval covers every file listed for that owner; one owner is sufficient for shared files.

⏳ @CharlelieLrt — 4 file(s)
  • docs/api/diffusion/distillation.rst
  • physicsnemo/diffusion/distillation/init.py
  • physicsnemo/diffusion/distillation/checkpoint.py
  • test/diffusion/test_distillation_checkpoint.py
⏳ @megnvidia — 1 file(s)
  • docs/api/diffusion/distillation.rst

No CODEOWNER

  • CHANGELOG.md

Comment /codeowners-info to refresh.

@CharlelieLrt
CharlelieLrt force-pushed the codex/diffusion-distribution-matching branch from 6d301d6 to 1f727bd Compare October 14, 2026 05:35
@CharlelieLrt
CharlelieLrt force-pushed the codex/diffusion-checkpoint-bundle branch from b19f3dc to 251d5db Compare October 14, 2026 05:35
@CharlelieLrt
CharlelieLrt force-pushed the codex/diffusion-checkpoint-bundle branch from 251d5db to 6fb97f0 Compare October 14, 2026 17:03
@CharlelieLrt
CharlelieLrt force-pushed the codex/diffusion-distribution-matching branch from 1f727bd to a3caccc Compare October 14, 2026 17:03
@CharlelieLrt
CharlelieLrt force-pushed the codex/diffusion-checkpoint-bundle branch from 6fb97f0 to 7a29c5f Compare October 16, 2026 01:19
@CharlelieLrt
CharlelieLrt force-pushed the codex/diffusion-distribution-matching branch 2 times, most recently from 1e9b326 to 0263bdd Compare October 16, 2026 02:52
@CharlelieLrt
CharlelieLrt force-pushed the codex/diffusion-checkpoint-bundle branch from 7a29c5f to 8b9bbd5 Compare October 16, 2026 02:52
@CharlelieLrt
CharlelieLrt force-pushed the codex/diffusion-distribution-matching branch from 0263bdd to 6eb2025 Compare October 16, 2026 20:15
@CharlelieLrt
CharlelieLrt force-pushed the codex/diffusion-checkpoint-bundle branch 2 times, most recently from 62a1dba to 6a7ad14 Compare October 17, 2026 01:44
@CharlelieLrt
CharlelieLrt force-pushed the codex/diffusion-distribution-matching branch from 6eb2025 to 28bfa6a Compare October 17, 2026 01:44
@CharlelieLrt
CharlelieLrt force-pushed the codex/diffusion-distribution-matching branch from 28bfa6a to ac444c0 Compare October 28, 2026 03:42
@CharlelieLrt
CharlelieLrt force-pushed the codex/diffusion-checkpoint-bundle branch from 6a7ad14 to 76416bf Compare October 28, 2026 03:42
Signed-off-by: Charlelie Laurent <claurent@nvidia.com>
@CharlelieLrt
CharlelieLrt force-pushed the codex/diffusion-checkpoint-bundle branch from 76416bf to d775406 Compare October 29, 2026 02:23
@CharlelieLrt

Copy link
Copy Markdown
Collaborator Author

Continued in PhysicsNeMo #2203, from branch diffusion-checkpoint-bundle in CharlelieLrt/modulus. The replacement preserves this implementation and includes the requested documentation clarifications. Please continue the review there. This PR retains the earlier discussion.

@CharlelieLrt
CharlelieLrt deleted the codex/diffusion-checkpoint-bundle branch October 29, 2026 04:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

2 - In Progress Currently a work in progress 5 - DO NOT MERGE Hold off on merging; see PR for details 5 - Merge After Dependencies Depends on another PR: do not merge out of order

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant