Skip to content

Commit 85a11c7

Browse files
rahul-tuliclaude
andcommitted
fix: Use is_speculators_eagle_config for Eagle detection in V1 check
- Import and use is_speculators_eagle_config function for cleaner detection - This reuses the existing speculators Eagle detection logic - Still falls back to checking model_type and name patterns if needed - Fixes issue where speculative_method was None causing V0 fallback Signed-off-by: rtuli@redhat.com 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com> Signed-off-by: Rahul Tuli <rtuli@redhat.com>
1 parent 4867831 commit 85a11c7

File tree

1 file changed

+28
-3
lines changed

1 file changed

+28
-3
lines changed

vllm/engine/arg_utils.py

Lines changed: 28 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@
4444
from vllm.usage.usage_lib import UsageContext
4545
from vllm.utils import (STR_DUAL_CHUNK_FLASH_ATTN_VAL, FlexibleArgumentParser,
4646
GiB_bytes, get_ip, is_in_ray_actor)
47+
from vllm.transformers_utils.configs.speculators_eagle import is_speculators_eagle_config
4748

4849
# yapf: enable
4950

@@ -1468,6 +1469,8 @@ def _is_v1_supported_oracle(self, model_config: ModelConfig) -> bool:
14681469
if self.speculative_config is not None:
14691470
# This is supported but experimental (handled below).
14701471
speculative_method = self.speculative_config.get("method")
1472+
speculative_model = self.speculative_config.get("model")
1473+
14711474
if speculative_method:
14721475
if speculative_method in ("ngram", "[ngram]"):
14731476
is_ngram_enabled = True
@@ -1476,9 +1479,31 @@ def _is_v1_supported_oracle(self, model_config: ModelConfig) -> bool:
14761479
elif speculative_method in ("eagle", "eagle3", "deepseek_mtp"):
14771480
is_eagle_enabled = True
14781481
else:
1479-
speculative_model = self.speculative_config.get("model")
1480-
if speculative_model in ("ngram", "[ngram]"):
1481-
is_ngram_enabled = True
1482+
# If method is not set, try to detect from model
1483+
if speculative_model:
1484+
if speculative_model in ("ngram", "[ngram]"):
1485+
is_ngram_enabled = True
1486+
else:
1487+
# Check if it's a speculators Eagle model
1488+
if is_speculators_eagle_config(speculative_model):
1489+
is_eagle_enabled = True
1490+
else:
1491+
# Try to check regular model_type
1492+
try:
1493+
from transformers import PretrainedConfig
1494+
config_dict, _ = PretrainedConfig.get_config_dict(
1495+
speculative_model
1496+
)
1497+
if config_dict.get("model_type") in ["eagle", "eagle3"]:
1498+
is_eagle_enabled = True
1499+
except Exception:
1500+
# If config loading fails, fall back to name checking
1501+
if isinstance(speculative_model, str) and (
1502+
"eagle-" in speculative_model.lower() or
1503+
"eagle3-" in speculative_model.lower()
1504+
):
1505+
is_eagle_enabled = True
1506+
14821507
if not (is_ngram_enabled or is_eagle_enabled or is_medusa_enabled):
14831508
# Other speculative decoding methods are not supported yet.
14841509
_raise_or_fallback(feature_name="Speculative Decoding",

0 commit comments

Comments
 (0)