[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
@@ -37,7 +37,9 @@ from vllm.model_executor.layers.linear import (
RowParallelLinear,
)
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,
@@ -337,7 +339,7 @@ class Qwen3NextDecoderLayer(nn.Module):
self.layer_idx = extract_layer_index(prefix)
if self.layer_type == "linear_attention":
self.linear_attn = GatedDeltaNetAttention(
self.linear_attn = QwenGatedDeltaNetAttention(
config,
vllm_config=vllm_config,
prefix=f"{prefix}.linear_attn",