From 3e851a7803c98491cdcbf8f1dec0fcf992948b6d Mon Sep 17 00:00:00 2001 From: Harry Mellor <19981378+hmellor@users.noreply.github.com> Date: Wed, 14 Oct 2026 17:38:52 +0100 Subject: [PATCH] [Bugfix][Attention] Make the query contiguous for TRTLLM ragged MLA prefill (#61634) Signed-off-by: Harry Mellor <19981378+hmellor@users.noreply.github.com> Co-authored-by: Claude Opus 5.5 --- vllm/v1/attention/backends/mla/prefill/trtllm_ragged.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/vllm/v1/attention/backends/mla/prefill/trtllm_ragged.py b/vllm/v1/attention/backends/mla/prefill/trtllm_ragged.py index 266fd83df2..49c9dfa21c 100644 --- a/vllm/v1/attention/backends/mla/prefill/trtllm_ragged.py +++ b/vllm/v1/attention/backends/mla/prefill/trtllm_ragged.py @@ -156,7 +156,8 @@ class TrtllmRaggedPrefillBackend(MLAPrefillBackend): return out ret = trtllm_ragged_attention_deepseek( - query=q, + # The kernel reads the query as packed, ignoring its strides + query=q.contiguous(), key=k, value=v, workspace_buffer=self._workspace_buffer, @@ -207,7 +208,8 @@ class TrtllmRaggedPrefillBackend(MLAPrefillBackend): ) attn_out, lse = trtllm_ragged_attention_deepseek( - query=q, + # The kernel reads the query as packed, ignoring its strides + query=q.contiguous(), key=k, value=v, workspace_buffer=self._workspace_buffer,