[基准测试] DFlash2 与 MTP 比较。5090RTX, Qwen 3.8 27B, Dynamic v3 GGUF, llama.cpp。令牌生成、延迟和可用上下文。

Reddit r/LocalLLaMA 工具

摘要

该基准测试对 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

X AI KOLs Timeline

某用户使用llama.cpp在单张RTX 3090上对Qwen3.6 27B的MTP变体与普通版本进行了基准测试,发现MTP在长上下文(32k-64k)下生成速度最高可提升2.37倍,但预填充较慢且暂不支持并发。

MTP+GGML_CUDA_ENABLE_UNIFIED_MEMORY=1 - llama.cpp

Reddit r/LocalLLaMA

一位用户在 llama.cpp 上使用 GGML_CUDA_ENABLE_UNIFIED_MEMORY=1 标志对令牌生成速度进行基准测试,比较启用和未启用 MTP(多令牌预测)时的性能。结果显示,在 RTX5090 上使用 Qwen3.6-27B 模型时,启用 MTP 后速度从 49 tok/s 显著提升至 64 tok/s。