You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This PR adds validation in DDPMPipeline to ensure that when a list of torch.Generators is provided, its length matches the requested batch_size. Before, DDPMPipeline could accept mismatched generator lists (they would silently succeed or fail later with an error depending on the list length). The new validation follows the existing behavior in the sibling DDIMPipeline and raises a clear ValueError before noise generation. A focused regression test was added to cover this case. It addresses Issue 2 in #13649.
Hi @X-mo7, thanks for the PR! It does not appear to link an issue it fixes. If this PR addresses an existing issue, please add a closing keyword (e.g. Fixes #1234) to the PR description so the issue is linked. See the contribution guide for more details. If this PR intentionally does not fix a tracked issue, a maintainer can add the no-issue-needed label to silence this reminder.
Please note that PRs without a linked issue are likely to be automatically closed 10 days after this notice.
Once the PR links an issue (or gets the no-issue-needed label), you can ignore this message — it stays here as a comment, but it no longer applies.
#13649 tracks multiple separate findings. This PR specifically addresses Issue 2 only, so I avoided using Fixes #13649 since that would close the whole issue while other findings remain open. I'm happy to adjust the tracking if a maintainer prefers a different approach.
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
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.
What does this PR do?
This PR adds validation in DDPMPipeline to ensure that when a list of torch.Generators is provided, its length matches the requested batch_size. Before, DDPMPipeline could accept mismatched generator lists (they would silently succeed or fail later with an error depending on the list length). The new validation follows the existing behavior in the sibling DDIMPipeline and raises a clear ValueError before noise generation. A focused regression test was added to cover this case. It addresses Issue 2 in #13649.
Tests:
.venv/bin/pytest tests/pipelines/ddpm/test_ddpm.py::TestDDPMPipeline::test_generator_list_batch_size_mismatch_raises -q
1 passed
.venv/bin/pytest tests/pipelines/ddpm/test_ddpm.py -q
15 passed, 23 skipped
Formatting/style check:
PATH=.venv/bin:$PATH make modified_only_fixup
All checks passed; 2 files left unchanged
Help from AI:
Codex was used to assist with investigating the issue, implementing the change, and reviewing the final diff.
Final self-review findings:
Before submitting
self-reviewskill on the diff?documentation guidelines, and
here are tips on formatting docstrings.
Who can review?
cc @yiyixuxu @dg845