From b136cc2c2c590593c9dfff2bd732edbb24bcceeb Mon Sep 17 00:00:00 2001 From: Nathaniel McVicar <61472752+NathanielMcVicar@users.noreply.github.com> Date: Mon, 6 Jul 2026 12:39:12 -0700 Subject: [PATCH] [Bugfix][Model] Add stability window to DiffusionGemma to match HF stability_threshold semantics (#45965) Signed-off-by: Nathaniel McVicar Signed-off-by: Nathaniel McVicar Signed-off-by: Harry Mellor <19981378+hmellor@users.noreply.github.com> Co-authored-by: Harry Mellor <19981378+hmellor@users.noreply.github.com> --- vllm/model_executor/models/diffusion_gemma.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/vllm/model_executor/models/diffusion_gemma.py b/vllm/model_executor/models/diffusion_gemma.py index eebb5ef148e..e3d7c1942d5 100644 --- a/vllm/model_executor/models/diffusion_gemma.py +++ b/vllm/model_executor/models/diffusion_gemma.py @@ -800,7 +800,10 @@ class DiffusionGemmaModelState(ModelState): max_denoising_steps=max_denoising_steps, device=device, hidden_size=text_config.hidden_size, - stability_threshold=self.gen_config["stability_threshold"], + # In Transformers, `stability_threshold=1` (the default) means the current + # step must match the previous step. In vLLM, the history buffer includes + # the current step, so we add 1 to match the same behavior. + stability_threshold=self.gen_config["stability_threshold"] + 1, ) self._req_id_to_index: dict[str, int] = {}