@tduncan / Nvidia-Optimization-Stack-VLLM Mirror · read-only / commits / 5e13c07d00
Fork 0

A high-throughput and memory-efficient inference and serving engine for LLMs

Mirrored from https://github.com/tduncan-lum/Nvidia-Optimization-Stack---VLLM.git

Synced Nov 15, 08:30 UTC

[V1] [Bugfix] eagle bugfix and enable correct lm_head for multimodal (2) (#18781)

Signed-off-by: Ronald Xu <ronaldxu@amazon.com>

RonaldBXu committed May 27, 2025 at 22:09 UTC 5e13c07d00df0ca906c4c06110c277421202d3e2
2 files changed +6 -2
vllm/transformers_utils/configs/eagle.py
+1 -1
@@ -70,7 +70,7 @@ class EAGLEConfig(PretrainedConfig):
70
71 if self.model is not None:
72 for k, v in self.model.to_dict().items():
73 - if not hasattr(self, k):
73 + if k not in kwargs:
74 setattr(self, k, v)
75
76 @classmethod
vllm/v1/spec_decode/eagle.py
+5 -1
@@ -9,6 +9,7 @@ from vllm.distributed.parallel_state import get_pp_group
9 from vllm.forward_context import set_forward_context
10 from vllm.logger import init_logger
11 from vllm.model_executor.model_loader import get_model
12 +from vllm.model_executor.models import supports_multimodal
13 from vllm.model_executor.models.llama_eagle3 import Eagle3LlamaForCausalLM
14 from vllm.v1.attention.backends.flash_attn import (CommonAttentionMetadata,
15 FlashAttentionMetadata)
@@ -346,7 +347,10 @@ class EagleProposer:
347 if self.vllm_config.speculative_config.method != "eagle3" and \
348 hasattr(target_model, "lm_head"):
349 logger.info("Loading EAGLE LM head weights from the target model.")
349 - self.model.lm_head = target_model.lm_head
350 + if supports_multimodal(target_model):
351 + self.model.lm_head = target_model.get_language_model().lm_head
352 + else:
353 + self.model.lm_head = target_model.lm_head
354
355 @torch.inference_mode()
356 def dummy_run(