<?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[SGlang开启hicache L2/L3 kv缓存]]></title><description><![CDATA[<h1>SGlang开启hicache L2/L3 kv缓存</h1>
<hr />
<h2>1. 开启hicache有什么用？</h2>
<p dir="auto">显存里的 KV Cache 放不下，就把暂时不用的 KV Cache“搬到内存/磁盘”，需要时再取回来，从而让超长上下文、多个会话能够复用之前算过的 KV，<strong>而不必重新 Prefill</strong>。</p>
<p dir="auto"><strong>你可以把它理解成 “显存 → 内存 → 磁盘”的 KV Cache 多级缓存。</strong></p>
<p dir="auto">L1  -&gt; VRAM<br />
L2 -&gt; RAM<br />
L3 -&gt; NVME</p>
<h2>2.如何开启</h2>
<ul>
<li>
<p dir="auto">开启RAM缓存<br />
--enable-hierarchical-cache --hicache-size 32</p>
</li>
<li>
<p dir="auto">开启NVME缓存<br />
--hicache-storage-backend file</p>
</li>
</ul>
<h2>3. 测试</h2>
<ul>
<li>
<p dir="auto">缓存启用成功<br />
<img src="https://upload.lcz.me/uploads/e94e587e-7dfd-4449-b89d-c22441389804.jpeg" alt="a8db1775-24af-4a5e-aa2a-191b1247dfd9-image.jpeg" class=" img-fluid img-markdown" /></p>
</li>
<li>
<p dir="auto">重启sglang，开启对话，之前会话的190K上下文直接加载，不用prefill<br />
<img src="https://upload.lcz.me/uploads/bc942f48-feb2-45b6-ba37-98a90ffe8120.jpeg" alt="5e514dd6-f375-4d6b-81a6-ea1b2ec67a68-image.jpeg" class=" img-fluid img-markdown" /></p>
</li>
</ul>
]]></description><link>https://lcz.me/topic/1325</link><generator>RSS for Node</generator><lastBuildDate>Mon, 07 Sep 2026 19:27:10 GMT</lastBuildDate><atom:link href="https://lcz.me/topic/1325.rss" rel="self" type="application/rss+xml"/><pubDate>Tue, 25 Aug 2026 18:17:57 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to SGlang开启hicache L2/L3 kv缓存 on Tue, 25 Aug 2026 23:17:45 GMT]]></title><description><![CDATA[<p dir="auto">很好的分享，这就是我目前的掣肘。<br />
如果多会话不用担心重新prefill，sglang的实用度会进一步上升</p>
]]></description><link>https://lcz.me/post/13971</link><guid isPermaLink="true">https://lcz.me/post/13971</guid><dc:creator><![CDATA[kop wang]]></dc:creator><pubDate>Tue, 25 Aug 2026 23:17:45 GMT</pubDate></item><item><title><![CDATA[Reply to SGlang开启hicache L2/L3 kv缓存 on Tue, 25 Aug 2026 22:41:41 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/neo" aria-label="Profile: neo">@<bdi>neo</bdi></a> 这样就不用折腾换Q4模型了，SGLang还是用FP8更稳。</p>
]]></description><link>https://lcz.me/post/13968</link><guid isPermaLink="true">https://lcz.me/post/13968</guid><dc:creator><![CDATA[terry]]></dc:creator><pubDate>Tue, 25 Aug 2026 22:41:41 GMT</pubDate></item><item><title><![CDATA[Reply to SGlang开启hicache L2/L3 kv缓存 on Tue, 25 Aug 2026 21:47:58 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/terry" aria-label="Profile: terry">@<bdi>terry</bdi></a> 可以这么理解，多会话，多并发更顺畅了，prefill减少，效率变高，会话切换不用等。</p>
]]></description><link>https://lcz.me/post/13963</link><guid isPermaLink="true">https://lcz.me/post/13963</guid><dc:creator><![CDATA[neo]]></dc:creator><pubDate>Tue, 25 Aug 2026 21:47:58 GMT</pubDate></item><item><title><![CDATA[Reply to SGlang开启hicache L2/L3 kv缓存 on Tue, 25 Aug 2026 19:50:04 GMT]]></title><description><![CDATA[<p dir="auto">非常好的分享，那是意味着可以开更多会话吗？</p>
]]></description><link>https://lcz.me/post/13954</link><guid isPermaLink="true">https://lcz.me/post/13954</guid><dc:creator><![CDATA[terry]]></dc:creator><pubDate>Tue, 25 Aug 2026 19:50:04 GMT</pubDate></item></channel></rss>