@tduncan / Nvidia-Optimization-Stack-VLLM Mirror · read-only / commits / 7c734ee09b
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 14, 23:45 UTC

[Bugfix][Qwen][DCA] fixes bug in dual-chunk-flash-attn backend for qwen 1m models. (#21364)

Signed-off-by: Tao He <linzhu.ht@alibaba-inc.com>

Tao He committed Jul 23, 2025 at 21:34 UTC 7c734ee09b0a40681ba49d3d7ef5517ddb106074
1 file changed -8
vllm/attention/backends/dual_chunk_flash_attn.py
-8
@@ -1055,7 +1055,6 @@ class DualChunkFlashAttentionImpl(FlashAttentionImpl):
1055 v_states_intra,
1056 softmax_scale=softmax_scale,
1057 causal=True,
1058 - block_table=block_table,
1058 stage="intra",
1059 vertical_indices=vertical_buffer,
1060 slash_indices=slash_buffer,
@@ -1070,7 +1069,6 @@ class DualChunkFlashAttentionImpl(FlashAttentionImpl):
1069 v_states_intra,
1070 softmax_scale=softmax_scale,
1071 causal=True,
1073 - block_table=block_table,
1072 stage="intra",
1073 vertical_indices=intra_vertical_indices,
1074 slash_indices=intra_slash_indices,
@@ -1085,7 +1083,6 @@ class DualChunkFlashAttentionImpl(FlashAttentionImpl):
1083 v_states_succ,
1084 softmax_scale=softmax_scale,
1085 causal=False,
1088 - block_table=block_table,
1086 stage="succ",
1087 vertical_indices=succ_vertical_buffer,
1088 slash_indices=succ_slash_buffer,
@@ -1100,7 +1097,6 @@ class DualChunkFlashAttentionImpl(FlashAttentionImpl):
1097 v_states_succ,
1098 softmax_scale=softmax_scale,
1099 causal=False,
1103 - block_table=block_table,
1100 stage="succ",
1101 vertical_indices=succ_vertical_indices,
1102 slash_indices=succ_slash_indices,
@@ -1115,7 +1111,6 @@ class DualChunkFlashAttentionImpl(FlashAttentionImpl):
1111 v_states_inter,
1112 softmax_scale=softmax_scale,
1113 causal=False,
1118 - block_table=block_table,
1114 stage="inter",
1115 vertical_indices=inter_vertical_buffer,
1116 slash_indices=inter_slash_buffer,
@@ -1130,7 +1125,6 @@ class DualChunkFlashAttentionImpl(FlashAttentionImpl):
1125 v_states_inter,
1126 softmax_scale=softmax_scale,
1127 causal=False,
1133 - block_table=block_table,
1128 stage="inter",
1129 vertical_indices=inter_vertical_indices,
1130 slash_indices=inter_slash_indices,
@@ -1151,7 +1145,6 @@ class DualChunkFlashAttentionImpl(FlashAttentionImpl):
1145 value_states: torch.Tensor,
1146 softmax_scale: float,
1147 causal: bool = True,
1154 - block_table: torch.Tensor = None,
1148 max_seqlen_k: Optional[int] = None,
1149 stage: str = "intra",
1150 vertical_indices: Optional[torch.Tensor] = None,
@@ -1230,7 +1223,6 @@ class DualChunkFlashAttentionImpl(FlashAttentionImpl):
1223 device=query_states.device),
1224 max_seqlen_k=max_seqlen_k,
1225 causal=causal,
1233 - block_table=block_table.unsqueeze(0),
1226 return_softmax_lse=True,
1227 )
1228 softmax_lse = softmax_lse.view(q_len, q_heads, 1).transpose(0,