[WIP]feat: support qwen3.5 linear-state prefix cache.#1839
Conversation
There was a problem hiding this comment.
Code Review
This pull request introduces linear-state prefix caching for Qwen3.5 GDN recurrent states, implementing a dedicated LinearStateBlockManager to manage checkpoints and live slots with LRU eviction and zero-copy promotion. It integrates linear-state checkpointing and restoration across the LLM/VLM engines, batch input builders, and chunked prefill schedulers, supported by updated KV cache estimation and extensive unit tests. The code review feedback highlights several style guide violations, specifically regarding naming conventions (recommending snake_case for functions and snake_case_ for member variables) and scoping rules (requiring file-local helper functions to be placed in anonymous namespaces).
Important
The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.
| LinearStatePrefixHash MakePrefixHash(uint8_t tag) { | ||
| LinearStatePrefixHash hash{}; | ||
| hash.fill(tag); | ||
| return hash; | ||
| } |
There was a problem hiding this comment.
The function MakePrefixHash violates the naming convention specified in the repository style guide. Functions must be named using snake_case.
LinearStatePrefixHash make_prefix_hash(uint8_t tag) {\n LinearStatePrefixHash hash{};\n hash.fill(tag);\n return hash;\n}References
- Functions must be named using snake_case. (link)
| int32_t dp_rank = -1; | ||
| // Pin matched checkpoints until the worker copies them into sequence-owned | ||
| // live slots on the compute stream. | ||
| std::vector<Block> restore_pins; | ||
| std::vector<Promotion> promotions; |
There was a problem hiding this comment.
The member variables dp_rank, restore_pins, and promotions in the class LinearStateCheckpointReservations violate the naming convention specified in the repository style guide. Member variables must use snake_case_ (with a trailing underscore).
int32_t dp_rank_ = -1;\n // Pin matched checkpoints until the worker copies them into sequence-owned\n // live slots on the compute stream.\n std::vector<Block> restore_pins_;\n std::vector<Promotion> promotions_;References
- Member variables must use snake_case_ (with a trailing underscore). (link)
d2c4c3d to
23fb5d7
Compare
23fb5d7 to
2b9ab40
Compare
85a863f to
1bf85ef
Compare
88b05a8 to
2cbc641
Compare
2cbc641 to
20cfd3f
Compare
Description
Related Issues
Change Type
Pull Request Checklist
Thank you for contributing to xLLM. Before requesting review, please make sure the following items are complete.
PR Title and Commit Messages
<type>: <subject>.Pre-commit Checks
pre-commitby runningpip install pre-commitor an equivalent command.pre-commit install.pre-commit run --all-filesand fixed any reported issues.Self Review
.agents/skills/code-review/references/custom-code-style.md, especially code written or assisted by AI.mainbranch.Build and Test Coverage
python setup.py build testhas passed on a CUDA machine.python setup.py build testhas passed on an NPU machine.python setup.py build testhas passed on an MLU machine.Reviewer Notes
pr说明如下:
https://yingxudeng.github.io/xllm-notes/reports/qwen35-linear-prefix-cache-pr1839/