[watermark] compatibility validation (#56801)

Signed-off-by: Raphael Rialland <raphael.rialland@mistral.ai>
Signed-off-by: Simon Veitner <sveitner@redhat.com>
Co-authored-by: Simon Veitner <sveitner@redhat.com>
This commit is contained in:
Raphaël Rialland
2026-10-05 14:37:13 -04:00
committed by GitHub
co-authored by Simon Veitner
parent 88f3c601b3
commit c32495d58f
45 changed files with 1670 additions and 101 deletions
@@ -82,7 +82,12 @@ def _validate(enable_trace_replay: bool) -> None:
enable_trace_replay=enable_trace_replay,
is_diffusion=False,
),
vllm_config=SimpleNamespace(reasoning_config=None),
vllm_config=SimpleNamespace(
reasoning_config=None,
# Engine has no watermark configuration.
_check_supports_watermarking=lambda params: False,
),
resolve_watermarking=lambda params: False,
speculative_config=None,
structured_outputs_config=None,
diffusion_config=None,
@@ -0,0 +1,27 @@
# SPDX-License-Identifier: Apache-2.0
# SPDX-FileCopyrightText: Copyright contributors to the vLLM project
from types import SimpleNamespace
from unittest.mock import AsyncMock
import pytest
from vllm.v1.engine.async_llm import AsyncLLM
@pytest.mark.asyncio
async def test_kv_transfer_rejection_stub_disables_watermarking():
engine = object.__new__(AsyncLLM)
add_request = AsyncMock()
engine.engine_core = SimpleNamespace(
add_request_async=add_request,
shutdown=lambda **kwargs: None,
)
await engine.notify_kv_transfer_request_rejected(
"request",
{"do_remote_prefill": True},
)
request = add_request.call_args.args[0]
assert request.sampling_params.watermarking is False
+1
View File
@@ -518,6 +518,7 @@ def test_prompt_logprob_token_ids_require_v2_model_runner():
structured_outputs_config=None,
tokenizer=None,
validate_logits_processors_params=lambda params: None,
resolve_watermarking=lambda params: False,
)
params = SamplingParams(prompt_logprob_token_ids=[[1, 2]])
with patch.object(SamplingParams, "verify"):
+34
View File
@@ -6,6 +6,7 @@ from types import SimpleNamespace
import pytest
from vllm.v1.core.sched.output import SchedulerOutput
from vllm.v1.worker.gpu import warmup
from vllm.v1.worker.gpu.warmup import run_mixed_prefill_decode_warmup
@@ -31,6 +32,39 @@ def test_mixed_warmup_skipped_for_single_seq(max_num_reqs):
)
def test_mixed_warmup_disables_watermarking():
outputs: list[SchedulerOutput] = []
runner = SimpleNamespace(
is_pooling_model=False,
max_num_reqs=2,
kv_cache_config=SimpleNamespace(
kv_cache_groups=[
SimpleNamespace(kv_cache_spec=SimpleNamespace(block_size=16))
],
num_blocks=128,
),
vllm_config=SimpleNamespace(num_lookahead_tokens=0),
max_model_len=128,
model_state=SimpleNamespace(max_encoder_len=0),
kv_connector=SimpleNamespace(set_disabled=lambda disabled: None),
)
assert run_mixed_prefill_decode_warmup(
runner,
worker_execute_model=outputs.append,
worker_sample_tokens=lambda grammar_output: None,
num_tokens=32,
)
sampling_params = [
request.sampling_params
for output in outputs
for request in output.scheduled_new_reqs
]
assert len(sampling_params) == 2
assert all(params.watermarking is False for params in sampling_params)
@pytest.mark.parametrize("fail_warmup", [False, True])
def test_kernel_warmup_restores_uncalibrated_adaptive_manager(monkeypatch, fail_warmup):
"""Startup must warm fixed drafts before calibration and retain its manager."""