Skip to content

Fix the fusedsdpa with sliding window alignment issue #298

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

libinta
Copy link
Contributor

@libinta libinta commented Jul 17, 2025

No description provided.

Comment on lines 98 to +101
if found_bucket is None:
block_size = self.slice_size if self.use_window_sdpa else self.block_size
new_batch_size = 2 ** math.ceil(math.log2(batch_size))
new_seq_len = math.ceil(seq_len / self.block_size) * self.block_size
new_seq_len = math.ceil(seq_len / block_size) * block_size
Copy link
Contributor

Choose a reason for hiding this comment

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

This is hacky and doesn't really fix the real problem why that bucket hasn't been found.
You can try to change block_size to be a multiple of 1k if that's a hard requirement from FSDPA

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