[Attention] Mamba attention module refactor (#41126)

Signed-off-by: wangxiyuan <wangxiyuan1007@gmail.com>
This commit is contained in:
wangxiyuan
2026-05-22 17:13:12 +08:00
committed by GitHub
parent 65b7a812a2
commit 7e1b45a092
10 changed files with 765 additions and 774 deletions
+4 -2
View File
@@ -40,7 +40,9 @@ from vllm.model_executor.layers.layernorm import (
GemmaRMSNorm as Qwen3_5RMSNorm,
)
from vllm.model_executor.layers.logits_processor import LogitsProcessor
from vllm.model_executor.layers.mamba.gdn_linear_attn import GatedDeltaNetAttention
from vllm.model_executor.layers.mamba.gdn.qwen_gdn_linear_attn import (
QwenGatedDeltaNetAttention,
)
from vllm.model_executor.layers.mamba.mamba_utils import (
MambaStateCopyFunc,
MambaStateCopyFuncCalculator,
@@ -133,7 +135,7 @@ class Qwen3_5DecoderLayer(Qwen3NextDecoderLayer):
self.layer_idx = extract_layer_index(prefix)
if self.layer_type == "linear_attention":
self.linear_attn = GatedDeltaNetAttention(
self.linear_attn = QwenGatedDeltaNetAttention(
config=config,
vllm_config=vllm_config,
prefix=f"{prefix}.linear_attn",