llama.cpp icon indicating copy to clipboard operation
llama.cpp copied to clipboard

Feature Request: DFLASH support (from 40 tok/sec to 400 tok/sec)

Open KotPrezesOfficial opened this issue 7 months ago • 28 comments

Prerequisites

  • [x] I am running the latest code. Mention the version if possible as well.
  • [x] I carefully followed the README.md.
  • [x] I searched using keywords relevant to my issue to make sure that I am creating a new issue that is not already open (or closed).
  • [x] I reviewed the Discussions, and have a new and useful enhancement to share.

Feature Description

It allows to generate tokens so much faster, without any loss in quality. More here: https://github.com/z-lab/dflash

Motivation

Because it allows faster generation

Possible Implementation

No response

KotPrezesOfficial avatar Apr 16 '26 03:04 KotPrezesOfficial

+1

love01211 avatar Apr 16 '26 04:04 love01211

I'm experimentally working on this. Likely needs to wait till #18039 is merged

am17an avatar Apr 16 '26 04:04 am17an

niubi

enginefuture avatar Apr 16 '26 06:04 enginefuture

+1

rhythmyf avatar Apr 16 '26 13:04 rhythmyf

Nice job!!!

giveUphope avatar Apr 16 '26 14:04 giveUphope

I'm experimentally working on this. Likely needs to wait till #18039 is merged

could you keep in mind maybe that we have dflash + ddtree together... both together would provide a 150% boost compared to 100% for dflash alone

snapo avatar Apr 17 '26 03:04 snapo

+1

heyunxu avatar Apr 17 '26 05:04 heyunxu

I'm experimentally working on this. Likely needs to wait till #18039 is merged

could you keep in mind maybe that we have dflash + ddtree together... both together would provide a 150% boost compared to 100% for dflash alone

dflash + ddtree + rotorquant ?

zedbytes avatar Apr 17 '26 13:04 zedbytes

I'm experimentally working on this. Likely needs to wait till #18039 is merged

could you keep in mind maybe that we have dflash + ddtree together... both together would provide a 150% boost compared to 100% for dflash alone

dflash + ddtree + rotorquant ?

rotorquant afaik only reduces kv cache consumption

dflash uses a small diffusion model to speed up token generation through speculative decoding ddtree on top of dflash creates a tree (from what i did read) to estimate the path of the diffusion prediction to use even less iterations in the diffusion process...

but i am just a noob, no clue if i got it right, as i understand the GPU things not enough, i can code but GPU kernels and ML kernels are somehow still a little over my head.

snapo avatar Apr 17 '26 15:04 snapo

We should really start to look into speculative prefill solutions now that context size and context ingestion have become more important with agentic workflows.

ITankForCAD avatar Apr 17 '26 15:04 ITankForCAD

We should really start to look into speculative prefill solutions now that context size and context ingestion have become more important with agentic workflows.

What are you waiting for? Start looking into it

gyzerok avatar Apr 18 '26 11:04 gyzerok

For anyone interested in DFlash, please take a look at this PR: https://github.com/ggml-org/llama.cpp/pull/22105 @am17an Welcome to collaborate on this, there’s still much we can improve.

ruixiang63 avatar Apr 19 '26 03:04 ruixiang63

+1

fudingyu avatar Apr 23 '26 02:04 fudingyu

@fudingyu "Hi team,  First off, thank you for the incredible work on llama.cpp.  I am currently operating a heterogeneous multi-GPU environment consisting of 1x Tesla V100 (32GB) and 2x RTX 2080 Ti (22GB modified), totaling 76GB VRAM.  Running Qwen 3.6 27B, I’m currently averaging around 15 t/s. While the stability is great, I am eagerly awaiting the integration of DFlash (Distilled Flash Speculative Decoding) into the mainline. Given my hardware's massive VRAM but older compute architecture (sm70/sm75), DFlash would be a total game-changer to maximize throughput and really make this 'legacy flagship' rig shine.  Do we have a rough ETA or a roadmap for when DFlash (or the optimized speculative decoding PRs) will be merged into the main branch?  Any insights or recommended experimental branches for my specific setup would be greatly appreciated. Keep up the amazing work!"

1784658456qwe-yiyi avatar Apr 24 '26 01:04 1784658456qwe-yiyi

@fudingyu "Hi team,  First off, thank you for the incredible work on llama.cpp.  I am currently operating a heterogeneous multi-GPU environment consisting of 1x Tesla V100 (32GB) and 2x RTX 2080 Ti (22GB modified), totaling 76GB VRAM.  Running Qwen 3.6 27B, I’m currently averaging around 15 t/s. While the stability is great, I am eagerly awaiting the integration of DFlash (Distilled Flash Speculative Decoding) into the mainline. Given my hardware's massive VRAM but older compute architecture (sm70/sm75), DFlash would be a total game-changer to maximize throughput and really make this 'legacy flagship' rig shine.  Do we have a rough ETA or a roadmap for when DFlash (or the optimized speculative decoding PRs) will be merged into the main branch?  Any insights or recommended experimental branches for my specific setup would be greatly appreciated. Keep up the amazing work!"

I am in the exact same position , 2xRTX 2080 Ti each 22GB, permanent 15.5 token/s , with DFlash + DDtree which would fit still with a 256k context i would get about 45-50 token/s ... that would be game changing....

snapo avatar Apr 24 '26 06:04 snapo

@snapo Which branch are you using?

1784658456qwe-yiyi avatar Apr 24 '26 11:04 1784658456qwe-yiyi

@snapo Which branch are you using?

snapo@snabox:~/llama/llama.cpp/build/bin$ ./llama-cli --version ggml_cuda_init: found 2 CUDA devices (Total VRAM: 44004 MiB): Device 0: NVIDIA GeForce RTX 2080 Ti, compute capability 7.5, VMM: yes, VRAM: 22002 MiB Device 1: NVIDIA GeForce RTX 2080 Ti, compute capability 7.5, VMM: yes, VRAM: 22002 MiB version: 8763 (ff5ef8278) built with GNU 11.4.0 for Linux x86_64

i use currently ./llama.cpp/build/bin/llama-server --model "models/Qwen3.6-27B-Q8_0.gguf" --alias "Qwen3.6 27B" --temp 0.6 --top-p 0.95 --min-p 0.00 --top-k 20 --port 16384 --host 0.0.0.0 --cache-type-k f16 --cache-type-v f16 --presence-penalty 1.0 --repeat-penalty 1.0 --jinja --chat-template-kwargs '{"preserve_thinking": true}' --ctx-size 65536 --mmproj "models/27B-mmproj-F32.gguf" --webui

are the parameters i use....

Image

i do think that speculative decoding even MTP=1 or MPT=2 or DFlash with DDTree would help it a lot.... i am pretty certain especially with DflashDDTree i could achive more than 45 tokens (based on assumptions on how much compute the RTX 2080 Ti's provide

snapo avatar Apr 24 '26 11:04 snapo

@snapo Which branch are you using?

snapo@snabox:~/llama/llama.cpp/build/bin$ ./llama-cli --version ggml_cuda_init: found 2 CUDA devices (Total VRAM: 44004 MiB): Device 0: NVIDIA GeForce RTX 2080 Ti, compute capability 7.5, VMM: yes, VRAM: 22002 MiB Device 1: NVIDIA GeForce RTX 2080 Ti, compute capability 7.5, VMM: yes, VRAM: 22002 MiB version: 8763 (ff5ef82) built with GNU 11.4.0 for Linux x86_64

i use currently ./llama.cpp/build/bin/llama-server --model "models/Qwen3.6-27B-Q8_0.gguf" --alias "Qwen3.6 27B" --temp 0.6 --top-p 0.95 --min-p 0.00 --top-k 20 --port 16384 --host 0.0.0.0 --cache-type-k f16 --cache-type-v f16 --presence-penalty 1.0 --repeat-penalty 1.0 --jinja --chat-template-kwargs '{"preserve_thinking": true}' --ctx-size 65536 --mmproj "models/27B-mmproj-F32.gguf" --webui

are the parameters i use....

Image i do think that speculative decoding even MTP=1 or MPT=2 or DFlash with DDTree would help it a lot.... i am pretty certain especially with DflashDDTree i could achive more than 45 tokens (based on assumptions on how much compute the RTX 2080 Ti's provide

I have the exact same GPUs as you (X99 E5 2969v3 + 2x 2080Ti 22GB + NVLink); with the same model, I can achieve speeds of 21–27 tokens/s. Just wanted to share this with you.

GGML_CUDA_P2P=1 CUDA_SCALE_LAUNCH_QUEUES=4x /usr/local/bin/llama-server -m Qwen3.6-27B-Q8_0.gguf --mmproj mmproj-BF16.gguf -ngl 99 -c 140000 -t 8 --host 0.0.0.0 --port 8080 --temp 1.0 --top-p 0.95 --top-k 20 --min-p 0.0 --split-mode tensor --spec-type ngram-mod --spec-ngram-size-n 24 --draft-min 32 --draft-max 48 --kv-unified --reasoning-budget 8192 --reasoning-budget-message ". Okay, enough thinking. Let's answer now." --no-mmap --mlock

kidultff avatar Apr 26 '26 15:04 kidultff

+1

steven0081 avatar Apr 27 '26 13:04 steven0081

+1

wanghuisust avatar Apr 29 '26 01:04 wanghuisust