Skip to content

Add optional extra diffusion times and outputs - #2199

Draft
CharlelieLrt wants to merge 1 commit into
NVIDIA:mainfrom
CharlelieLrt:diffusion-extra-fields
Draft

CharlelieLrt wants to merge 1 commit into
NVIDIA:mainfrom
CharlelieLrt:diffusion-extra-fields

Conversation

@CharlelieLrt

@CharlelieLrt CharlelieLrt commented Oct 29, 2026 •

Copy link
Copy Markdown
Collaborator

Description

This PR adds DiffusionExtraTimes and DiffusionExtraOutputs to
physicsnemo.diffusion for models that need more than one diffusion time or
produce auxiliary outputs. The primary t and prediction remain required
tensors. Named extra fields are independently optional and default to None.
The reserved fields are the MeanFlow destination time r and adaptive loss
weighting log-scale logvar. Custom consumers define their own fields' meaning.

Pass (t, DiffusionExtraTimes(r=r, batch_size=[B])) when a model needs a
destination time. Return (prediction, DiffusionExtraOutputs(logvar=logvar, batch_size=[B])) when its training loss needs the auxiliary log-scale.

Affine preconditioners encode every supplied time tensor with the same mapping
and scale only the prediction. Conditioning wrappers pass supported tuples
unchanged. Existing DSM and flow-matching losses and sampling APIs use tensors.

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 #2205.
The preceding PhysicsNeMo stack would remain available.

Review process

This draft replaces PhysicsNeMo #2094 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.

Signed-off-by: Charlelie Laurent <claurent@nvidia.com>
@copy-pr-bot

copy-pr-bot Bot commented Oct 29, 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 73a3fbae3aae. An approval covers every file listed for that owner; one owner is sufficient for shared files.

⏳ @CharlelieLrt — 9 file(s)
  • docs/api/diffusion/introduction.rst
  • docs/api/diffusion/models.rst
  • physicsnemo/diffusion/init.py
  • physicsnemo/diffusion/base.py
  • physicsnemo/diffusion/metrics/losses.py
  • physicsnemo/diffusion/preconditioners/preconditioners.py
  • physicsnemo/diffusion/utils/model_wrappers.py
  • test/diffusion/helpers.py
  • test/diffusion/test_model_io.py
⏳ @megnvidia — 2 file(s)
  • docs/api/diffusion/introduction.rst
  • docs/api/diffusion/models.rst

No CODEOWNER

  • .importlinter
  • CHANGELOG.md

Comment /codeowners-info to refresh.

This branch has not been deployed

No deployments
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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant