<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[llama.cpp应该及时更新版本和调整参数了😄]]></title><description><![CDATA[<p dir="auto">上午一个长任务直接卡死了，很郁闷，然后开始研究怎么搞。</p>
<p dir="auto">最后决定升级 <code>llama.cpp</code> 的版本，使用官方编译版本：</p>
<p dir="auto"><code>llama-b10534-bin-win-cuda-13.3-x64</code></p>
<p dir="auto">同时重新调整 <code>llama-server</code> 的启动参数。</p>
<h2>llama-server 启动参数</h2>
<pre><code class="language-bash">--reasoning off ^
--n-gpu-layers -1 ^
--ctx-size 196608 ^
--flash-attn on ^
--cache-type-k q4_0 ^
--cache-type-v q4_0 ^
--spec-type draft-mtp ^
--spec-draft-n-max 2 ^
--spec-draft-n-min 1 ^
--temp 0.7 ^
--parallel 1 ^
--kv-unified ^
--load-mode mlock ^
--jinja ^
--no-warmup
</code></pre>
<h2>先上效果截图</h2>
<p dir="auto"><img src="https://upload.lcz.me/uploads/2c1ff541-4c6d-42b5-a09a-6fcf84cd9451.jpeg" alt="llama.cpp 实测效果" class=" img-fluid img-markdown" /></p>
<h2>与之前的配置比较</h2>
<p dir="auto">这次主要做了三个调整：</p>
<ol>
<li>
<p dir="auto"><strong>上下文长度从 128K 增加到 192K。</strong></p>
</li>
<li>
<p dir="auto"><strong>移除了 <code>--batch-size 4096</code> 和 <code>--ubatch-size 2048</code> 两个参数</strong>，直接交给 <code>llama-server</code> 自己处理。不删除它们的话，跑推理时会加载 CPU 和内存，速度暴跌。</p>
</li>
<li>
<p dir="auto"><strong><code>--spec-draft-n-max</code> 从 3 改成 2</strong>，实际使用下来，命中率和推理速度都有稍许增加。</p>
</li>
</ol>
]]></description><link>https://lcz.me/topic/1246</link><generator>RSS for Node</generator><lastBuildDate>Thu, 10 Sep 2026 00:43:29 GMT</lastBuildDate><atom:link href="https://lcz.me/topic/1246.rss" rel="self" type="application/rss+xml"/><pubDate>Fri, 21 Aug 2026 08:24:54 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to llama.cpp应该及时更新版本和调整参数了😄 on Tue, 25 Aug 2026 04:15:59 GMT]]></title><description><![CDATA[<p dir="auto">49分5s 这个数字很典型，先算一笔账：你的 --ctx-size 196608，如果前端每轮把完整历史重发、llama-server 又没复用 cache，就是全量重 prefill——196608 tokens ÷ ~67 t/s ≈ 49 分钟，和你实测几乎完全对上。优先查这三点：</p>
<ol>
<li>打开 /health 看 slots_state 和 n_past：如果每个请求 n_past 都归零，就是每轮全量重算。保持同一 slot、别让前端清上下文，llama.cpp 同 slot 会自动复用前缀缓存；</li>
<li>把 --ctx-size 降到实际够用（比如 128K），196K 的 KV 和 prefill 代价都不小；</li>
<li>开了 --reasoning 且 effort 高的话，小改动也可能触发超长 CoT——关掉 reasoning 或降到 low 跑一次同样的请求，区分是 prefill 慢还是 decode/思考慢。</li>
</ol>
<p dir="auto">另外 q4_0 KV 在 196K 下不小，显存放不下会 spill 到内存，速度直接崩——/health 里看 kv_cache 是否全在 GPU。MTP 投机解码只加速 decode，对 prefill 没帮助，别指望它。</p>
]]></description><link>https://lcz.me/post/13787</link><guid isPermaLink="true">https://lcz.me/post/13787</guid><dc:creator><![CDATA[Xiaote]]></dc:creator><pubDate>Tue, 25 Aug 2026 04:15:59 GMT</pubDate></item><item><title><![CDATA[Reply to llama.cpp应该及时更新版本和调整参数了😄 on Tue, 25 Aug 2026 03:28:38 GMT]]></title><description><![CDATA[<p dir="auto"><img src="https://upload.lcz.me/uploads/e7878a27-053f-4f5f-82b7-e813d138316b.jpeg" alt="f4365f0e-242f-4b33-af17-e1deeae2764b-image.jpeg" class=" img-fluid img-markdown" /></p>
<p dir="auto">有哪位大神可以指点一下，就改这么一个小bug，结果跑了49分5s。<br />
webui前端已经设置成medium了</p>
<p dir="auto"><img src="https://upload.lcz.me/uploads/8cd57799-fd38-4099-9497-9bc3246b96e6.jpeg" alt="92903326-8f3e-4180-8848-2954888676e3-image.jpeg" class=" img-fluid img-markdown" /></p>
]]></description><link>https://lcz.me/post/13781</link><guid isPermaLink="true">https://lcz.me/post/13781</guid><dc:creator><![CDATA[joker_chang]]></dc:creator><pubDate>Tue, 25 Aug 2026 03:28:38 GMT</pubDate></item><item><title><![CDATA[Reply to llama.cpp应该及时更新版本和调整参数了😄 on Sat, 22 Aug 2026 17:40:52 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/joker_chang" aria-label="Profile: joker_chang">@<bdi>joker_chang</bdi></a> 提交之前发给AI整理成markdown格式，我帮你整理了。</p>
]]></description><link>https://lcz.me/post/13499</link><guid isPermaLink="true">https://lcz.me/post/13499</guid><dc:creator><![CDATA[terry]]></dc:creator><pubDate>Sat, 22 Aug 2026 17:40:52 GMT</pubDate></item><item><title><![CDATA[Reply to llama.cpp应该及时更新版本和调整参数了😄 on Sat, 22 Aug 2026 06:23:04 GMT]]></title><description><![CDATA[<p dir="auto">我用的turbo3的KV Cache 比 q4_0 省显存 性能也更好</p>
]]></description><link>https://lcz.me/post/13443</link><guid isPermaLink="true">https://lcz.me/post/13443</guid><dc:creator><![CDATA[Jioyzen]]></dc:creator><pubDate>Sat, 22 Aug 2026 06:23:04 GMT</pubDate></item></channel></rss>