<?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[Avalon大家试了吗 AMD又要冲一波了]]></title><description><![CDATA[<p dir="auto">号称比strata快44%，准备试一下看看</p>
]]></description><link>https://lcz.me/topic/2897</link><generator>RSS for Node</generator><lastBuildDate>Mon, 09 Nov 2026 11:54:23 GMT</lastBuildDate><atom:link href="https://lcz.me/topic/2897.rss" rel="self" type="application/rss+xml"/><pubDate>Sat, 07 Nov 2026 06:54:55 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Avalon大家试了吗 AMD又要冲一波了 on Sun, 08 Nov 2026 14:31:55 GMT]]></title><description><![CDATA[<p dir="auto">我是7900XTX+64G DDR4，CPU是i7 7700，感觉CPU是主要瓶颈。用Strata跑IQ3_S，prefill不到1000，decode大概40~50t/s。Strata-RDNA3的prefill最快能到3000以上，decode 50~70t/s。Avalon的prefill2000以上，decode 70~100t/s。</p>
]]></description><link>https://lcz.me/post/31958</link><guid isPermaLink="true">https://lcz.me/post/31958</guid><dc:creator><![CDATA[Dan Xia]]></dc:creator><pubDate>Sun, 08 Nov 2026 14:31:55 GMT</pubDate></item><item><title><![CDATA[Reply to Avalon大家试了吗 AMD又要冲一波了 on Sun, 08 Nov 2026 12:28:43 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> 读了下作者描述，预估跟rdna3分支提升差不多</p>
]]></description><link>https://lcz.me/post/31941</link><guid isPermaLink="true">https://lcz.me/post/31941</guid><dc:creator><![CDATA[J Z 0]]></dc:creator><pubDate>Sun, 08 Nov 2026 12:28:43 GMT</pubDate></item><item><title><![CDATA[Reply to Avalon大家试了吗 AMD又要冲一波了 on Sun, 08 Nov 2026 12:01:28 GMT]]></title><description><![CDATA[<p dir="auto">有人测试了吗，速度有没有提升。我也是amd7900xtx。</p>
]]></description><link>https://lcz.me/post/31933</link><guid isPermaLink="true">https://lcz.me/post/31933</guid><dc:creator><![CDATA[ma yi]]></dc:creator><pubDate>Sun, 08 Nov 2026 12:01:28 GMT</pubDate></item><item><title><![CDATA[Reply to Avalon大家试了吗 AMD又要冲一波了 on Sat, 07 Nov 2026 15:23:48 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/mmiker" aria-label="Profile: mmiker">@<bdi>mmiker</bdi></a> 对比下strata呢，单独发给帖子，我给置顶下</p>
]]></description><link>https://lcz.me/post/31781</link><guid isPermaLink="true">https://lcz.me/post/31781</guid><dc:creator><![CDATA[terry]]></dc:creator><pubDate>Sat, 07 Nov 2026 15:23:48 GMT</pubDate></item><item><title><![CDATA[Reply to Avalon大家试了吗 AMD又要冲一波了 on Sat, 07 Nov 2026 15:16:03 GMT]]></title><description><![CDATA[<h1>Avalon (Qwen3.8-Flash-Next) Windows 部署文档</h1>
<blockquote>
<p dir="auto">日期：2026-11-07<br />
硬件：AMD RX 7900 XTX 24GB / Ryzen 5 5600G / DDR4 双通道（系统实际识别 63.4 GB）<br />
项目：<a href="https://github.com/freriadoc/Avalon" rel="nofollow ugc">https://github.com/freriadoc/Avalon</a> （llama.cpp 分支，专为 Qwen3.8-Flash-Next 125B MoE 优化）<br />
成果：Windows 下从零编译部署成功，实测生成 54–58 t/s（MTP，512 token）</p>
</blockquote>
<hr />
<h2>一、最终部署布局</h2>
<table class="table table-bordered table-striped">
<thead>
<tr>
<th>项</th>
<th>路径 / 值</th>
</tr>
</thead>
<tbody>
<tr>
<td>源码</td>
<td><code>C:\AI\Avalon</code>（git clone，main 分支）</td>
</tr>
<tr>
<td>可执行文件</td>
<td><code>C:\AI\Avalon\build\bin\llama-server.exe</code></td>
</tr>
<tr>
<td>启动脚本</td>
<td><code>C:\AI\Avalon\avalon-server.bat</code></td>
</tr>
<tr>
<td>模型</td>
<td><code>C:\AI\models\Avalon-GGUF</code>（91 GiB，33 分片 IQ3_KS + MTP + moe-cache-ranking.bin）</td>
</tr>
<tr>
<td>HIP SDK</td>
<td><code>C:\Program Files\AMD\ROCm\7.2</code></td>
</tr>
<tr>
<td>编译脚本</td>
<td><code>C:\AI\Avalon\build_windows.bat</code>（首次）/ <code>build_only.bat</code>（增量）</td>
</tr>
<tr>
<td>服务地址</td>
<td><code>http://0.0.0.0:8080</code>（OpenAI 兼容 <code>/v1/chat/completions</code>）</td>
</tr>
</tbody>
</table>
<p dir="auto"><img src="https://lcz.me/assets/plugins/nodebb-plugin-emoji/emoji/android/26a0.png?v=5be5614064c" class="not-responsive emoji emoji-android emoji--warning" style="height:1.4em;width:auto;vertical-align:middle" title="⚠" alt="⚠" />️ 模型<strong>必须放在 NVMe SSD</strong>。放机械硬盘时生成仅 3–6 t/s，挪到 NVMe 后 49–58 t/s。模型里有个 36 GB 的 per-layer token embedding 张量每个 token 都要访问，HDD 随机读直接把速度打死。</p>
<hr />
<h2>二、环境准备</h2>
<ol>
<li><strong>Visual Studio 2026 Community</strong>（含 MSVC 14.51、CMake、Ninja）——VS 自带 CMake 路径：<br />
<code>C:\Program Files\Microsoft Visual Studio\18\Community\Common7\IDE\CommonExtensions\Microsoft\CMake\{CMake\bin\cmake.exe, Ninja}</code></li>
<li><strong>AMD HIP SDK 7.2</strong>：官网下载页 → Windows 11 / 7.2，实际直链（1.6 GB）：<br />
<code>https://download.amd.com/developer/eula/rocm-hub/AMD-Software-PRO-Edition-26.Q3-Win11-For-HIP.exe</code><br />
静默安装：<code>Start-Process &lt;exe&gt; -ArgumentList '-install','-log','C:\AI\hip_install.log' -Verb RunAs -Wait</code>（会弹 UAC）</li>
<li><strong>git</strong>，<strong>python 3.14 + huggingface_hub</strong>（<code>pip install huggingface_hub</code>，下载用 <code>hf.exe</code>，位于 <code>%APPDATA%\Python\Python314\Scripts</code>）</li>
<li>网络代理：本机 <code>127.0.0.1:7890</code> 可用（git/curl 走 <code>-x http://127.0.0.1:7890</code>；GitHub 直连超时）</li>
</ol>
<hr />
<h2>三、编译（关键坑与解法）</h2>
<p dir="auto">配置命令（在 <code>build_windows.bat</code> 内完成，需 vcvars64 环境）：</p>
<pre><code class="language-bat">call "...\VC\Auxiliary\Build\vcvars64.bat"
set HIP_PATH=C:\Program Files\AMD\ROCm\7.2
set CXXFLAGS=-isystem C:\AI\Avalon\hip_compat
cmake -B build -G Ninja -DGGML_HIP=ON -DAMDGPU_TARGETS=gfx1100 ^
  -DCMAKE_BUILD_TYPE=Release -DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++
cmake --build build --target llama-server -j 8
</code></pre>
<h3>坑 1：MSVC 14.51 <code>&lt;cmath&gt;</code> 与 HIP clang 冲突（必须修）</h3>
<p dir="auto">错误形态：</p>
<pre><code>error: __device__ function 'isgreater' cannot overload __host__ __device__ function 'isgreater'
  （引用 MSVC 14.51 cmath 的 _CLANG_BUILTIN2(isgreater)）
</code></pre>
<p dir="auto">原因：MSVC 14.51 起把 <code>isgreater/isless</code> 等声明为 constexpr（clang 下隐含 <code>__host__ __device__</code>），与 ROCm clang 的 <code>__device__</code> 声明冲突。上游修复见 LLVM PR #201563、Strata PR #373。</p>
<p dir="auto">解法（同 Strata 方案）：建垫片目录，并把 <code>CXXFLAGS=-isystem &lt;垫片目录&gt;</code> 加进环境：</p>
<pre><code class="language-cpp">// C:\AI\Avalon\hip_compat\cmath
#if defined(__HIP__)
#include &lt;__clang_cuda_math_forward_declares.h&gt;
#endif
#include_next &lt;cmath&gt;
</code></pre>
<p dir="auto">注意：<code>.bat</code> 里<strong>不要写中文注释</strong>（GBK 代码页下 UTF-8 中文会破坏 cmd 解析）。</p>
<h3>坑 2：<code>moe-cache.cu</code> POSIX <code>close()</code>（必须修）</h3>
<p dir="auto"><code>ggml/src/ggml-cuda/moe-cache.cu</code> 约 3647 行 <code>close(f.second)</code> 在 Windows 无此符号。修法：文件头部 <code>_WIN32</code> 块加 <code>#include &lt;io.h&gt;</code>，该处改为：</p>
<pre><code class="language-cpp">#if defined(_WIN32)
    _close(f.second);
#else
    close(f.second);
#endif
</code></pre>
<h3>其他</h3>
<ul>
<li>Ninja 不在 PATH：把上面 VS 的 Ninja 目录加进 PATH。</li>
<li>直接 <code>clang</code> 链接失败（<code>oldnames.lib</code> 找不到）：必须在 vcvars64 环境里跑 CMake。</li>
<li>编译时长约 25 分钟（iGPU 6 核，283 个目标）。</li>
</ul>
<hr />
<h2>四、模型下载</h2>
<pre><code class="language-bash"># 国内走 hf-mirror 更快；HuggingFace 官方源经代理实测会掉到 ~100KB/s
export HF_ENDPOINT=https://hf-mirror.com
hf download freriadoc/Qwen3.8-Flash-Next-Avalon-GGUF --local-dir C:\AI\models\Avalon-GGUF
</code></pre>
<ul>
<li>39 个文件共 91 GiB，镜像实测 ~200MB/s、21 分钟下完；官方源经代理 3 小时仅 3 GB。</li>
<li>校验目录：33 个 <code>Qwen3.8-Flash-Next-Avalon-IQ3KS-000xx-of-00033.gguf</code> + <code>MTP\mtp-...FR65k.gguf</code> + <code>moe-cache-ranking.bin</code>。</li>
<li><strong>与 Strata 的 IQ3_S 模型不通用</strong>（Avalon 用自有 IQ3_KS 混合量化 + 专属张量布局），必须单独下载。</li>
</ul>
<hr />
<h2>五、启动脚本 <code>avalon-server.bat</code></h2>
<pre><code class="language-bat">@echo off
set HIP_PATH=C:\Program Files\AMD\ROCm\7.2
set PATH=C:\AI\Avalon\build\bin;%HIP_PATH%\bin;%PATH%
set MODEL_DIR=C:\AI\models\Avalon-GGUF
set GGML_CUDA_MOE_ARENA_MB=46000

C:\AI\Avalon\build\bin\llama-server.exe ^
  -m "%MODEL_DIR%\Qwen3.8-Flash-Next-Avalon-IQ3KS-00001-of-00033.gguf" ^
  -c 262144 -b 9536 -ub 9536 -fa on -ctk q8_0 -ctv q4_0 --jinja --parallel 1 ^
  -md "%MODEL_DIR%\MTP\mtp-Qwen3.8-Flash-Next-shared-IQ3K-IQ4NL-FR65k.gguf" ^
  --spec-type draft-mtp --spec-draft-n-max 2 -ubd 256 -ctkd q8_0 -ctvd q8_0 ^
  --host 0.0.0.0 --port 8080 %*
</code></pre>
<p dir="auto">要点：</p>
<ul>
<li><strong><code>GGML_CUDA_MOE_ARENA_MB=46000</code> 是 Windows 上的必开项</strong>：Avalon 的 RAM 专家 arena 在 Windows 默认关闭（页缓存模式）。46 GB ≈ 专家总量 49 GiB 略留余量；内存紧张可降 40000。</li>
<li><code>--fit</code> 默认开：稠密权重进 GPU，专家进内存，GPU 专家缓存自动吃剩余显存（本机约 12.5 GB，来自 moe-cache-ranking.bin 热度排序）。</li>
<li>KV 缓存 q8_0/q4_0，262k 上下文 + MTP 全装得下 24 GB 显存。</li>
</ul>
<hr />
<h2>六、性能实测（RX 7900 XTX / 5600G / 63.4GB 可用内存）</h2>
<table class="table table-bordered table-striped">
<thead>
<tr>
<th>配置</th>
<th>生成 512 token (MTP)</th>
<th>短 prompt 预填充</th>
<th>启动加载</th>
</tr>
</thead>
<tbody>
<tr>
<td>模型在 HDD（HGST 2TB）</td>
<td>3.3 – 6.0 t/s</td>
<td>1.3 – 7.7 t/s</td>
<td>~9.5 分钟</td>
</tr>
<tr>
<td>模型 → NVMe SSD</td>
<td>49.4 t/s</td>
<td>~21 t/s</td>
<td>53 秒</td>
</tr>
<tr>
<td>+ 46GB 内存 arena</td>
<td><strong>54 – 58 t/s</strong></td>
<td>~26 t/s</td>
<td>—</td>
</tr>
<tr>
<td>作者参考（7900XT/64G/32k ctx）</td>
<td>98.4 t/s</td>
<td>~1700 t/s</td>
<td>—</td>
</tr>
</tbody>
</table>
<p dir="auto">按作者口径复测（32k ctx、贪心、MTP、3 轮平均）：<strong>57.7 t/s ≈ 标称 59%</strong>。差距主要来自：系统实际可用内存 63.4 GB（arena 装不满专家，部分走页缓存/SSD）+ CPU 6 核比作者 8 核慢。MTP 草稿接受率 0.58–0.73 正常，tail-skip 生效（<code>[moe-cache] tail skip (rank &gt;= 7)</code> 日志可确认）。</p>
<h3>排障速查</h3>
<table class="table table-bordered table-striped">
<thead>
<tr>
<th>症状</th>
<th>原因</th>
<th>处置</th>
</tr>
</thead>
<tbody>
<tr>
<td>速度个位数 t/s</td>
<td>模型在机械盘</td>
<td>挪 NVMe（robocopy /E /MT:8）</td>
</tr>
<tr>
<td>50 t/s 上不去 90+</td>
<td>内存 arena 未开或装不满</td>
<td>设 <code>GGML_CUDA_MOE_ARENA_MB</code>；检查系统实际可用内存</td>
</tr>
<tr>
<td>日志 <code>pin: 0 expert tensors registered</code></td>
<td>内存不足/驱动注册上限</td>
<td>正常现象（Windows 报 KFD 上限），靠 arena 解决</td>
</tr>
<tr>
<td>首轮请求极慢</td>
<td>GPU 专家缓存冷</td>
<td>热身 1–2 轮后再测</td>
</tr>
<tr>
<td>API 报 ill-formed UTF-8</td>
<td>git-bash 里 curl 传中文被转码</td>
<td>测试用英文 payload</td>
</tr>
</tbody>
</table>
<hr />
<h2>七、经验总结</h2>
<ol>
<li><strong>磁盘 &gt; 一切</strong>：本项目对存储延迟极敏感，模型必须在 NVMe；HDD 上速度差 10 倍。</li>
<li><strong>Windows arena 默认关</strong>：README 的 <code>GGML_CUDA_MOE_ARENA_MB=0</code> 注释容易误读——"on Windows it is still the default" 指的是<strong>旧行为</strong>在 Windows 是默认，想要 RAM arena 必须显式设值。</li>
<li><strong>VS 2026 (MSVC 14.51) + HIP SDK 7.2 的 cmath 冲突是必踩的坑</strong>，垫片头是官方认可解法；不想折腾可改装 VS 2022 的 MSVC 14.4x。</li>
<li><strong>镜像下载</strong>：国内环境 <code>HF_ENDPOINT=https://hf-mirror.com</code> 比"官方源+代理"快百倍。</li>
<li><strong>内存识别</strong>：装机内存 ≠ 系统可用内存，部署前先看 llama-server 日志里的 <code>CPU: ... (64893 MiB, ...)</code> 一行确认可用量。</li>
<li><strong>与 Strata 模型不通用</strong>，别指望复用 IQ3_S 文件。</li>
</ol>
]]></description><link>https://lcz.me/post/31780</link><guid isPermaLink="true">https://lcz.me/post/31780</guid><dc:creator><![CDATA[mmiker]]></dc:creator><pubDate>Sat, 07 Nov 2026 15:16:03 GMT</pubDate></item></channel></rss>