[基准测试] DFlash2 与 MTP 比较。5090RTX, Qwen 3.8 27B, Dynamic v3 GGUF, llama.cpp。令牌生成、延迟和可用上下文。
摘要
该基准测试对 llama.cpp 中的 DFlash2 与 MTP 技术进行了比较,结果表明 DFlash2 的令牌生成速度提高了约 20%,但可用上下文减少了 38%。
简要说明:需谨慎。DFlash2 以牺牲 38% 的上下文大小为代价,提供了 +20% 的生成速度。长时间运行的任务和大上下文工作(>100k)会导致 DFlash2 由于压缩和收益递减而失去优势。TPS 比较 输入 Prompt 解析 DFlash2 Prompt 解析 MTP 解析 胜者 生成 DFlash2 生成 MTP 生成 胜者 4.2K 1,916.65 t/s 2,139.07 t/s MTP +11.6% 104.43 t/s 86.50 t/s DFlash2 +20.7% 16.4K 2,226.55 t/s 2,299.56 t/s MTP +3.3% 101.97 t/s 87.04 t/s DFlash2 +17.1% 65.6K 1,950.37 t/s 1,956.50 t/s 基本持平 88.33 t/s 72.18 t/s DFlash2 +22.4% 加权 1,995.84 t/s 2,022.41 t/s MTP +1.3% 97.71 t/s 81.29 t/s DFlash2 +20.2% 总往返延迟 输入 DFlash2 MTP DFlash2 优势 4.2K 7.09 s 7.88 s 11.1% 16.4K 12.40 s 13.03 s 5.1% 65.6K 39.42 s 40.62 s 3.0% 上下文大小 DFlash2: 90,112 MTP: 124,416 MTP 提供了 34,304 个更多令牌,或 38.1% 的更多可用上下文。DFlash2 配置(MTP 类似,spec-draft-n-max 为 2) llama-server \ --model /home/human/.cache/llama.cpp/unsloth-qwen38-27b-dynamic3/Qwen3.8-27B-UD-Q8_K_L.gguf \ --mmproj /home/human/.cache/llama.cpp/unsloth-qwen38-27b/mmproj-F16.gguf \ --no-mmproj-offload \ --image-min-tokens 1024 \ --alias qwen3.8-27b-q8-0 \ --ctx-size 90112 \ --gpu-layers all \ --fit off \ --parallel 1 \ --batch-size 512 \ --ubatch-size 128 \ --cache-type-k q8_0 \ --cache-type-v q8_0 \ --kv-offload \ --kv-unified \ --cache-ram 8192 \ --cache-idle-slots \ --flash-attn on \ --jinja \ --reasoning on \ --reasoning-preserve \ --spec-type draft-dflash \ --spec-draft-model /home/human/.cache/llama.cpp/unsloth-qwen38-27b-dynamic3/Qwen3.8-27B-DFlash2-Q8_0.gguf \ --spec-draft-n-max 4 \ --spec-draft-type-k q8_0 \ --spec-draft-type-v q8_0 \ --spec-draft-ngl all \
相似文章
@Snixtp: https://x.com/Snixtp/status/2055734339346768225
某用户使用llama.cpp在单张RTX 3090上对Qwen3.6 27B的MTP变体与普通版本进行了基准测试,发现MTP在长上下文(32k-64k)下生成速度最高可提升2.37倍,但预填充较慢且暂不支持并发。
如何获得这里看到的超快DFlash / MTP每秒令牌数?双3090
用户寻求使用DFlash和MTP投机解码技术优化双3090上的令牌生成速度,使用llama.cpp和beellama,分享了他们的配置和命令。
MTP+GGML_CUDA_ENABLE_UNIFIED_MEMORY=1 - llama.cpp
一位用户在 llama.cpp 上使用 GGML_CUDA_ENABLE_UNIFIED_MEMORY=1 标志对令牌生成速度进行基准测试,比较启用和未启用 MTP(多令牌预测)时的性能。结果显示,在 RTX5090 上使用 Qwen3.6-27B 模型时,启用 MTP 后速度从 49 tok/s 显著提升至 64 tok/s。
Qwen 3.6-27B Dense 与 MTP 在 Strix Halo Windows 上的基准测试
Qwen 3.6-27B Dense 和 MTP 变体在 Strix Halo Windows 上通过 llama.cpp 运行的社区基准测试,展示了各项任务的 token/s 速度。
在 Qwen3.6 - RTX 5090 上测试 llama.cpp 的 MTP 支持
在 RTX 5090 上使用 Qwen3.6 模型对 llama.cpp 的新多标记预测(MTP)支持进行技术测试,比较不同提示和 GGUF 量化下开启和关闭 MTP 的性能表现。