Merge branch 'main' into patches
Signed-off-by: MOVZX <movzx@yahoo.com>
This commit is contained in:
+41
-9
@@ -1325,15 +1325,26 @@ class VllmConfig:
|
||||
)
|
||||
if (
|
||||
speculative_config.parallel_drafting
|
||||
and speculative_config.method != "dspark"
|
||||
and speculative_config.method not in ("dflash", "dspark")
|
||||
):
|
||||
raise ValueError(
|
||||
"Parallel speculative drafting is not supported with watermarking."
|
||||
)
|
||||
if speculative_config.method not in ("dspark", "eagle", "eagle3", "mtp"):
|
||||
if speculative_config.method not in (
|
||||
"dflash",
|
||||
"dspark",
|
||||
"eagle",
|
||||
"eagle3",
|
||||
"mtp",
|
||||
):
|
||||
raise ValueError(
|
||||
"Watermarking supports only autoregressive model-based "
|
||||
"speculative decoding."
|
||||
"Watermarking supports only dflash, dspark, eagle, eagle3 and "
|
||||
"mtp speculative decoding."
|
||||
)
|
||||
if self._is_dflash_candidate_draft():
|
||||
raise ValueError(
|
||||
"Watermarking does not support DFlash2 and LiLiCorr "
|
||||
"candidate-head drafters yet."
|
||||
)
|
||||
if (
|
||||
not watermark_config.allow_target_only_watermarking
|
||||
@@ -2307,9 +2318,6 @@ class VllmConfig:
|
||||
worker is configured to handle.
|
||||
"""
|
||||
if self.speculative_config is not None:
|
||||
scheduled_token_delta = (
|
||||
self.speculative_config.max_num_new_slots_for_drafting
|
||||
)
|
||||
max_num_batched_tokens = self.scheduler_config.max_num_batched_tokens
|
||||
if self.scheduler_config.max_num_scheduled_tokens is None:
|
||||
self.scheduler_config.max_num_scheduled_tokens = max_num_batched_tokens
|
||||
@@ -2333,12 +2341,34 @@ class VllmConfig:
|
||||
" num_speculative_tokens.",
|
||||
)
|
||||
|
||||
if max_num_batched_tokens <= scheduled_token_delta:
|
||||
# num_lookahead_tokens is at least every method's per-request draft
|
||||
# slots, and covers the DFlash/DSpark draft pass's query rows.
|
||||
if max_num_batched_tokens <= self.num_lookahead_tokens:
|
||||
raise ValueError(
|
||||
"VllmConfig does not have enough slots to schedule a token and"
|
||||
" support the speculative decoding settings."
|
||||
f" Got {max_num_batched_tokens=} and {scheduled_token_delta=}."
|
||||
f" Got {max_num_batched_tokens=} and"
|
||||
f" num_lookahead_tokens={self.num_lookahead_tokens}."
|
||||
)
|
||||
spec = self.speculative_config
|
||||
if spec.use_dflash() or spec.use_dspark():
|
||||
max_num_active_seqs = (
|
||||
self.scheduler_config.max_num_active_seqs
|
||||
or self.scheduler_config.max_num_seqs
|
||||
)
|
||||
max_draft_seqs = max_num_batched_tokens // self.num_lookahead_tokens
|
||||
if max_draft_seqs < max_num_active_seqs:
|
||||
logger.warning_once(
|
||||
"The %s draft pass needs %d query tokens per request within "
|
||||
"max_num_batched_tokens=%d. Overriding max_num_active_seqs "
|
||||
"from %d to %d.",
|
||||
spec.method,
|
||||
self.num_lookahead_tokens,
|
||||
max_num_batched_tokens,
|
||||
max_num_active_seqs,
|
||||
max_draft_seqs,
|
||||
)
|
||||
self.scheduler_config.max_num_active_seqs = max_draft_seqs
|
||||
|
||||
def _set_cudagraph_sizes(self):
|
||||
"""VLLM defines the default candidate list of batch sizes for CUDA graph
|
||||
@@ -3025,6 +3055,8 @@ class VllmConfig:
|
||||
unsupported.append("dspark speculative decoding")
|
||||
if self.speculative_config.enable_adaptive_verification:
|
||||
unsupported.append("adaptive draft verification")
|
||||
if self.speculative_config.draft_lm_head_quantization is not None:
|
||||
unsupported.append("draft lm_head quantization")
|
||||
|
||||
# Mixed sliding/full DFlash drafts need multiple KV groups (V2 only).
|
||||
if self._dflash_needs_multi_kv_group():
|
||||
|
||||
Reference in New Issue
Block a user