Skip to content

Commit 8e76840

Browse files
authored
Multi diffusion perf improvements and ci tests (#1732)
* Performance improvements in multi_diffusion Signed-off-by: Charlelie Laurent <claurent@nvidia.com> * Added CI tests for multi-diffusion DPS guidance Signed-off-by: Charlelie Laurent <claurent@nvidia.com> * Added API docs for multi-diffusion Signed-off-by: Charlelie Laurent <claurent@nvidia.com> * Fixes in API docs Signed-off-by: Charlelie Laurent <claurent@nvidia.com> * Updated CHANGELOG.md Signed-off-by: Charlelie Laurent <claurent@nvidia.com> * Fixed typo in CHANGELOG.md Signed-off-by: Charlelie Laurent <claurent@nvidia.com> --------- Signed-off-by: Charlelie Laurent <claurent@nvidia.com>
1 parent 6f0fcdf commit 8e76840

136 files changed

Lines changed: 2403 additions & 344 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

CHANGELOG.md

Lines changed: 8 additions & 0 deletions

docs/api/diffusion/introduction.rst

Lines changed: 3 additions & 4 deletions

docs/api/diffusion/multi_diffusion.rst

Lines changed: 592 additions & 17 deletions
202 KB
276 KB
96.1 KB
54.1 KB
181 KB
246 KB

physicsnemo/diffusion/guidance/dps_guidance.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -236,6 +236,16 @@ def guidance(
236236
:meth:`~physicsnemo.diffusion.noise_schedulers.NoiseScheduler.get_denoiser` :
237237
Converts the score-predictor to a denoiser for sampling.
238238
239+
Notes
240+
-----
241+
**Recommended call pattern:** wrap inference-only sample loops in
242+
``with torch.no_grad():``. The predictor re-enables autograd locally
243+
for the guidance's internal ``autograd.grad`` call, so functionality
244+
is preserved, and the returned score does not carry an autograd graph
245+
that the sampler would otherwise compound across solver steps. Do NOT
246+
use ``torch.inference_mode()`` — it disables autograd entirely and
247+
breaks the guidance's internal gradient computation.
248+
239249
Examples
240250
--------
241251
**Example 1:** Basic usage with a single guidance for inpainting:

0 commit comments

Comments
 (0)