Skip to content

Conversation

@ochougul
Copy link
Contributor

@ochougul ochougul commented Oct 2, 2025

Should improve perf for models that use sliding window like gemma, mistral etc.

Signed-off-by: Onkar Chougule <ochougul@qti.qualcomm.com>
# Original Gather
ctx_len = self.key_cache[layer_idx].shape[2]
ctx_indices = torch.arange(ctx_len)[None, None, ...]
gather_limit = kv_position_ids.max(1, keepdim=True).values.unsqueeze(1)
Copy link
Contributor

Choose a reason for hiding this comment

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

if we are using position_ids it would go overboard for sliding window right?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants