Comfy Blog· rattus128·· 20 天前精选AI 评分60
ComfyUI 将本地 Qwen3.x 的 LLM 出词速度提升至两倍
Doubling LLM token rates in ComfyUI
AI 导读
ComfyUI 重写了文本生成热路径,在相同 GPU 和相同 checkpoint 下,Qwen3.x 系列模型的出词速度最高提升至两倍,且不改变模型输出质量。
推荐理由
ComfyUI 官方拆解了本地 LLM 推理的显存带宽瓶颈,以及 MTP 推测解码与内核重排如何把 Qwen3.x 出词速度翻倍。
深读指南
适合谁读:关注本地 LLM 推理性能、GPU kernel 优化与推测解码实现的技术读者,尤其是使用 ComfyUI 或类似单序列生成场景的工程师。
单序列 LLM 出词受限于显存带宽而非算力,优化应围绕减少权重读取与提升 VRAM 总线利用率展开。
The bottleneck of token generation is driven by how fast your GPU can read the model from VRAM.
将权重与 per-group scale 按 kernel 消费顺序交错重排,可减少 VRAM 跳读,且该重排只需在模型加载时做一次。
the weights and their per-group scales are interleaved in memory in the order the kernel consumes them
自适应树 MTP 用兄弟候选替代单链猜测,并按文本类型动态调整树形,以提升被接受草稿 token 的期望数量。
Tree MTP keeps the runner-up tokens at each level as siblings, verifies the whole tree in one pass, and re-plans the tree’s shape from what has been hitting.
局限与前提:文中速度数据均为特定 GPU、特定模型与量化配置下的自报结果,未给出可复现的基准方法或第三方评测;MTP 收益依赖草稿命中率与文本类型,且树形上限受 kernel 的 M=8 约束;部分优化(如 Comfy-Kitchen attention)需手动启动参数,并非默认全开;文章未讨论非 NVIDIA 硬件上的具体收益幅度。
对照原文阅读来源:Comfy Blog · blog.comfy.org