Skip to content
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

LlamaVision: Move xattn cache generation to text prefill forward #15056

Merged
merged 1 commit into from
Nov 14, 2024

Conversation

cglagovichTT
Copy link
Contributor

@cglagovichTT cglagovichTT commented Nov 14, 2024

Ticket

#15008

Problem description

From the ticket:

Currently, xattn caches are generated before running text prefill. This is an issue for vLLM integration since vLLM will provide page tables for the xattn caches which we must respect. If xattn caches are generated before text prefill, then prefill attention SDPA will need to support paged KV.

In order to allow vLLM integration without changing prefill SDPA to support paged KV, we will modify the model to compute xattn caches during text prefill. That way, text prefill will generate an unpaged cache, use it locally in attention, then do a paged fill cache to store the cache for decode iterations.

What's changed

I moved xattn cache generation to text model prefill. This is a change to the plumbing, nothing drastic.

Checklist

@cglagovichTT cglagovichTT marked this pull request as ready for review November 14, 2024 18:18
@cglagovichTT cglagovichTT merged commit d7d7b3c into main Nov 14, 2024
145 of 155 checks passed
@cglagovichTT cglagovichTT deleted the cglagovich/15008_rebase branch November 14, 2024 21:40
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.

2 participants