[watermarking] add context deduplication support to speculative decoding (#56807)

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>
Co-authored-by: Lucas Wilkinson <LucasWilkinson@users.noreply.github.com>
This commit is contained in:
Raphaël Rialland
2026-09-30 12:22:10 -04:00
committed by GitHub
co-authored by Simon Veitner Lucas Wilkinson
parent 73a5831127
commit 0f8b398158
17 changed files with 1379 additions and 88 deletions
+23 -2
View File
@@ -3526,7 +3526,6 @@ def test_target_only_gumbel_allows_speculative_decoding(caplog_vllm, disable_log
config._check_watermarking_unsupported()
assert "Target-only watermarking leaves accepted draft tokens" in caplog_vllm.text
assert "Context deduplication is not supported" in caplog_vllm.text
def test_speculative_watermarking_without_context_dedup_does_not_warn(
@@ -3543,10 +3542,32 @@ def test_speculative_watermarking_without_context_dedup_does_not_warn(
parallel_drafting=False,
)
caplog_vllm.clear()
with caplog_vllm.at_level(logging.WARNING):
config._check_watermarking_unsupported()
assert "Context deduplication is not supported" not in caplog_vllm.text
assert "dedup" not in caplog_vllm.text.lower()
def test_speculative_context_dedup_logs_no_unsupported_warning(
caplog_vllm, disable_log_dedup
):
config = _watermarked_vllm_config()
config.watermark_config = WatermarkConfig(
algorithm="dual_key_gumbel", key=42, deduplicate_contexts="single_turn"
)
config.speculative_config = SimpleNamespace(
method="mtp",
draft_sample_method="probabilistic",
rejection_sample_method="standard",
parallel_drafting=False,
)
caplog_vllm.clear()
with caplog_vllm.at_level(logging.WARNING):
config._check_watermarking_unsupported()
assert "dedup" not in caplog_vllm.text.lower()
def test_gumbel_rejects_speculative_decoding_without_target_only():