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

[Feature]: PD separation supports prefix caching #12257

Open
1 task done
skyCreateXian opened this issue Jan 21, 2025 · 0 comments
Open
1 task done

[Feature]: PD separation supports prefix caching #12257

skyCreateXian opened this issue Jan 21, 2025 · 0 comments

Comments

@skyCreateXian
Copy link

🚀 The feature, motivation and pitch

kv transfer agent recv_kv_caches_and_hidden_states and send_kv_caches_and_hidden_states failed to support prefix caching

Mainly due to the following code in simple_connector.py L159, L215
'seq_lens = model_input.attn_metadata.seq_lens'

If the prefix caching is opened and hit, the hit part in the previous text will be marked as calculated, and input_token will be the uncalculated part

Alternatives

Idea: After opening prefix caching, only prefix and transfer increments to decode. Therefore, consider subtracting context_lens from seq_lens to solve this problem?
'seq_lens = (model_input.attn_metadata.seq_lens_tensor - model_input.attn_metadata.context_lens_tensor).tolist()'

Additional context

No response

Before submitting a new issue...

  • Make sure you already searched for relevant issues, and asked the chatbot living at the bottom right corner of the documentation page, which can answer lots of frequently asked questions.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant