<?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[X99 双 7900 XTX 踩坑日记：分卡、MTP、思考模式三连坑]]></title><description><![CDATA[<blockquote>
<p dir="auto">硬件环境：X99 双路 E5-2682v4 / DDR4 2133 / Sapphire Pulse 7900 XTX + XFX MERC 7900 XTX + RTX 3080 Ti / ROCm 7.2.0 / CainSay llama.cpp fork</p>
</blockquote>
<h2>前言</h2>
<p dir="auto">之前搞 CainSay MTP+ngram 双卡推测解码时一切顺利，结果这次在**单卡模式 C（MTP Q4_K_P）**上栽了三个连环坑。记录一下，后人别踩。</p>
<hr />
<h2>坑一：模式定义混乱（都是AI/Deepseek v4 Flash的锅，自作主张）</h2>
<p dir="auto"><strong>背景</strong>：原有的单卡三模式：</p>
<ul>
<li>A：Huihui Q4_K_M + DFlash（84 tok/s，bench only）</li>
<li>B：HauhauCS IQ4_XS（30 tok/s，128K）</li>
<li>C：MTP Q4_K_P + MTP n=3（~47 tok/s）</li>
</ul>
<p dir="auto"><strong>踩坑</strong>：我想给 Hermes 找个 API server 可用的模式，自作主张搞了个"四不像"——Huihui Q4_K_M + 标准 AR 自回归。既没 DFlash 加速（丢掉了模式 A 的 84 tok/s），又没 MTP 推测加速（不如模式 C 的 47 tok/s），也没 IQ4_XS 的 128K 上下文（不如模式 B）。<strong>30 tok/s 的四不像毫无存在意义。</strong></p>
<p dir="auto"><strong>教训</strong>：已有清晰定义的不要乱改，先问用户（给各位用hermes的留一个经验吧）。</p>
<hr />
<h2>坑二：ComfyUI 抢占 GPU</h2>
<p dir="auto"><strong>背景</strong>：241 上有三张卡——2×7900 XTX + 1×3080 Ti。设计分配：</p>
<ul>
<li>GPU 0（Sapphire Pulse）→ Qwen 单卡</li>
<li>GPU 1（XFX MERC）→ ComfyUI</li>
</ul>
<p dir="auto"><strong>踩坑</strong>：之前测试模式 C 时长久不用的 ComfyUI 跑在了 GPU 1（XFX）上，占了 6.7GB VRAM。而模式 C 脚本也指定 GPU 1（UUID <code>GPU-8accafcdfee6fc4f</code>），导致加载 16.7GB MTP 模型时 OOM：</p>
<pre><code>E ggml_backend_cuda_buffer_type_alloc_buffer: allocating 1995.00 MiB on device 0: cudaMalloc failed: out of memory
</code></pre>
<p dir="auto"><strong>排查过程</strong>：</p>
<ol>
<li><code>rocm-smi --showpids</code> 发现 PID 138160（python = ComfyUI）吃了 GPU 1 的 6.7GB</li>
<li>ROCm 拓扑映射：<code>GPU[0]=PCI 04:00.0=card1=Sapphire</code>、<code>GPU[1]=PCI 07:00.0=card3=XFX</code></li>
<li>ComfyUI 用 <code>HIP_VISIBLE_DEVICES=1</code>（索引号指向 GPU 1 XFX），模式 C 用 UUID <code>GPU-8accafcdfee6fc4f</code>（也是 XFX）</li>
</ol>
<p dir="auto"><strong>修复</strong>：用 <code>start-comfyui-with-qwen.sh</code> 正确分卡：</p>
<pre><code>ComfyUI → HIP_VISIBLE_DEVICES=1 → XFX MERC (GPU 1)
Qwen    → HIP_VISIBLE_DEVICES=0 → Sapphire Pulse (GPU 0)
</code></pre>
<p dir="auto">分卡后各自正常：</p>
<pre><code>Sapphire: 21.6GB / 24GB（Qwen MTP）
XFX:       0.3GB / 24GB（ComfyUI 空载）
</code></pre>
<p dir="auto"><strong>教训</strong>：<code>start-comfyui-with-qwen.sh</code> 才是可靠的分卡方案，不要手动 kill/start。</p>
<hr />
<h2>坑三：MTP 模型的思考模式</h2>
<p dir="auto"><strong>最大坑</strong>。HauhauCS-Balanced-MTP-Q4_K_P 这个模型<strong>内置了思考/推理模板</strong>，默认输出格式：</p>
<pre><code class="language-json">{
  "role": "assistant",
  "content": "",
  "reasoning_content": "Here's a thinking process:\n\n1. Analyze User Input..."
}
</code></pre>
<p dir="auto">所有输出都塞进 <code>reasoning_content</code>，<code>content</code> 字段永远为空。Hermes 只读 <code>content</code>，所以收到空回复。</p>
<p dir="auto"><strong>尝试修复</strong>：</p>
<ol>
<li><code>--reasoning-format deepseek-legacy</code> → 依然 content 为空</li>
<li>加大 <code>max_tokens=300</code> → 仍然全部在 reasoning_content，最终回答草稿也写在 reasoning 里</li>
<li>结论：<strong>这是模型训练时固定的输出格式</strong>，没有 分隔，无法分离"思考"和"回答"</li>
</ol>
<p dir="auto"><strong>最终方案</strong>：加 <code>--reasoning off</code> 关闭思考模式，content 恢复正常：</p>
<pre><code class="language-json">{
  "content": "你好！👋 请问有什么我可以帮你的吗？",
  "reasoning_content": "no reasoning"
}
</code></pre>
<p dir="auto"><strong>教训</strong>：社区微调模型可能改了输出格式，<code>--reasoning off</code> 对 Hermes 这类只读 <code>content</code> 字段的客户端是必备参数。</p>
<hr />
<h2>最终配置（可复现）</h2>
<pre><code>┌──────────────────────────────────────────────────────────┐
│  241 最终分卡方案                                        │
│  ComfyUI → GPU 1 (XFX)     端口 8188                    │
│  Qwen 模式C → GPU 0 (Sapphire) 端口 11435               │
├──────────────────────────────────────────────────────────┤
│  Qwen 启动参数：                                          │
│  --spec-type draft-mtp --spec-draft-n-max 3              │
│  -ctk q8_0 -ctv q8_0                                    │
│  -fa 1 -b 2048 -ub 512                                  │
│  --reasoning off                                          │
│  --repeat-penalty 1.1 --repeat-last-n 64                 │
├──────────────────────────────────────────────────────────┤
│  性能：短提示(13 tokens) 17 tok/s                        │
│        长提示(14 tokens) 29 tok/s                        │
│  接受率：短提示 38%，长提示 100%                           │
└──────────────────────────────────────────────────────────┘
</code></pre>
<p dir="auto">问：MTP 模式下能同时跑 ComfyUI 吗？<br />
答：可以，前提是用 <code>start-comfyui-with-qwen.sh</code> 正确分卡。ComfyUI 至今没加载模型所以只有 0.3GB 占用，如果加载大模型要注意两卡各自的 VRAM 余量。</p>
<p dir="auto">问：模式 A（DFlash）和模式 C（MTP）哪个快？<br />
答：模式 A 单卡 bench 84 tok/s 但无 server，模式 C 有 server 但 17-29 tok/s 受 CPU/DDR4 瓶颈限制。两码事不能直接比。</p>
<p dir="auto">（其实这件事还有下文，就是被hermes弄乱了单卡模式，导致comfyui一直OOM，后面再水文了）</p>
]]></description><link>https://lcz.me/topic/623/x99-双-7900-xtx-踩坑日记-分卡-mtp-思考模式三连坑</link><generator>RSS for Node</generator><lastBuildDate>Wed, 01 Jul 2026 18:02:27 GMT</lastBuildDate><atom:link href="https://lcz.me/topic/623.rss" rel="self" type="application/rss+xml"/><pubDate>Fri, 19 Jun 2026 03:03:21 GMT</pubDate><ttl>60</ttl></channel></rss>