From 3511a749a84d347b6528634bd41f988772ea854a Mon Sep 17 00:00:00 2001 From: ehuaa Date: Wed, 9 Sep 2026 17:24:16 +0800 Subject: [PATCH] fix(qsa): clamp the compress gather to the rows this forward has --- python/sglang/srt/layers/attention/qsa/qsa_indexer.py | 1 + 1 file changed, 1 insertion(+) diff --git a/python/sglang/srt/layers/attention/qsa/qsa_indexer.py b/python/sglang/srt/layers/attention/qsa/qsa_indexer.py index 4de4c6a8dd2d..a1558583516d 100644 --- a/python/sglang/srt/layers/attention/qsa/qsa_indexer.py +++ b/python/sglang/srt/layers/attention/qsa/qsa_indexer.py @@ -321,6 +321,7 @@ def update_key_state_and_compress( self.compress_ratio, device=member_rows.device, dtype=torch.long ) source_keys = token_k + group_locs = group_locs.clamp_max(source_keys.shape[0] - 1) source_rope = metadata.extend_rope_matrix if source_rope is None: source_rope = build_rope_position_matrix(