Skip to content

Add optional extra diffusion times and outputs - #2094

Closed
CharlelieLrt wants to merge 1 commit into
mainfrom
codex/diffusion-structured-io
Closed

CharlelieLrt wants to merge 1 commit into
mainfrom
codex/diffusion-structured-io

Conversation

@CharlelieLrt

@CharlelieLrt CharlelieLrt commented Oct 14, 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 #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 enhancement New feature or request 2 - In Progress Currently a work in progress 5 - DO NOT MERGE Hold off on merging; see PR for details 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 fe02e1035bea. An approval covers every file listed for that owner; one owner is sufficient for shared files.

⏳ @CharlelieLrt — 7 file(s)
  • docs/api/diffusion/models.rst
  • docs/api/diffusion/preconditioners.rst
  • physicsnemo/diffusion/init.py
  • physicsnemo/diffusion/base.py
  • physicsnemo/diffusion/preconditioners/preconditioners.py
  • test/diffusion/helpers.py
  • test/diffusion/test_model_io.py
⏳ @megnvidia — 2 file(s)
  • docs/api/diffusion/models.rst
  • docs/api/diffusion/preconditioners.rst

No CODEOWNER

  • CHANGELOG.md

Comment /codeowners-info to refresh.

Signed-off-by: Charlelie Laurent <claurent@nvidia.com>
@CharlelieLrt

Copy link
Copy Markdown
Collaborator Author

Continued in PhysicsNeMo #2199, from branch diffusion-extra-fields 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-structured-io 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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant