[Perf] DiffusionGemma: constrained reads over the request's logprob_token_ids (#58216)
Signed-off-by: Matt Mastracci <matthew@mastracci.com> Co-authored-by: Claude Fable 5.1 <noreply@anthropic.com> Co-authored-by: Lucas Wilkinson <LucasWilkinson@users.noreply.github.com> Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com> Co-authored-by: Misha Goin <mgoin64@gmail.com>
This commit is contained in:
co-authored by
Claude Fable 5.1
Lucas Wilkinson
mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
Misha Goin
parent
92e9c6bf13
commit
ab3de6edf2
@@ -145,6 +145,29 @@ def test_diffusion_rejects_bad_extra_args(extra_args: dict, match: str):
|
||||
_verify_diffusion(SamplingParams(extra_args=extra_args))
|
||||
|
||||
|
||||
@pytest.mark.parametrize("flag", [True, 1])
|
||||
def test_diffusion_constrained_needs_logprob_token_ids(flag):
|
||||
bad = SamplingParams(extra_args={"diffusion_constrained": flag})
|
||||
with pytest.raises(VLLMValidationError, match="needs logprob_token_ids"):
|
||||
_verify_diffusion(bad)
|
||||
|
||||
ok = SamplingParams(
|
||||
logprob_token_ids=[3, 5], extra_args={"diffusion_constrained": flag}
|
||||
)
|
||||
_verify_diffusion(ok)
|
||||
|
||||
# An unset or false flag needs no ids.
|
||||
_verify_diffusion(SamplingParams(extra_args={"diffusion_constrained": False}))
|
||||
_verify_diffusion(SamplingParams(extra_args={"diffusion_constrained": 0}))
|
||||
|
||||
|
||||
@pytest.mark.parametrize("value", ["yes", 2, [1]])
|
||||
def test_diffusion_constrained_must_be_a_bool(value):
|
||||
params = SamplingParams(extra_args={"diffusion_constrained": value})
|
||||
with pytest.raises(VLLMValidationError, match="must be a boolean"):
|
||||
_verify_diffusion(params)
|
||||
|
||||
|
||||
def test_diffusion_seed_canvas_must_fill_the_canvas():
|
||||
params = SamplingParams(extra_args={"diffusion_seed_canvas": [0] * 7})
|
||||
with pytest.raises(VLLMValidationError, match="exactly 8 ids, got 7"):
|
||||
|
||||
Reference in New Issue
Block a user