-
-
Notifications
You must be signed in to change notification settings - Fork 11.7k
[fix][cpu] fix prefill attention in CPU attention backend #27035
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
Conversation
|
Hi @bigPYJ1151 - would you be able to review this please? |
- Disables prefix caching because prefill attention can't handle paged KV cache - Fixes Q/K/V used during prefill on mixed prefill/decode requests Signed-off-by: Fadi Arafeh <[email protected]>
78e0cf1 to
86151e9
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code Review
This pull request introduces fixes for prefill attention in the CPU attention backend. The changes correctly handle mixed prefill/decode requests by adjusting the starting indices for Q/K/V tensors and correctly slicing sequence lengths for prefill requests. Additionally, it disables prefix caching on certain CPU architectures where it is not supported. The changes are logical, well-implemented, and address the described issues effectively. I have no major concerns.
|
@bigPYJ1151 do you think you can help look at this? not that well versed in the CPU backend |
|
After some tests I found even set |
Signed-off-by: Fadi Arafeh <[email protected]>
35dfc81 to
bf57438
Compare
|
Thanks for your review @bigPYJ1151 |
bigPYJ1151
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
…ct#27035) Signed-off-by: Fadi Arafeh <[email protected]>
…ct#27035) Signed-off-by: Fadi Arafeh <[email protected]>
…ct#27035) Signed-off-by: Fadi Arafeh <[email protected]> Signed-off-by: Alberto Perdomo <[email protected]>
…ct#27035) Signed-off-by: Fadi Arafeh <[email protected]> Signed-off-by: xuebwang-amd <[email protected]>
…ct#27035) Signed-off-by: Fadi Arafeh <[email protected]> Signed-off-by: xuebwang-amd <[email protected]>
…ct#27035) Signed-off-by: Fadi Arafeh <[email protected]> Signed-off-by: 0xrushi <[email protected]>
…ct#27035) Signed-off-by: Fadi Arafeh <[email protected]> Signed-off-by: 0xrushi <[email protected]>
…ct#27035) Signed-off-by: Fadi Arafeh <[email protected]>
…ct#27035) Signed-off-by: Fadi Arafeh <[email protected]>
…ct#27035) Signed-off-by: Fadi Arafeh <[email protected]>
…ct#27035) Signed-off-by: Fadi Arafeh <[email protected]>
[fix][cpu] fix prefill attention in CPU attention backend
Purpose
Fixes #27034
Test Plan
test script attached to #27034
Test Result
Output of test script attached to #27034 is same when prompts are batched and when prompts are ran one at a time
Essential Elements of an Effective PR Description Checklist
supported_models.mdandexamplesfor a new model.