lama.cpp 目前有重大性能 bug: checkpoint 的巡回逻辑对于混合模型(比如 qwen3.6-27B)无效,从而导致大概率每次对话都要 prefill 全文,严重拖慢速度

lama.cpp 目前有重大性能 bug: checkpoint 的巡回逻辑对于混合模型(比如 qwen3.6-27B)无效,从而导致大概率每次对话都要 prefill 全文,严重拖慢速度
lama.cpp 目前有重大性能 bug: checkpoint 的巡回逻辑对于混合模型(比如 qwen3.6-27B)无效,从而导致大概率每次对话都要 prefill 全文,严重拖慢速度

在昨天研究 qwen3.6-27B 的优化时,看到了这个问题:server: fix context checkpoint restore for hybrid/recurrent models (DeltaNet/Mamba)

大概意思就是,因为 llama.cpp 的缓存巡回逻辑有问题,导致你 n 次调用大模型( n>1 )时,大概率 llama.cpp 找不到之前的对话,会从头再次 prefill 你的对话全文。

翻译成大白话讲,就是你对一个人,每多说一句话,就要从第一句开始重复一遍。

更为悲惨的是: 在 5 月份,llama.cpp 制作组引入了另外一个 checkpoint 逻辑,使得缓存巡回性能再次下降:Commit e98cb51

经过此帖中大神实测,NVIDIA RTX PRO 6000 Blackwell 在运行 qwen3.6-27B Q8 时,上下文 50K 的长度下,每次请求 LLM 都会浪费 40 秒:

3 consecutive full re-processings logged:

┌───────────┬────────────────────┬───────┐
│ Turn │ Tokens reprocessed │ Time │
├───────────┼────────────────────┼───────┤
│ Task 2795 │ 67,608 │ 38.4s │
├───────────┼────────────────────┼───────┤
│ Task 3241 │ 71,211 │ 41.0s │
├───────────┼────────────────────┼───────┤
│ Task 3401 │ 71,105 │ 41.4s │
└───────────┴────────────────────┴───────┘

Root cause visible in logs: The new prompt is ~19k tokens, but all checkpoints sit at positions 39k–71k (from previous longer requests). Every checkpoint
is checked against 19340 and rejected because they're all beyond the new prompt length. Result: 0 usable checkpoints → full reprocess from BOS.

结论是,目前的 llama.cpp+qwen3.6-27B 这个组合,在 Agent 工具这个场景下,性能不可用。

目前此 issues 还是 open 状态,待修复。

来源: V2EX - 技术查看原文