vllm.v1.watermarking.spec_decode
¶
Classes:
Functions:
-
speculative_target_watermark_key–Resolve the resample kernel's Philox key from configuration.
-
watermarked_rejection_sample–Use the target key except at contexts selected for ordinary sampling.
DraftWatermarker
¶
Methods:
-
sample_block–Sample drafts flattened as (request, step), one step at a time.
sample_block(logits, idx_mapping, temperature, seed, pos, logits_cache=None, logits_cache_col=None, use_fp64=False)
¶
Sample drafts flattened as (request, step), one step at a time. The target verifies each draft with a context that includes the earlier drafts of its request, so steps must be sampled in order even when their logits were computed in parallel.
_resolve_watermark_key(watermarker)
¶
Return the Philox recovery key.
speculative_target_watermark_key(watermark_config)
¶
Resolve the resample kernel's Philox key from configuration.
watermarked_rejection_sample(target_logits, draft_logits_cache, draft_sampled, cu_num_logits, pos, idx_mapping, expanded_idx_mapping, expanded_local_pos, temperature, seed, num_speculative_steps, contexts, watermarking, watermarker, watermarking_skip_mask=None, use_fp64=False)
¶
Use the target key except at contexts selected for ordinary sampling.