Skip to content

bugfix: pass estimated linear state slots.#1943

Merged
yingxudeng merged 1 commit into
xLLM-AI:mainfrom
pjgao:bugfix/linear-state-slot-wiring
Jul 14, 2026
Merged

bugfix: pass estimated linear state slots.#1943
yingxudeng merged 1 commit into
xLLM-AI:mainfrom
pjgao:bugfix/linear-state-slot-wiring

Conversation

@pjgao

@pjgao pjgao commented Jul 14, 2026

Copy link
Copy Markdown
Collaborator

问题

PR #1846 为混合线性注意力模型启用了 LINEAR block manager。KV Cache 容量估算已经生成 num_linear_state_blocks,并使用该数量分配 Conv/SSM state cache;但 LLM/VLM engine 创建 BlockManagerPool 时没有继续传递该值。

因此,Qwen3Next、Qwen3.5 等模型会以 enable_linear_state=true 和默认的 linear_state_num_slots=0 创建 block manager,并在服务 ready 前触发:

linear_state_num_slots must be set when linear state is enabled

修改

  • LLM engine 将 kv_cache_cap.num_linear_state_blocks() 传给 BlockManagerPool::Options::linear_state_num_slots
  • VLM engine 同步使用相同的容量估算结果,保证两条运行路径行为一致。

该修改只补齐容量估算到 block manager 的参数传递,不改变 slot 数计算方式,也不引入后续 linear-state prefix-cache 的 restore 或 checkpoint-stride 功能。

影响

  • 恢复混合线性注意力 LLM/VLM 的 block manager 初始化。
  • 普通全注意力模型仍保持 enable_linear_state=false,不使用 LINEAR leaf。
  • 不涉及 MTP 调度、stream 同步或推理热路径。

关联

@yingxudeng yingxudeng merged commit 52eca61 into xLLM-AI:main Jul 14, 2026
5 of 26 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