Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 8 additions & 8 deletions vllm/v1/attention/backends/mla/cutlass_mla.py
Original file line number Diff line number Diff line change
Expand Up @@ -210,9 +210,14 @@ def _sm100_cutlass_mla_decode(
sm_scale,
num_kv_splits,
)
returned_lse = lse[:, :H].contiguous(
) if self.need_to_return_lse_for_decode else lse
return out[:, :H].contiguous(), returned_lse

if H < MAX_HEADS:
# Extract the subsets of the outputs
returned_lse = lse[:, :H].contiguous(
) if self.need_to_return_lse_for_decode else lse
out = out[:, :H]
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I understand putting this in a conditional, but why can we remove the contiguous for out if we can't for lse?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Most likely lse as well, I was just on the safe side, since I don't know how to test it.


return out, returned_lse

def _sm100_forward_decode(
self,
Expand All @@ -228,11 +233,6 @@ def _sm100_forward_decode(
self._workspace.ensure_size(attn_metadata, self._num_kv_splits)

# Run MLA
# Clone q_nope and q_pe to make sure strides computation is correct.
# TODO: Check if we really need it
q_nope = q_nope.clone()
q_pe = q_pe.clone()

o, lse = self._sm100_cutlass_mla_decode(
q_nope,
q_pe,
Expand Down