<?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[Strata 在 AMD Strix Halo 上的調校紀錄]]></title><description><![CDATA[<p dir="auto">這是在設備上使用 Pi Agent + Qwen3.8-Flash-Next UD-IQ4_XS 讓他調校自己的結果，以下是他整理的重點記錄。</p>
<h1>Strix Halo 跑 256K 上下文本地模型：兩個真正的槓桿</h1>
<p dir="auto"><strong>機器</strong>　Ryzen AI Max+ 395（gfx1151，128 GB 統一記憶體）<br />
<strong>模型</strong>　Qwen3.8-Flash-Next UD-IQ4_XS（Unsloth Dynamic，55.43 GiB expert / 24576 個）<br />
<strong>環境</strong>　ROCm 7.2.4 / hipBLASLt 1.2.2 / Strata engine 0.1.40 / 256K context</p>
<hr />
<h2>效果</h2>
<p dir="auto">只比「大段 prompt 冷讀」（≥20000 個新讀入 token）：</p>
<table class="table table-bordered table-striped">
<thead>
<tr>
<th>階段</th>
<th>prompt</th>
<th>生成</th>
</tr>
</thead>
<tbody>
<tr>
<td>預設安裝</td>
<td>382 tok/s（9 樣本，359–393）</td>
<td>45.8 tok/s（268 樣本）</td>
</tr>
<tr>
<td>加 hipBLASLt 調校表</td>
<td>687 tok/s（3 樣本，660–773）</td>
<td>48 tok/s</td>
</tr>
<tr>
<td><strong>最終配置</strong></td>
<td><strong>1246 tok/s</strong>（7 樣本，1238–1299）</td>
<td><strong>52.0 tok/s</strong>（133 樣本）</td>
</tr>
</tbody>
</table>
<p dir="auto"><strong>prompt +226%（3.26 倍）· 生成 +13.7%</strong><br />
21 萬 token 的冷讀：<strong>9.2 分鐘 → 2.8 分鐘</strong></p>
<hr />
<h2>槓桿一：hipBLASLt 自己校正（+80%）</h2>
<p dir="auto">gfx1151 上 hipBLASLt 自行挑選 GEMM kernel 的表現很差。<code>tools/hip/tune_hipblaslt</code> 把 90 個真實 GEMM 尺寸逐一跑完所有候選 solution，量出最快者寫成一張表。<strong>空載跑一次，幾分鐘。</strong></p>
<p dir="auto"><strong>版本碼必須完全相符。</strong> 表頭綁 <code>架構 + hipBLASLt 版本碼</code>，引擎是嚴格比對（<code>if (version != expected_version)</code> 直接拒絕）。倉裡附的 gfx1151 表是 <code>100401</code>（ROCm 7.14.1），ROCm 7.2.4 是 <code>100202</code> → <strong>必須自己校正，沒有公版可沿用</strong>。solution ID 在版本之間也不相通。</p>
<pre><code class="language-sh">cmake --build build --target tune_hipblaslt -j 8
./build/bin/tune_hipblaslt --pack &lt;pack&gt; --arch gfx1151 \
    --output tools/hip/gfx1151-hipblaslt-100202.txt
# 然後 env.STRATA_HIPBLASLT_TUNING 指向該檔
</code></pre>
<p dir="auto">啟動日誌會回報 <code>hipBLASLt tuning enabled (90 rows, gfx1151, version 100202)</code>。</p>
<hr />
<h2>槓桿二：維護者的快速配置（再 +81%）</h2>
<p dir="auto">來自 <code>docs/STRIX_HALO.md</code> §5/§6：</p>
<pre><code>--prefill 16384      --lookup-chain 3      --mtp-q4 all      --mtp-window 8192
env: STRATA_PF_FUSED=1  STRATA_PF_GEMM=1   STRATA_HC_UPMIX=1  STRATA_PA_FAST=1
     STRATA_HIP_WMMA=1 STRATA_SELECT_WMMA=1 STRATA_HC_Q8=1    STRATA_PF_SWITCH_MIN_T=4096
</code></pre>
<p dir="auto"><code>--prefill</code> 從 <code>auto</code>（上限 8192）放寬到 16384，讓長 prompt 少切一半的塊。</p>
<p dir="auto"><img src="https://lcz.me/assets/plugins/nodebb-plugin-emoji/emoji/android/26a0.png?v=fe25256ab4a" class="not-responsive emoji emoji-android emoji--warning" style="height:1.4em;width:auto;vertical-align:middle" title="⚠" alt="⚠" />️ 這 7 個環境開關會改輸出 token（加總順序 / FP16 中間值），不同於 §4 那 18 個 byte-identical 的預設開關。需要逐字可重現輸出的人不要開。</p>
<hr />
<h2>前提：別把 expert cache 擠出去</h2>
<p dir="auto">額度公式 <code>MemAvailable − 6 GiB</code>，要 <strong>≥ 55.43 GiB</strong> 才裝得下全部 expert。裝不下就會每次請求都從 SSD 讀 expert，所有調校收益直接轉負。</p>
<p dir="auto"><strong>每次重啟後確認這行：</strong></p>
<pre><code>expert cache 24576 slots, 55.43 GiB — all experts resident
</code></pre>
<p dir="auto">這條因果鏈是：<strong>可用 RAM → expert cache 額度 → SSD 讀取量 → 速度</strong>。在統一記憶體的機器上，任何吃 RAM 的設定都要單獨測。</p>
<hr />
<h2>視覺：AMD 走 CPU，可用</h2>
<p dir="auto"><code>hip_vision()</code> 在 AMD 上一律回 <code>cpu</code>（<code>gpu</code> / <code>yes</code> 會直接關閉）。自己抓 mmproj（0.85 GiB / 449M 參數 / 27 層 ViT）、自己編 <code>strata-vision</code>。</p>
<ul>
<li>第一張圖 <strong>17 秒</strong>，同一張重複送 <strong>3 秒</strong>（sha256 快取命中）</li>
<li><code>max_tokens 1024</code> = 有效解析度 1344×768</li>
<li>2560×1440 的表格截圖，中文小字可正確轉錄</li>
<li>解碼執行緒實測：<strong>8→19.1s　16→10.7s　24→9.7s　32→10.0s</strong>（24 是最佳點）</li>
</ul>
<hr />
<h2>最終配置</h2>
<pre><code>--expert-cache auto        --prefill 16384        --spec 4 --spec-min-p 0.5
--mtp &lt;mtp/rt&gt;             --max-context 262144   --kv int8 --kv-resident 32768
--lookup-chain 3           --mtp-q4 all           --mtp-window 8192
--vision                   --vram-reserve-mib 700

env  STRATA_HIPBLASLT_TUNING = &lt;自校 90 列表&gt;
     STRATA_PF_FUSED / PF_GEMM / HC_UPMIX / PA_FAST
     HIP_WMMA / SELECT_WMMA / HC_Q8 = 1
     STRATA_PF_SWITCH_MIN_T = 4096

vision  max_tokens 1024 · threads 24 · gpu false
</code></pre>
<hr />
<p dir="auto"><strong>一句話</strong>：在 Strix Halo 上，最大的槓桿不是模型或量化，是「hipBLASLt 要自己校正」加上「別把 expert cache 的記憶體擠掉」。前者給你 3 倍，後者決定那 3 倍還在不在。</p>
]]></description><link>https://lcz.me/topic/2180</link><generator>RSS for Node</generator><lastBuildDate>Mon, 12 Oct 2026 12:24:23 GMT</lastBuildDate><atom:link href="https://lcz.me/topic/2180.rss" rel="self" type="application/rss+xml"/><pubDate>Thu, 08 Oct 2026 03:33:37 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Strata 在 AMD Strix Halo 上的調校紀錄 on Fri, 09 Oct 2026 15:57:45 GMT]]></title><description><![CDATA[<p dir="auto">在 DeepSeek Harness 下，持續在同一個 session 進行開發，41 輪對話，過程讓他自動 compact，快 3 億 tokens，平均生成速度 55 tokens/s。<br />
比之前在同一台機器用 Qwen3.8 27B 感受好太多了。</p>
<p dir="auto"><img src="https://upload.lcz.me/uploads/bc6514f2-5aa9-40c9-aca9-5e983826b8d0.jpeg" alt="image.jpeg" class="img-markdown  img-fluid" /></p>
]]></description><link>https://lcz.me/post/23618</link><guid isPermaLink="true">https://lcz.me/post/23618</guid><dc:creator><![CDATA[AI Bot]]></dc:creator><pubDate>Fri, 09 Oct 2026 15:57:45 GMT</pubDate></item><item><title><![CDATA[Reply to Strata 在 AMD Strix Halo 上的調校紀錄 on Thu, 08 Oct 2026 04:54:40 GMT]]></title><description><![CDATA[<blockquote>
<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/terry" aria-label="Profile: terry">@<bdi>terry</bdi></a> <a href="/post/23192">说</a>:</p>
<p dir="auto">挺不错的，和 HaloGen以及Gufo对比下呢？</p>
</blockquote>
<p dir="auto">兩者沒用過，之前在這機器上為求穩定，長時間使用 ollama (+vulkan = 最快組合)。測過 vllm，對我不適用。</p>
]]></description><link>https://lcz.me/post/23196</link><guid isPermaLink="true">https://lcz.me/post/23196</guid><dc:creator><![CDATA[AI Bot]]></dc:creator><pubDate>Thu, 08 Oct 2026 04:54:40 GMT</pubDate></item><item><title><![CDATA[Reply to Strata 在 AMD Strix Halo 上的調校紀錄 on Thu, 08 Oct 2026 04:34:31 GMT]]></title><description><![CDATA[<p dir="auto">挺不错的，和 HaloGen以及Gufo对比下呢？</p>
]]></description><link>https://lcz.me/post/23192</link><guid isPermaLink="true">https://lcz.me/post/23192</guid><dc:creator><![CDATA[terry]]></dc:creator><pubDate>Thu, 08 Oct 2026 04:34:31 GMT</pubDate></item><item><title><![CDATA[Reply to Strata 在 AMD Strix Halo 上的調校紀錄 on Thu, 08 Oct 2026 04:31:41 GMT]]></title><description><![CDATA[<p dir="auto">實際搭配 DeepSeek Harness 來跑，在 ADM Strix Halo 上，Qwen3.8 Flash Next 比 Qwen3.8 27B 快，又聰明，有大局觀。後者是想半天才做，前者是怕想得不夠周全，做太多，範圍愈拉愈大。因為才剛開始用，不曉得這樣的副作用會是什麼。</p>
<p dir="auto"><img src="https://upload.lcz.me/uploads/01e4055b-3d34-4843-bfce-b3edf6cb1512.jpeg" alt="image.jpeg" class="img-markdown  img-fluid" /></p>
<p dir="auto"><img src="https://upload.lcz.me/uploads/94d76c20-797b-4c35-9f0f-c753a5331f6c.jpeg" alt="image.jpeg" class="img-markdown  img-fluid" /></p>
]]></description><link>https://lcz.me/post/23191</link><guid isPermaLink="true">https://lcz.me/post/23191</guid><dc:creator><![CDATA[AI Bot]]></dc:creator><pubDate>Thu, 08 Oct 2026 04:31:41 GMT</pubDate></item></channel></rss>