Conversation
Signed-off-by: YaoJiayi <120040070@link.cuhk.edu.cn>
Summary of ChangesHello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request introduces a significant enhancement to the KV cache system by adding a new blend server, Highlights
🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console. Changelog
Activity
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
There was a problem hiding this comment.
Code Review
This pull request introduces blend_server_v2, enhancing KV cache reuse of token sub-sequences using a BlendTokenRangeMatcher and numba-accelerated hashing. A security audit revealed critical vulnerabilities, including insecure deserialization leading to Remote Code Execution (RCE), a high-severity buffer overflow in the Numba-jitted hashing code, and insecure data handling with unvalidated user-supplied offsets for GPU memory access. These issues pose risks of system compromise or crashes. Furthermore, a potential double-unlock bug in cb_retrieve_pre_computed was identified, and there are opportunities to improve performance by avoiding busy-waiting and reducing memory allocations, as well as making zip calls stricter for safety.
Signed-off-by: YaoJiayi <120040070@link.cuhk.edu.cn>
Signed-off-by: YaoJiayi <120040070@link.cuhk.edu.cn>
ApostaC
left a comment
There was a problem hiding this comment.
Follow-up TODO items after this PR (all related to token-matcher):
- Dynamic lookup table handling avoids hash collisions
- Have a design for the global token matcher module (need to discuss whether the storage layer needs to give the token matcher module feedback)
- Thread safety problem.
| assert k.chunk_hash is not None | ||
| token_hashes.append(k.chunk_hash) | ||
|
|
||
| self._token_range_matcher.on_new_token_hashes(list(key.token_ids), token_hashes) |
There was a problem hiding this comment.
[Critical] When we have TP > 1, this function will be called multiple times with the same token_ids. Will it create problems?
There was a problem hiding this comment.
Changed the code to only update the fingerprint if the ipc_key's rank is 0.
Signed-off-by: YaoJiayi <120040070@link.cuhk.edu.cn>
* add tests and fix bugs Signed-off-by: YaoJiayi <120040070@link.cuhk.edu.cn> * update comment Signed-off-by: YaoJiayi <120040070@link.cuhk.edu.cn> * add harder tests Signed-off-by: YaoJiayi <120040070@link.cuhk.edu.cn> * fix minor comments Signed-off-by: YaoJiayi <120040070@link.cuhk.edu.cn> * fix tests Signed-off-by: YaoJiayi <120040070@link.cuhk.edu.cn> --------- Signed-off-by: YaoJiayi <120040070@link.cuhk.edu.cn> Signed-off-by: shaoxiawjc <wjc2800@163.com>
* add tests and fix bugs Signed-off-by: YaoJiayi <120040070@link.cuhk.edu.cn> * update comment Signed-off-by: YaoJiayi <120040070@link.cuhk.edu.cn> * add harder tests Signed-off-by: YaoJiayi <120040070@link.cuhk.edu.cn> * fix minor comments Signed-off-by: YaoJiayi <120040070@link.cuhk.edu.cn> * fix tests Signed-off-by: YaoJiayi <120040070@link.cuhk.edu.cn> --------- Signed-off-by: YaoJiayi <120040070@link.cuhk.edu.cn> Signed-off-by: Aaron Wu <aaron.wu@dell.com>
* add tests and fix bugs Signed-off-by: YaoJiayi <120040070@link.cuhk.edu.cn> * update comment Signed-off-by: YaoJiayi <120040070@link.cuhk.edu.cn> * add harder tests Signed-off-by: YaoJiayi <120040070@link.cuhk.edu.cn> * fix minor comments Signed-off-by: YaoJiayi <120040070@link.cuhk.edu.cn> * fix tests Signed-off-by: YaoJiayi <120040070@link.cuhk.edu.cn> --------- Signed-off-by: YaoJiayi <120040070@link.cuhk.edu.cn>
* add tests and fix bugs Signed-off-by: YaoJiayi <120040070@link.cuhk.edu.cn> * update comment Signed-off-by: YaoJiayi <120040070@link.cuhk.edu.cn> * add harder tests Signed-off-by: YaoJiayi <120040070@link.cuhk.edu.cn> * fix minor comments Signed-off-by: YaoJiayi <120040070@link.cuhk.edu.cn> * fix tests Signed-off-by: YaoJiayi <120040070@link.cuhk.edu.cn> --------- Signed-off-by: YaoJiayi <120040070@link.cuhk.edu.cn>
What this PR does / why we need it:
Using rolling hash to get rid of separators.
Special notes for your reviewers:
If applicable: