Skip to content

Commit c1e876b

Browse files
author
0songHan
committed
Fix Kunlunxin CUDA Graph padding
1 parent e6ace3f commit c1e876b

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

vllm_fl/dispatch/backends/vendor/kunlunxin/impl/attention.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -739,6 +739,12 @@ def forward(
739739
query = query.view(-1, self.num_heads, self.head_size)
740740
if output is None:
741741
output = torch.empty_like(query)
742+
if (
743+
attn_metadata is not None
744+
and getattr(attn_metadata, "num_actual_tokens", None) is not None
745+
and attn_metadata.num_actual_tokens < output.shape[0]
746+
):
747+
output[attn_metadata.num_actual_tokens:].zero_()
742748
if attn_metadata is None:
743749
# Profiling run.
744750

0 commit comments

Comments
 (0)