Skip to content

[Model] Support top_k and top_p sampling for DiffusionGemma - #45429

Merged
Isotr0py merged 14 commits into
vllm-project:mainfrom
guan404ming:feat/diffusion-top-k-top-p
Jul 26, 2026
Merged

[Model] Support top_k and top_p sampling for DiffusionGemma#45429
Isotr0py merged 14 commits into
vllm-project:mainfrom
guan404ming:feat/diffusion-top-k-top-p

Conversation

@guan404ming

@guan404ming guan404ming commented Jun 12, 2026

Copy link
Copy Markdown
Contributor

Purpose

Support per-request top_k/top_p for DiffusionGemma by filtering logits before the compiled denoise step, mirroring the AR sampler. Masked tokens become -inf; committed argmax (top-1) unaffected. Padding switched to masked_fill_ to avoid -inf * 0 = NaN on truncated canvases.

Related: #45163. Validation relaxation lives in the companion PR.

Test Plan

GPU behavioral check: per-request filtering, default fast path, truncated-canvas padding with -inf.

Test Result

All passed: k finite logits per filtered row, top-1 preserved, no NaN.


Essential Elements of an Effective PR Description Checklist
  • The purpose of the PR, such as "Fix some issue (link existing issues this PR will resolve)".
  • The test plan, such as providing test command.
  • The test results, such as pasting the results comparison before and after, or e2e results
  • (Optional) The necessary documentation update, such as updating supported_models.md and examples for a new model.

@guan404ming
guan404ming force-pushed the feat/diffusion-top-k-top-p branch 2 times, most recently from e0b6a58 to e53d6f3 Compare June 15, 2026 04:32
hsjlyj pushed a commit to hsjlyj/vllm that referenced this pull request Jun 15, 2026
…allback

Why not duplicate: open PRs vllm-project#45429 and vllm-project#45417 address sampling and generation config, not the startup crash 'Argument input_ids not found in the forward method of DiffusionGemmaDecoderModel'. Duplicate checks run with 'gh pr list --repo vllm-project/vllm --state open --search "DiffusionGemma input_ids"' and 'gh pr list --repo vllm-project/vllm --state open --search "DiffusionGemma transformers backend"', both empty.

Tests run: python3 -m py_compile vllm/model_executor/models/transformers/base.py. Also reproduced the user-facing failure on vLLM 0.23.0 before the patch via vllm serve against RedHatAI/diffusiongemma-26B-A4B-it-FP8-dynamic; root cause was the torch-compile decoration path assuming a decoder forward(input_ids=...) signature for the Transformers fallback. AI assistance used.

Co-authored-by: Claude <noreply@anthropic.com>

Signed-off-by: hsjlyj <173873397+hsjlyj@users.noreply.github.com>
@guan404ming

Copy link
Copy Markdown
Contributor Author

Hi @LucasWilkinson, could you help take a look, thanks!

@guan404ming
guan404ming force-pushed the feat/diffusion-top-k-top-p branch 2 times, most recently from ee488c0 to 047369e Compare June 23, 2026 15:57
@guan404ming
guan404ming force-pushed the feat/diffusion-top-k-top-p branch 4 times, most recently from 81836b9 to e703dff Compare July 2, 2026 13:28
@guan404ming
guan404ming force-pushed the feat/diffusion-top-k-top-p branch 2 times, most recently from ab257e5 to bfb750a Compare July 7, 2026 11:31
@guan404ming

Copy link
Copy Markdown
Contributor Author

Hi @Isotr0py could you help take a look at this one, thanks!

@guan404ming
guan404ming force-pushed the feat/diffusion-top-k-top-p branch 2 times, most recently from 823b7e0 to 7c1a121 Compare July 16, 2026 13:07
@guan404ming

Copy link
Copy Markdown
Contributor Author

Hello @Isotr0py just gentle ping could you help take look at this, thanks!

@guan404ming
guan404ming force-pushed the feat/diffusion-top-k-top-p branch 2 times, most recently from 035dd70 to 459de27 Compare July 20, 2026 10:39
Signed-off-by: Guan-Ming (Wesley) Chiu <105915352+guan404ming@users.noreply.github.com>
@guan404ming
guan404ming force-pushed the feat/diffusion-top-k-top-p branch from 459de27 to ccad439 Compare July 21, 2026 06:00

@Isotr0py Isotr0py left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Sorry for missing this! 😅

@Isotr0py
Isotr0py enabled auto-merge (squash) July 22, 2026 12:46
@github-actions github-actions Bot added the ready ONLY add when PR is ready to merge/full CI is needed label Jul 22, 2026
@guan404ming

Copy link
Copy Markdown
Contributor Author

Never mind, thanks!

@Isotr0py
Isotr0py merged commit 21fd9e8 into vllm-project:main Jul 26, 2026
90 checks passed
@guan404ming
guan404ming deleted the feat/diffusion-top-k-top-p branch July 26, 2026 08:48
edwinlim0919 pushed a commit to chaeminlim-mb/vllm that referenced this pull request Jul 29, 2026
…ject#45429)

Signed-off-by: Guan-Ming (Wesley) Chiu <105915352+guan404ming@users.noreply.github.com>
aoshen02 pushed a commit to zllion/vllm that referenced this pull request Aug 1, 2026
…ject#45429)

Signed-off-by: Guan-Ming (Wesley) Chiu <105915352+guan404ming@users.noreply.github.com>
Signed-off-by: aoshen02 <aoshen@inferact.ai>
pranavthakur0-0 pushed a commit to pranavthakur0-0/vllm that referenced this pull request Aug 4, 2026
…ject#45429)

Signed-off-by: Guan-Ming (Wesley) Chiu <105915352+guan404ming@users.noreply.github.com>
itej89 pushed a commit to itej89/vllm that referenced this pull request Aug 4, 2026
…ject#45429)

Signed-off-by: Guan-Ming (Wesley) Chiu <105915352+guan404ming@users.noreply.github.com>
Signed-off-by: Tej Kiran <kiran.tej@amd.com>
aditi-amd pushed a commit to aditi-amd/vllm that referenced this pull request Aug 4, 2026
…ject#45429)

Signed-off-by: Guan-Ming (Wesley) Chiu <105915352+guan404ming@users.noreply.github.com>
Signed-off-by: root <root@smci355-ccs-aus-m02-09.cs-aus.dcgpu>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ready ONLY add when PR is ready to merge/full CI is needed

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants