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

Question: is key_state_compressed used for inference? #24

Open
jq-wei opened this issue Nov 20, 2024 · 1 comment
Open

Question: is key_state_compressed used for inference? #24

jq-wei opened this issue Nov 20, 2024 · 1 comment

Comments

@jq-wei
Copy link

jq-wei commented Nov 20, 2024

Hi,

Thanks for the great contribution!

I have a question about the usage of key_states_compress. If I understand correctly, key_states_compress is the topk token (clusters) from prompt (in prefilling stage). Then during inference, new query should only calculate attention with key_states_compress + some_newly_generated_key_states. However, I see flash-attn use the full prompt's key_states, and key_states_compress is not used. Is this supposed to be like this, or I miss anything?

Thank you!

@jq-wei
Copy link
Author

jq-wei commented Nov 20, 2024

Especially, after prefilling, there is one attention loop for seq_len - (self.max_capacity_prompt) +1 many tokens, what is this for?

After this, decoding starts, but seems using the full KV cache.

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

No branches or pull requests

1 participant