Skip to content

feat: add linear-state block manager and prefix cache (3/n).#1846

Merged
yingxudeng merged 1 commit into
xLLM-AI:mainfrom
yingxudeng:feat/linear-state-foundation
Jul 14, 2026
Merged

feat: add linear-state block manager and prefix cache (3/n).#1846
yingxudeng merged 1 commit into
xLLM-AI:mainfrom
yingxudeng:feat/linear-state-foundation

Conversation

@yingxudeng

@yingxudeng yingxudeng commented Jun 29, 2026

Copy link
Copy Markdown
Collaborator

Description

Related Issues

Change Type

  • Bug fix
  • New feature
  • Performance improvement
  • Refactor
  • Documentation
  • Test
  • Build or CI

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

  • The PR title and each commit message follow the xLLM commit format: <type>: <subject>.

Allowed types: feat, bugfix, docs, test, refactor, chore, style, revert, perf, model, build, release.
The subject should use clear English, start with a verb, include at least 4 words, and end with ..

Pre-commit Checks

  • I have installed pre-commit by running pip install pre-commit or an equivalent command.
  • I have installed the hooks with pre-commit install.
  • I have run pre-commit run --all-files and fixed any reported issues.

If you are unsure how to set up pre-commit, see the pre-commit documentation.

Self Review

  • I have self-reviewed the code according to .agents/skills/code-review/references/custom-code-style.md, especially code written or assisted by AI.
  • I have rebased this PR onto the latest main branch.

Build and Test Coverage

  • Tests have been added or updated as needed.
  • CUDA: python setup.py build test has passed on a CUDA machine.
  • NPU: python setup.py build test has passed on an NPU machine.
  • MLU: python setup.py build test has passed on an MLU machine.

Reviewer Notes

pr说明如下:
https://yingxudeng.github.io/xllm-notes/reports/qwen35-linear-prefix-cache-pr1839/

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request introduces support for linear-state (Qwen3.5 GDN) live slots by adding the LINEAR block type and implementing corresponding state management methods in Sequence and KVCacheState. It also adds a MOVE_ONLY macro in macros.h. The feedback suggests using emplace_back instead of push_back when adding a slot to the block vector in sequence.h to avoid unnecessary copies, in accordance with the repository style guide.

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.

Comment thread xllm/core/framework/request/sequence.h Outdated
@yingxudeng

Copy link
Copy Markdown
Collaborator Author
image

@yingxudeng yingxudeng force-pushed the feat/linear-state-foundation branch from 1bed522 to 2d0841f Compare June 29, 2026 08:52
@yingxudeng yingxudeng marked this pull request as ready for review June 29, 2026 08:54
@yingxudeng yingxudeng force-pushed the feat/linear-state-foundation branch 2 times, most recently from 717c4b5 to 4d87fb8 Compare June 29, 2026 12:34
Comment thread xllm/core/framework/block/block_manager_pool.cpp
@yingxudeng yingxudeng force-pushed the feat/linear-state-foundation branch from 4d87fb8 to 9e6c147 Compare July 1, 2026 06:40
Comment thread xllm/core/framework/block/block_manager_pool.cpp Outdated
Comment thread xllm/core/framework/block/linear_state_block_manager.cpp Outdated
Comment thread xllm/core/framework/block/linear_state_block_manager.cpp Outdated
@yingxudeng yingxudeng force-pushed the feat/linear-state-foundation branch from 9e6c147 to 75c1aa7 Compare July 6, 2026 06:55
@yingxudeng yingxudeng changed the title feat: add linear-state block type and sequence slot accessors (3/n). feat: add linear-state block manager and prefix cache (3/n). Jul 6, 2026
Comment thread xllm/core/framework/block/linear_state_block_manager.cpp Outdated
Comment thread xllm/core/framework/block/linear_state_block_manager.cpp Outdated
Comment thread xllm/core/framework/request/sequence_kv_state.cpp
@yingxudeng yingxudeng force-pushed the feat/linear-state-foundation branch 2 times, most recently from eb08e3b to 0698ce1 Compare July 8, 2026 04:00
@yingxudeng

Copy link
Copy Markdown
Collaborator Author
image

@yingxudeng

Copy link
Copy Markdown
Collaborator Author

@yingxudeng yingxudeng force-pushed the feat/linear-state-foundation branch from 0698ce1 to 91ed09a Compare July 8, 2026 14:58
Comment thread xllm/core/framework/block/block_manager.h
Comment thread xllm/core/framework/block/block_manager_impl.cpp Outdated
Comment thread xllm/core/framework/request/sequence.cpp
@yingxudeng yingxudeng force-pushed the feat/linear-state-foundation branch from 91ed09a to e2f2074 Compare July 14, 2026 07:55
@yingxudeng

Copy link
Copy Markdown
Collaborator Author
image

@Kang-Meng Kang-Meng left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@yingxudeng yingxudeng merged commit 57776cb into xLLM-AI:main Jul 14, 2026
13 of 35 checks passed
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.

3 participants