Separate MLAAttention class from Attention (#25103)

Signed-off-by: Naveenraj Kamalakannan <therealnaveenkamal@gmail.com>
Signed-off-by: Luka Govedič <ProExpertProg@users.noreply.github.com>
Co-authored-by: Luka Govedič <ProExpertProg@users.noreply.github.com>
This commit is contained in:
Naveenraj Kamalakannan
2025-10-08 17:11:11 -07:00
committed by GitHub
co-authored by Luka Govedič
parent 2a03f93de9
commit e614ab7806
10 changed files with 502 additions and 163 deletions
+3 -3
View File
@@ -9,11 +9,11 @@ import numpy as np
import torch
import torch.nn as nn
from vllm.attention.layer import Attention
from vllm.config import CompilationLevel, VllmConfig, get_layers_from_vllm_config
from vllm.distributed.parallel_state import get_pp_group
from vllm.forward_context import set_forward_context
from vllm.logger import init_logger
from vllm.model_executor.layers.attention_layer_base import AttentionLayerBase
from vllm.model_executor.model_loader import get_model
from vllm.model_executor.models import supports_multimodal
from vllm.model_executor.models.deepseek_v2 import DeepseekV32IndexerCache
@@ -880,7 +880,7 @@ class EagleProposer:
def load_model(self, target_model: nn.Module) -> None:
draft_model_config = self.vllm_config.speculative_config.draft_model_config
target_attn_layer_names = set(
get_layers_from_vllm_config(self.vllm_config, Attention).keys()
get_layers_from_vllm_config(self.vllm_config, AttentionLayerBase).keys()
)
# FIXME: support hybrid kv for draft model
target_indexer_layer_names = set(
@@ -897,7 +897,7 @@ class EagleProposer:
)
draft_attn_layer_names = (
get_layers_from_vllm_config(self.vllm_config, Attention).keys()
get_layers_from_vllm_config(self.vllm_config, AttentionLayerBase).keys()
- target_attn_layer_names
)
indexer_layers = get_layers_from_vllm_config(