3080 20G(魔改)实测能跑 MiniMax H3 本地生成,Turbo LoRA + SageAttention 2.2.0 双重加速
-
人工备注:本次提速是hermes+DeepSeek直接改的comfyui配置,帖子是让DeepSeek写的,已经让他把坑和怎么部署都都进去了,你可以直接给你的hermes帮你部署。以下是AI总结:
先说结论:官方标注 H3 本地跑需要 ~24G 显存,我这张魔改 3080 20G(GA102 / sm86)实测能跑,配合两个开源加速手段,768P 视频生成速度是官方 10 步基线的 2 倍以上。全部数据实测可复现。
环境:RTX 3080 20G 魔改 / ComfyUI 0.30 portable / torch 2.9.1+cu130 / Python 3.13 / MiniMax H3 开源 FL2VA(pruned INT8 DiT + NVFP4 文本编码器)
一、20G 能跑的关键
- 官方最小组合 ~24GB,20G 靠三样凑出来:pruned INT8 DiT(21GB 流式加载)、NVFP4 编码器(15.7GB 按需装载)、ComfyUI 的
--disable-dynamic-vram回退原生显存管理 - 模型加载有 11~26s 冷启动开销,属正常,不是故障
二、加速第一步:Turbo LoRA 4-step
- 官方蒸馏 LoRA v1.0(
fl2v_turbo_4step),采样器 euler + beta 调度 + shift 6/3 - 采样段比 10 步基线快 ~1.5 倍,画质与 10 步接近
三、加速第二步:SageAttention 2.2.0
- 踩坑实录:官方 PyPI 只有 1.0.6,2.2.0 只在 GitHub 源码;Windows 无官方轮子
- 解法:社区预编译轮子(woct0rdho/SageAttention,需匹配 torch 版本选 tag)+
triton-windows(模块名就是triton,有 cp313 win 轮子) - ComfyUI 原生
--use-sage-attention全局开关,不需要改任何工作流,出错自动回退 pytorch - sm86 自动走 INT8 QK + FP16 PV 路径(FP8 kernel 是 Ada/Hopper 专属,Ampere 用不了)
四、速度对比(768P,全部实测)
方案 5s I2V 总耗时 纯采样段 相对基线 10 步基线(官方参数) 541~604s 473~529s 1.0x Turbo LoRA 4-step 349s 225~251s ~1.5x 4-step + SageAttention 279.7s 188s ~2.1x 时长 无 Sage + SageAttention 提速 --- --- --- --- 5s 349s 279.7s 20% 10s 1012s(17min) 757.8s(12.6min) 25% - 越长越赚:attention 开销随序列长度二次方增长,长视频是 SageAttention 的甜区
- 独立基准(B=1, H=56, S=8192, D=128, bf16,模拟 H3 配置):SDPA 53.8ms → sage 24.0ms,2.24x
五、画质与稳定性
- INT8 量化注意力最大误差 0.0039,肉眼不可见,逐镜对比确认无损
- Windows WDDM 下曾有 H3 + sage kernel 驱动级 GPU lost 案例(Blackwell sm120 FP8 路径);sm86 FP16 路径连跑多镜无崩,另设注册表 TdrDelay=60 兜底
六、给 Hermes / AI 助手的部署指南(玩家把下面整段丢给你的 Agent,可直接执行)
任务:为 Windows ComfyUI portable + 3080 (sm86) 启用 SageAttention 2.2.0。先查环境再动手,全程不改工作流文件。
Step 0 环境对齐(必须)
# 用 ComfyUI 自带 python(portable 路径如 E:\ComfyUI_windows_portable\python_embeded\python.exe) python_embeded\python.exe -c "import torch; print(torch.__version__, torch.version.cuda)" # 目标:torch 2.9.x + cu130。轮子必须匹配此版本,别猜Step 1 装依赖(两条 wheel,免编译免 nvcc)
# ① triton:官方无 Windows 轮子,用社区 fork(模块名就是 triton) python_embeded\python.exe -m pip install triton-windows==3.7.1.post27 # ② sageattention 2.2.0:官方 PyPI 只有 1.0.6!去 GitHub 下社区预编译轮子 # woct0rdho/SageAttention → releases → v2.2.0-windows.post6 # 选文件名含 cu130torch2.9.1 的那个(cp310-abi3 兼容 py3.10~3.13) # ⚠️ 文件名带 + 号 pip 会报 Invalid wheel filename,先 cp 成规范名 python_embeded\python.exe -m pip install --no-deps sageattention-2.2.0+cu130torch2.9.1.post6-cp310-abi3-win_amd64.whl # --no-deps 必须:防 pip 去拉 PyPI 的 linux 版 tritonStep 2 启用(ComfyUI 原生全局开关)
# 启动命令加参数(bat 或命令行都行) python_embeded\python.exe -s ComfyUI\main.py --windows-standalone-build --disable-dynamic-vram --use-sage-attentionStep 3 验证(三关,缺一不可)
# ① 启动日志必须出现:Using sage attention(没有 = 参数没生效) # ② 冒烟测试: python_embeded\python.exe -c "import sageattention, triton; print('ok')" # ③ GPU 正确性 + 加速比: python_embeded\python.exe - << 'EOF' import torch, sageattention torch.manual_seed(0) B, H, S, D = 1, 56, 8192, 128 q = torch.randn(B, S, H, D, dtype=torch.bfloat16, device="cuda") k = torch.randn(B, S, H, D, dtype=torch.bfloat16, device="cuda") v = torch.randn(B, S, H, D, dtype=torch.bfloat16, device="cuda") ref = torch.nn.functional.scaled_dot_product_attention(q.transpose(1,2), k.transpose(1,2), v.transpose(1,2)).transpose(1,2) out = sageattention.sageattn(q, k, v, tensor_layout="NHD", is_causal=False) print("max_err:", (out-ref).abs().max().item()) # <0.01 正常 EOFStep 4 提速兜底(防驱动超时)
# 管理员 cmd 执行:GPU 超时阈值 2s→60s(Windows + sage kernel 的已知风险对冲) reg add "HKLM\SYSTEM\CurrentControlSet\Control\GraphicsDrivers" /v TdrDelay /t REG_DWORD /d 60 /fStep 5 速度验证(同 seed 同参数 A/B)
- 同一工作流、同一 seed,对比开/关
--use-sage-attention两次的Prompt executed日志 - 3080 sm86 参考值:5s/768P I2V 4-step ≈280s,10s ≈758s
回滚:
pip uninstall sageattention triton-windows+ 启动参数删掉,5 分钟还原。已知坑清单:
- PyPI 官方 sageattention 只有 1.0.6(旧版),2.2.0 必须社区轮子
- triton 官方不支持 Windows → 必须 triton-windows
- sm86 无 FP8 tensor core,自动走 INT8/FP16 路径;FP8 是 Ada/Hopper 专属
- 若启动报错提示装 sageattention → 包没装对,回去查 Step 1
- 出现 GPU lost(显示器闪断/驱动重启)→ 查 TdrDelay,长视频首次跑务必盯
- 官方最小组合 ~24GB,20G 靠三样凑出来:pruned INT8 DiT(21GB 流式加载)、NVFP4 编码器(15.7GB 按需装载)、ComfyUI 的
-
,
T terry 固定了此主题
-
@terry 昨天看了老特的视频受到启发。两张3080,gpu0跑h3,gpu1跑zimage,实测成功。并且发现sageattention对图片生成也有效,可以直接生成1440p图片
-
3080 还算是服役中的卡。很不错。
-
,系统 取消固定了此主题