[CI] Organize speculative decoding E2E tests by coverage (#50330)
Signed-off-by: mgoin <mgoin64@gmail.com> Signed-off-by: Michael Goin <mgoin64@gmail.com> Co-authored-by: OpenAI Codex <noreply@openai.com> Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
This commit is contained in:
co-authored by
OpenAI Codex
mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
parent
b40d859c7b
commit
fcdc7c2e9c
@@ -22,7 +22,7 @@ from vllm.model_executor.layers.vocab_parallel_embedding import (
|
||||
from vllm.model_executor.model_loader.weight_utils import default_weight_loader
|
||||
|
||||
from .gemma4_mtp import Gemma4MTPAttention, Gemma4MTPDecoderLayer
|
||||
from .qwen3_dflash import DFlashQwen3Model
|
||||
from .qwen3_dflash import DFlashQwen3Model, _dflash_layer_causal
|
||||
from .qwen3_dspark import DSparkMarkovHead, Qwen3DSparkForCausalLM
|
||||
from .utils import extract_layer_index, maybe_prefix
|
||||
|
||||
@@ -37,7 +37,8 @@ class Gemma4DSparkAttention(Gemma4MTPAttention):
|
||||
quant_config: QuantizationConfig | None,
|
||||
prefix: str,
|
||||
) -> None:
|
||||
is_full = config.layer_types[extract_layer_index(prefix)] == "full_attention"
|
||||
layer_idx = extract_layer_index(prefix)
|
||||
is_full = config.layer_types[layer_idx] == "full_attention"
|
||||
head_dim = (
|
||||
getattr(config, "global_head_dim", config.head_dim)
|
||||
if is_full
|
||||
@@ -62,6 +63,7 @@ class Gemma4DSparkAttention(Gemma4MTPAttention):
|
||||
prefix=prefix,
|
||||
)
|
||||
self.is_kv_shared_layer = False
|
||||
self.causal = _dflash_layer_causal(config, layer_idx)
|
||||
self.use_k_eq_v = use_k_eq_v
|
||||
self.kv_size = self.num_kv_heads * self.head_dim
|
||||
attn_bias = getattr(config, "attention_bias", False)
|
||||
|
||||
@@ -19,6 +19,7 @@ def load_dspark_model(target_model: nn.Module, vllm_config: VllmConfig) -> nn.Mo
|
||||
|
||||
from vllm.compilation.backends import set_model_tag
|
||||
from vllm.model_executor.models.qwen3_dflash import dflash_has_any_non_causal
|
||||
from vllm.model_executor.models.utils import get_draft_quant_config
|
||||
|
||||
draft_vllm_config = replace(
|
||||
vllm_config,
|
||||
@@ -36,6 +37,9 @@ def load_dspark_model(target_model: nn.Module, vllm_config: VllmConfig) -> nn.Mo
|
||||
else vllm_config.cache_config
|
||||
),
|
||||
)
|
||||
# VllmConfig post-init restores the target's quant config because the target
|
||||
# config is retained for DSpark's target-layer metadata, so we must override it.
|
||||
draft_vllm_config.quant_config = get_draft_quant_config(vllm_config)
|
||||
|
||||
with set_model_tag("dspark_head"):
|
||||
draft_model = get_model(
|
||||
|
||||
Reference in New Issue
Block a user