Repository navigation
Add optional diffusion distillation strategy - #2204
Draft
CharlelieLrt wants to merge 6 commits into
Draft
CharlelieLrt wants to merge 6 commits into
CharlelieLrt wants to merge 6 commits into
Conversation
Signed-off-by: Charlelie Laurent <claurent@nvidia.com>
Signed-off-by: Charlelie Laurent <claurent@nvidia.com>
Signed-off-by: Charlelie Laurent <claurent@nvidia.com>
Signed-off-by: Charlelie Laurent <claurent@nvidia.com>
Signed-off-by: Charlelie Laurent <claurent@nvidia.com>
Signed-off-by: Charlelie Laurent <claurent@nvidia.com>
Contributor
CODEOWNERS review mapCurrent for commit ⏳ @CharlelieLrt — 59 file(s)
⏳ @coreyjadams — 1 file(s)
⏳ @ktangsali — 2 file(s)
⏳ @megnvidia — 6 file(s)
No CODEOWNER
Comment |
This was referenced Oct 29, 2026
This was referenced Oct 29, 2026
This branch has not been deployed
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.
Description
This PR adds the optional
DistillationStrategyfor users who do not need towrite their own distillation loop. It extends Alchemi's general training strategy
to manage phase-specific optimizers, gradient accumulation, AMP, EMA, and
checkpoint restart.
Users install the
diffusion-strategyextra and supply public models, a nativeor FastGen-backed loss, and TensorDict batches:
For explicit MeanFlow times, store
tandras separate batch tensors.Use
training_fn(models, batch)to return loss arguments containing(t, DiffusionExtraTimes(r=r, batch_size=[B])). Ordinary single-time batchesneed no conversion.
The strategy remains optional: expert users can call the same loss from their
own loop. Compilation and distributed setup remain under user control.
This PR also carries the grouped changelog entry for the distillation feature.
Checklist
Dependencies
Depends on
Earlier prerequisites
Parallel FastGen work
Conditional follow-up
If FastGen maintainers decline FastGen #44, we would close PhysicsNeMo #2205.
The preceding PhysicsNeMo stack would remain available.
Review process
This draft replaces PhysicsNeMo #2099 and comes from the personal fork. This migration preserves the implementation. The first commit also includes the requested documentation clarifications.
Review the isolated commit diff for this layer. Each branch adds one commit to its prerequisite branch. All replacement PRs target upstream
main, so later PRs include prerequisite commits awaiting merge in their Files changed tab. After prerequisites merge, update the remaining branches to remove them from those diffs.