<?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[7900XTX 跑 MiniMax-H3：不缺comfy-aimdo动态卸载，是注意力那一行没开。一行代码让 15 秒档从跑不完变成 73 分钟（5s / 15s 实测）]]></title><description><![CDATA[<p dir="auto"><strong>标签</strong>：<code>7900xtx</code> <code>视频生成</code> <code>minimax-h3</code> <code>rocm</code> <code>comfyui</code>　　<strong>版块</strong>：AI音视频画图</p>
<hr />
<h1>24G 的 7900 XTX 跑 MiniMax-H3：不是缺动态卸载，是注意力那一行没开。一行代码让 15 秒档从跑不完变成 73 分钟（5s / 15s 实测）</h1>
<p dir="auto"><strong>机器（简化配置）</strong></p>
<ul>
<li><strong>A（A 卡，主角）</strong>：Ryzen 9 5950X / 128G DDR4 / 2×RX 7900 XTX 24G（gfx1100，两张实测都在 PCIe 4.0 <strong>x8</strong>，测试只用其中一张）/ Ubuntu 24.04 / ROCm 7.2.3 + torch 2.12.1（后半升到 7.14 + torch 2.15.0）/ ComfyUI 0.39.0 + comfy-aimdo 0.5.5→0.6.0</li>
<li><strong>B（N 卡，对照用）</strong>：Ryzen 7 9700X / 92G / <strong>RTX 4080 SUPER 32G</strong>（改装卡，PCIe 4.0 x16）/ Ubuntu 24.04 / 驱动 595.99.02 + torch 2.13.0+cu130 / ComfyUI fb2b26f</li>
</ul>
<p dir="auto"><strong>来源与感谢</strong></p>
<ul>
<li>要验的是 <a href="https://lcz.me/topic/2867">topic 2867</a> 里的一组说法：<a href="https://lcz.me/post/31292">#1</a> 六张卡同一流程的实测，里面"16 GB 能跑、24 GB 反而 OOM"那一节；和 <a href="https://lcz.me/post/31937">#13</a> 那张对比表——5080 16G 能跑 15 秒 = 有 <code>comfy-aimdo</code> 动态卸载，7900 XTX 24G 跑不了 = "AMD 缺这套机制"。谢谢 <a href="https://lcz.me/topic/2867">楼主 Big Liao</a> 一整组数据，也谢谢 terry 那张表。</li>
<li>同帖 <a href="https://lcz.me/post/31997">#17</a>（匿名取不到名字，链接里有）已经在<strong>单张 7900 XTX</strong> 上把 15 秒 / 1.0MP / 4 步跑通了、没 OOM。我这边只是把 <strong>8 步 + 带参考音频</strong>的完整 ref2va 补上。谢谢他先趟过一遍。</li>
<li><strong>最关键的那条不是我发现的</strong>：上游 <a href="https://github.com/Comfy-Org/ComfyUI/issues/17572" rel="nofollow ugc">ComfyUI issue #17572</a> 已经报了 gfx1100 漏了 contiguous-k/v 的补救，下面那段补丁也是照那边写的。谢谢报 issue 和写补丁的人。</li>
</ul>
<h2>0. 结论先放这里</h2>
<ul>
<li><strong>comfy-aimdo 在 RX 7900 XTX 上是工作的</strong>：约 43 GB 的工作集压在 24 GB 上，15 秒档（362 帧 @24fps）<strong>跑完了</strong>，没有 OOM。</li>
<li>让这张 24G 的 A 卡慢到"跑不动"的，主要不是显存，是<strong>注意力</strong>：ComfyUI 里那段 ROCm 补救<strong>只判了 gfx1151，没判 gfx1100</strong>。补上这一行——<strong>单步 197 s/it → 72 s/it，5 秒档 1638 s → 619 s（2.65 倍）</strong>，15 秒档从跑不完变成 73 分钟。</li>
<li>升 ROCm、换更小的权重、改显存分块——<strong>这几条我都试了，没有一条有用</strong>。</li>
</ul>
<h2>1. 详细环境（模型与版本）</h2>
<p dir="auto">两台模型一致：</p>
<pre><code class="language-text">minimax_h3_ref2va_pruned_int8_convrot.safetensors   UNET  20.97 GB
qwen3vl_32b_minimax_h3_nvfp4_awq.safetensors        TE    15.69 GB
minimax_h3_video_vae_fp16 / minimax_h3_audio_vae_fp32       5.21 / 0.61 GB
minimax_h3_dmd_ref2va_8step_turbo_pruned.safetensors LoRA  2.29 GB
</code></pre>
<blockquote>
<p dir="auto">注意：加速 LoRA 用的是 <strong>dmd 8step turbo</strong>，和 2867 里的 <code>dmad_minimax_h3_8step_full_critic</code> <strong>不是同一个</strong>。所以我这些绝对值不能直接跟那张表比，下面的对照<strong>只用同一台机器上的前后</strong>。</p>
</blockquote>
<p dir="auto">A 机器上跑的过程中改过这些（都记下来，免得后面的人重复踩）：ROCm 7.2.3→7.14、torch 2.12.1→2.15.0、comfy-aimdo 0.5.5→0.6.0、<code>vram_buffer.py</code> 的分块 2 MiB<img src="https://lcz.me/assets/plugins/nodebb-plugin-emoji/emoji/android/2194.png?v=2bf455356c3" class="not-responsive emoji emoji-android emoji--left_right_arrow" style="height:1.4em;width:auto;vertical-align:middle" title="↔" alt="↔" />16 MiB、<code>comfy/ops.py</code> 加补丁（备份 <code>ops.py.orig-sdpa</code>）。</p>
<h2>2. 跑的是什么</h2>
<ul>
<li>图：<code>MiniMaxH3Director</code> + <code>MiniMaxH3DirectorGroupReferenceToVideo</code>（r2v 组节点），<strong>带参考图 + 参考音频</strong>。B 机器上没这组节点，用的是 core 节点（<code>MiniMaxH3ReferenceToVideo</code> + <code>KSampler</code> + <code>VAEDecode</code>）。</li>
<li>采样：1344×768 · 8 步 · euler / simple · cfg 1.0 · seed 42 · 24fps。</li>
<li>时长：<strong>5 秒（120 帧）与 15 秒（362 帧）</strong>，同一场景的短、长两版台词。<strong>10 秒档没跑。</strong></li>
</ul>
<p dir="auto">5 秒的提示词（15 秒是同场景加到三句台词 + 动作）：</p>
<blockquote>
<p dir="auto">镜头特写：一位短发女性坐在雨天的咖啡馆窗边，抬头看向镜头，轻声说："今天的雨，好像停不下来了。" &lt;Picture 1&gt; 是她的外貌参考，&lt;Audio 1&gt; 是她的音色参考。</p>
</blockquote>
<h2>3. 数据</h2>
<table class="table table-bordered table-striped">
<thead>
<tr>
<th>配置</th>
<th>5 秒</th>
<th>15 秒</th>
</tr>
</thead>
<tbody>
<tr>
<td>A · 7900 XTX 24G · aimdo</td>
<td>1638 s</td>
<td>没跑完（中途停）</td>
</tr>
<tr>
<td>A · 同上 + <strong>一行补丁</strong></td>
<td><strong>619 s</strong></td>
<td><strong>4374 s</strong></td>
</tr>
<tr>
<td>B · 4080 SUPER 32G · aimdo</td>
<td>233 s</td>
<td>1510 s</td>
</tr>
<tr>
<td>B · 同一台，<code>--lowvram</code></td>
<td>269 s</td>
<td>1693 s</td>
</tr>
</tbody>
</table>
<p dir="auto">15 秒在 24G 上跑完时的单步：</p>
<pre><code class="language-text">1/8        含模型初始化 16:14
2/8        487 s/it
3/8 ~ 8/8  534.2 – 534.7 s/it
VAE 解码 + 收尾  约 190 s        合计 4374 s
</code></pre>
<p dir="auto">改之前那条 15 秒我没拿到完成数：按当时 ~197 s/it 外推要 3 小时以上，跑到中途我主动停了。</p>
<h2>4. 卡住的是注意力，不是显存</h2>
<p dir="auto"><a href="https://github.com/Comfy-Org/ComfyUI/issues/17572" rel="nofollow ugc">issue #17572</a> 说得很直接：<strong>AOTriton 的 attention 在 strided k/v 上，一旦超出 L2 就急剧变慢，而 ComfyUI 那段补救只判了 gfx1151。</strong></p>
<p dir="auto">我照那个 issue 里的 micro-benchmark 在 7900 XTX 上跑：</p>
<pre><code class="language-text">bf16, 1x24xLx128, gfx1100, torch 2.15.0+rocm7.14, L2 = 6 MB
L= 8192   contiguous    22.8 ms   strided     22.8 ms   1.00x
L=32768   contiguous   323.6 ms   strided   1841.0 ms   5.69x
</code></pre>
<p dir="auto">0.39.0 的 <code>comfy/ops.py</code> 里<strong>这一整段都不存在</strong>。照 #17572 补两处：</p>
<pre><code class="language-python">if props.gcnArchName.split(':')[0] in ("gfx1151", "gfx1100"):
    SDPA_CONTIGUOUS_KV_L2_SIZE = props.L2_cache_size

if SDPA_CONTIGUOUS_KV_L2_SIZE and sum(t.shape[-2]*t.shape[-1]
        for t in (k, v) if not t.is_contiguous()) * k.element_size() \
        &gt; SDPA_CONTIGUOUS_KV_L2_SIZE:
    k, v = k.contiguous(), v.contiguous()
</code></pre>
<p dir="auto">生没生效不用猜，启动日志会打一行：</p>
<pre><code class="language-text">[INFO] SDPA contiguous-k/v workaround enabled for gfx1100 (L2 6291456)
</code></pre>
<p dir="auto">前后对比：</p>
<pre><code class="language-text">5 秒档    197 s/it -&gt; 72 s/it        1638 s -&gt; 619 s（2.65x）
15 秒档   ~200 s/it（外推 &gt;3 h）-&gt; 534 s/it   4374 s
</code></pre>
<p dir="auto">15 秒的单步是 5 秒的 <strong>7.4 倍</strong>，帧数只有 3 倍——<strong>注意力是平方级的</strong>。短视频上不明显，拉到 15 秒就吃掉一切。这也是为什么 16G 的 5080 看着"能跑"、24G 的 7900 XTX 反而难受：显存之外还有这一层。</p>
<h2>5. 显存那头确实在换页，但慢的不是带宽</h2>
<p dir="auto">A 机器上的工作集：</p>
<pre><code class="language-text">UNET int8   20.9 GB
TE  nvfp4   15.7 GB
video VAE    5.0 GB
audio VAE    0.6 GB
           ≈ 43 GB，压在 24 GB 上
</code></pre>
<p dir="auto">没修注意力时，每步 ~197 s 几乎全是换页，等效搬运 <strong>≈ 20 GB ÷ 197 s ≈ 100 MB/s</strong>。同机 H2D 实测 <strong>14.2 GB/s</strong>，差两个数量级——<strong>瓶颈在分配/驱逐那层的调用开销，不在 PCIe。</strong></p>
<p dir="auto">三个和这头有关的事实：</p>
<ul>
<li><strong>ROCm ≥ 7.14 才默认开 DynamicVRAM</strong>（判的是 <code>rocm_version &gt;= (7, 14)</code>，<a href="https://github.com/Comfy-Org/ComfyUI/commit/a7365071e47175fb06572d0a56d1bf4116c2f581" rel="nofollow ugc">这个提交</a>）；<strong>7.2.x 默认是关的</strong>，要手动 <code>--enable-dynamic-vram</code>。先确认日志有没有 <code>DynamicVRAM support detected and enabled</code>，再谈性能。</li>
<li><a href="https://github.com/Comfy-Org/comfy-aimdo/pull/59" rel="nofollow ugc">comfy-aimdo PR #59</a>：把 ROCm 的显存增长块从 2 MiB 改回 16 MiB（CUDA 一直是 16 MiB）。<strong>我只改 Python 侧试过一次，直接 <code>hipErrorIllegalAddress</code></strong>——那个 PR 同时改 <code>src/vrambuf.c</code>，两处粒度得一起改；我没重编 native，所以<strong>这条不能用来否定那个 PR</strong>。</li>
<li><a href="https://github.com/Comfy-Org/comfy-aimdo/issues/128" rel="nofollow ugc">comfy-aimdo issue #128</a>（未合）：每次分配都把"整个差额"全驱逐一遍，预算每 2 秒刷一次——显存一满就反复抖。</li>
</ul>
<h2>6. 走不通的路（都实测过，省得你们再试）</h2>
<table class="table table-bordered table-striped">
<thead>
<tr>
<th>试过的</th>
<th>结果</th>
</tr>
</thead>
<tbody>
<tr>
<td>ROCm 7.2.3 → 7.14 + torch 2.15</td>
<td><strong>没提速</strong>，有一次单步反而 ~492 s/it。升的价值是"默认开动态卸载"和新架构支持</td>
</tr>
<tr>
<td>comfy-aimdo 0.5.5 → 0.6.0</td>
<td>无变化（173.79 → 173.83 s/it）</td>
</tr>
<tr>
<td><code>--lowvram</code> 叠在 aimdo 上（24G）</td>
<td>更慢：1729 s vs 1638 s</td>
</tr>
<tr>
<td>UNET 换 <strong>W4A8（12.5 GB）</strong></td>
<td><strong>641 s</strong>，和 int8+LoRA 的 619 s 基本一样（当时与另一条并行跑，有争抢）</td>
</tr>
<tr>
<td><code>--disable-dynamic-vram --lowvram</code>（24G）</td>
<td>连续 <code>Pin error</code> 后<strong>进程段错误崩</strong>（在 Director 组节点里），没深挖</td>
</tr>
</tbody>
</table>
<p dir="auto"><strong>把权重压小没有意义</strong>：修好注意力之后，慢的地方不在权重搬运；而显存大头本来就是 TE 和 VAE，不是 UNET。</p>
<h2>7. B 机器（32G）上 aimdo 与 <code>--lowvram</code></h2>
<p dir="auto">同一台机器、同一张图、同一提示词，只换启动参数：</p>
<table class="table table-bordered table-striped">
<thead>
<tr>
<th>时长</th>
<th>aimdo</th>
<th><code>--lowvram</code></th>
</tr>
</thead>
<tbody>
<tr>
<td>5 秒</td>
<td><strong>233 s</strong></td>
<td>269 s</td>
</tr>
<tr>
<td>15 秒</td>
<td><strong>1510 s</strong></td>
<td>1693 s</td>
</tr>
</tbody>
</table>
<p dir="auto">显存够的时候 aimdo <strong>略快（13–15%）</strong>，但没有质变——因为不用换页，两条路都没压力。<strong>"能不能跑完"这种差别只在显存不够的时候出现。</strong></p>
<h2>8. 顺手三个坑（每个都让人白等很久）</h2>
<ol>
<li><code>--verbose DETAIL</code>：卡在 step 0 <strong>48 分钟</strong>。py-spy 抓到的栈停在 <code>Tensor.__repr__</code>，它在打印巨大的 latent。<strong>跑 AIGC 一律用 <code>--verbose INFO</code>。</strong></li>
<li>Director 时间线里的 <code>liveTaePreview</code> 默认开，<strong>每做一次预览就是一轮额外的显存往返</strong>；生成 JSON 里设 <code>"liveTaePreview": false</code>。</li>
<li>0.39.0 里 <code>MiniMaxH3ReferenceToVideo</code> 的签名变了，Director 包里还按位置传参，会直接报错；改成按关键字传参就好（一处小改）。</li>
</ol>
<h2>9. 复现</h2>
<pre><code class="language-bash"># 1) 先确认动态卸载开没开
python main.py --enable-dynamic-vram --verbose INFO
#    日志要有：DynamicVRAM support detected and enabled

# 2) 注意力的复现（不需要 ComfyUI，就是 #17572 那段）
TORCH_ROCM_AOTRITON_ENABLE_EXPERIMENTAL=1 python sdpa_bench.py
</code></pre>
<h2>10. 没测的、不确定的</h2>
<ul>
<li>每个配置<strong>只有一次</strong>，没有冷/热启动区分，没测功耗和内存峰值。</li>
<li>10 秒档、双卡 TP2、24G 上走 <code>--lowvram</code>（我那条崩了）、<strong>sol-attn / custom kernel 这类注意力后端</strong>（2867 里有朋友提过）——都没测。按第 4 节的量级，这几个方向值得试。</li>
<li>画质没法比（LoRA 不同）。我这版图末端是 <code>PreviewAny</code>，<strong>没落盘 mp4</strong>，只拿到时间数。</li>
<li>补丁是打在 0.39.0 上的；新版若已带这段，只要确认 arch 列表里<strong>有没有 gfx1100</strong>。</li>
</ul>
<p dir="auto"><strong>只带走一句</strong>：A 卡跑 H3，先去 <code>comfy/ops.py</code> 看那段有没有 gfx1100，再谈显存和量化。</p>
]]></description><link>https://lcz.me/topic/2957</link><generator>RSS for Node</generator><lastBuildDate>Sun, 29 Nov 2026 03:22:26 GMT</lastBuildDate><atom:link href="https://lcz.me/topic/2957.rss" rel="self" type="application/rss+xml"/><pubDate>Tue, 10 Nov 2026 08:27:26 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to 7900XTX 跑 MiniMax-H3：不缺comfy-aimdo动态卸载，是注意力那一行没开。一行代码让 15 秒档从跑不完变成 73 分钟（5s / 15s 实测） on Tue, 10 Nov 2026 12:26:30 GMT]]></title><description><![CDATA[<blockquote>
<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/k-c" aria-label="Profile: K-C">@<bdi>K-C</bdi></a> <a href="/post/32423">说</a>:</p>
<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/enigma" aria-label="Profile: Enigma">@<bdi>Enigma</bdi></a> 好的 我和你配置基本一样。 主板是X570 WS ACE</p>
</blockquote>
<p dir="auto">好的， 以后多多交流</p>
]]></description><link>https://lcz.me/post/32427</link><guid isPermaLink="true">https://lcz.me/post/32427</guid><dc:creator><![CDATA[Enigma]]></dc:creator><pubDate>Tue, 10 Nov 2026 12:26:30 GMT</pubDate></item><item><title><![CDATA[Reply to 7900XTX 跑 MiniMax-H3：不缺comfy-aimdo动态卸载，是注意力那一行没开。一行代码让 15 秒档从跑不完变成 73 分钟（5s / 15s 实测） on Tue, 10 Nov 2026 12:02:34 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/enigma" aria-label="Profile: Enigma">@<bdi>Enigma</bdi></a> 好的 我和你配置基本一样。 主板是X570 WS ACE</p>
]]></description><link>https://lcz.me/post/32423</link><guid isPermaLink="true">https://lcz.me/post/32423</guid><dc:creator><![CDATA[K C]]></dc:creator><pubDate>Tue, 10 Nov 2026 12:02:34 GMT</pubDate></item><item><title><![CDATA[Reply to 7900XTX 跑 MiniMax-H3：不缺comfy-aimdo动态卸载，是注意力那一行没开。一行代码让 15 秒档从跑不完变成 73 分钟（5s / 15s 实测） on Tue, 10 Nov 2026 10:41:31 GMT]]></title><description><![CDATA[<blockquote>
<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/k-c" aria-label="Profile: K-C">@<bdi>K-C</bdi></a> <a href="/post/32400">说</a>:</p>
<p dir="auto">请问你的5950X配置怎样两个7900XTX同时PCIE4 X 16的？谢谢</p>
</blockquote>
<p dir="auto">应该是PCIE4 X 8，AI写帖子时弄错了</p>
]]></description><link>https://lcz.me/post/32411</link><guid isPermaLink="true">https://lcz.me/post/32411</guid><dc:creator><![CDATA[Enigma]]></dc:creator><pubDate>Tue, 10 Nov 2026 10:41:31 GMT</pubDate></item><item><title><![CDATA[Reply to 7900XTX 跑 MiniMax-H3：不缺comfy-aimdo动态卸载，是注意力那一行没开。一行代码让 15 秒档从跑不完变成 73 分钟（5s / 15s 实测） on Tue, 10 Nov 2026 09:58:07 GMT]]></title><description><![CDATA[<p dir="auto">请问你的5950X配置怎样两个7900XTX同时PCIE4 X 16的？谢谢</p>
]]></description><link>https://lcz.me/post/32400</link><guid isPermaLink="true">https://lcz.me/post/32400</guid><dc:creator><![CDATA[K C]]></dc:creator><pubDate>Tue, 10 Nov 2026 09:58:07 GMT</pubDate></item></channel></rss>