fix(qsa): clamp the compress gather to the rows this forward has (#38346)

This commit is contained in:
ehuaa
2026-09-11 23:24:17 -07:00
committed by GitHub
parent 0d08668821
commit 1cdc5bca5e
@@ -321,6 +321,7 @@ class QSAIndexer(MultiPlatformOp):
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(