Skip to content

Conversation

pytorchbot
Copy link
Collaborator

This PR was created by the merge bot to help merge the original PR into the main branch.
ghstack PR number: #9105 by @kimishpatel
^ Please use this as the source of truth for the PR details, comments, and reviews
ghstack PR base: https://github.com/pytorch/executorch/tree/gh/kimishpatel/159/base
ghstack PR head: https://github.com/pytorch/executorch/tree/gh/kimishpatel/159/head
Merge bot PR base: https://github.com/pytorch/executorch/tree/main
Merge bot PR head: https://github.com/pytorch/executorch/tree/gh/kimishpatel/159/orig
@diff-train-skip-merge

Pull Request resolved: #9105

This diff fixes two bugs
1. When doing flash attention, the partical q @ k block may contain some entries that needs to be masked out. This logic had a bug. Maybe this bug also exist in PT core. I will look into that to add test and see if I can prove it.
2. Due to special handling via start_pos in SDPA it also exposed the bug in 1 when doing really long sequence prefill in chunked manner.

It is probably better to just use mask though.

Code has detail comments on the issue and fix.
ghstack-source-id: 272776939

Differential Revision: [D70922039](https://our.internmc.facebook.com/intern/diff/D70922039/)
Copy link

pytorch-bot bot commented Mar 20, 2025

🔗 Helpful Links

🧪 See artifacts and rendered test results at hud.pytorch.org/pr/pytorch/executorch/9479

Note: Links to docs will display an error until the docs builds have been completed.

❌ 3 New Failures

As of commit f6f2c8f with merge base 6daff83 (image):

NEW FAILURES - The following jobs have failed:

This comment was automatically generated by Dr. CI and updates every 15 minutes.

@facebook-github-bot facebook-github-bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label Mar 20, 2025
@kirklandsign kirklandsign added the release notes: ops & kernels Changes to the opset and any new / changed kernel implementations label Mar 21, 2025
@kirklandsign kirklandsign merged commit 2155284 into main Mar 21, 2025
78 of 82 checks passed
@kirklandsign kirklandsign deleted the gh/kimishpatel/159/orig branch March 21, 2025 04:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. release notes: ops & kernels Changes to the opset and any new / changed kernel implementations

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants