Skip to content

Fix batched DiffusionGemma adaptive stopping - #14386

Open
kashif wants to merge 5 commits into
mainfrom
fix/diffusion-gemma-adaptive-stopping
Open

Fix batched DiffusionGemma adaptive stopping#14386
kashif wants to merge 5 commits into
mainfrom
fix/diffusion-gemma-adaptive-stopping

Conversation

@kashif

@kashif kashif commented Aug 4, 2026

Copy link
Copy Markdown
Contributor

DiffusionGemma adaptive stopping currently waits for the whole batch to converge, so rows that finish early keep changing while slower rows continue. It also measures confidence from the raw model logits instead of the scheduler-shaped logits used for sampling.

This freezes each row once it is stable and confident, and uses the scheduler logits for the stopping decision. A regression test covers both cases.

Checks:

  • make quality
  • make fix-copies
  • DiffusionGemma pipeline tests (11 passed)
  • compiled decoder with static cache smoke test

@github-actions github-actions Bot added size/M PR with diff < 200 LOC tests pipelines labels Aug 4, 2026
@kashif
kashif requested a review from dg845 August 4, 2026 17:35
@kashif
kashif marked this pull request as ready for review August 4, 2026 17:36
@HuggingFaceDocBuilderDev

Copy link
Copy Markdown

The docs for this PR live here. All of your documentation changes will be reflected on that endpoint. The docs are available until 30 days after the last update.

Comment thread src/diffusers/pipelines/diffusion_gemma/pipeline_diffusion_gemma.py Outdated
Comment thread tests/pipelines/diffusion_gemma/test_diffusion_gemma.py Outdated
Comment thread tests/pipelines/diffusion_gemma/test_diffusion_gemma.py
Comment thread src/diffusers/pipelines/diffusion_gemma/pipeline_diffusion_gemma.py Outdated

@dg845 dg845 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the PR! Are the changes (committing finished rows immediately, using scheduler-shaped logits instead of raw denoising model logits) intended to match the DiffusionGemma reference behavior? It's not obvious to me that they are bugfixes rather than modeling changes.

@kashif

kashif commented Aug 15, 2026

Copy link
Copy Markdown
Contributor Author

thanks @dg845 fixing!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

pipelines size/M PR with diff < 200 LOC tests

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants