Skip to content

Misc. bug: Poor performence when using DFlash in v0.4.0 #94

Description

@fantasyz

Name and Version

version: 10814 (9b9277f)
built with MSVC 19.44.35228.0 for Windows AMD64

Operating systems

Windows

Which llama.cpp modules do you know to be affected?

llama-server

Command line

llama-server ^
	--model A:\models\Qwen3.6-27B-NEO-CODE-2T-OT-Q5_K_S.gguf ^
	--mmproj "S:\LLMs\Qwen3.6-27B-mmproj-BF16.gguf" ^
	--image-min-tokens 1024 ^
	--ctx-size 128000 ^
  --spec-type draft-dflash ^
	--spec-draft-model "S:\LLMs\Qwen3.6-27B-DFlash-Q4_K_M.gguf" ^
	--spec-draft-n-min 0 ^
  --spec-draft-p-min 0.0 ^
	--spec-dm-controller profit ^
	--spec-draft-ngl all ^
	--batch-size 2048 ^
	--gpu-layers all ^
	--cache-type-k q8_0 ^
	--cache-type-v q8_0 ^
	--spec-draft-type-k q8_0 ^
	--spec-draft-type-v q8_0 ^
	--fit off ^
	--no-prefill-assistant ^
	--api-key sk-ik-llama ^
	--chat-template-file "S:\LLMs\Qwen3.6-27B.jinja" ^
	--no-mmap ^
	--main-gpu 1 ^
	--split-mode layer ^
	--tensor-split 51,49 ^
	--parallel 1 ^
	--ctx-checkpoints 32 ^
	--checkpoint-min-step 1024 ^
	--cache-ram 12288 ^
	--reasoning-preserve ^
	--temp 0.6 --top-k 20 --top-p 0.95 --min-p 0.0 ^
	--repeat-penalty 1.0 --presence-penalty 0.0

Problem description & steps to reproduce

Compared with not using speculative decoding, the generation speed is even worst.

(no spec v0.4.0) 37 t/s
(DFlash v0.4.0) 34 t/s
(DFlash v0.3.2) 88 t/s

no spec rerun is tested with just removing:

--spec-type draft-dflash ^
--spec-draft-model "S:\LLMs\Qwen3.6-27B-DFlash-Q4_K_M.gguf" ^
--spec-draft-n-min 0 ^
--spec-draft-p-min 0.0 ^
--spec-dm-controller profit ^

Relevant log output

Logs - DFlash
.\run_qwen3.6_27B_BeeLlama_4_0.bat
0.00.114.360 I cmn  common_param: common_params_print_info: verbosity = 3 (adjust with the `-lv N` CLI arg)
0.00.452.135 I cmn  common_specu: DFlash: omitted --spec-draft-n-max defaults to the drafter block depth (15); pass the flag to override
0.00.452.196 I srv    load_model: loading model 'A:\models\Qwen3.6-27B-NEO-CODE-2T-OT-Q5_K_S.gguf'
0.08.357.781 I srv    load_model: loaded multimodal model, 'S:\LLMs\Qwen3.6-27B-mmproj-BF16.gguf'
0.08.438.512 I srv    load_model: initializing, n_slots = 1, n_ctx_slot = 128000, kv_unified = 'true'
0.08.438.567 I common_speculative_impl_draft_dflash: adding speculative implementation 'draft-dflash'
0.08.438.569 I common_speculative_impl_draft_dflash: - n_max=15, n_min=0, p_min=0.00
0.08.438.570 I common_speculative_impl_draft_dflash: - block_size=16, mask_token_id=248070, n_extract=5
0.08.647.017 I srv  llama_server: model loaded
0.08.647.025 I srv  llama_server: listening on http://127.0.0.1:8080
0.16.956.677 I slot get_availabl: id  0 | task -1 | selected slot by LRU, t_last = -1
0.16.956.807 I slot launch_slot_: id  0 | task 0 | processing task, is_child = 0
0.19.967.115 I slot apply_adapti: id  0 | task 0 | adaptive draft-max profit: 0 -> 15 (score=22.65)
0.20.480.155 I slot apply_adapti: id  0 | task 0 | adaptive draft-max profit: 15 -> 12 (score=11.75)
0.20.868.794 I slot apply_adapti: id  0 | task 0 | adaptive draft-max profit: 12 -> 10 (score=15.54)
0.21.235.852 I slot apply_adapti: id  0 | task 0 | adaptive draft-max profit: 10 -> 8 (score=16.44)
0.21.571.638 I slot apply_adapti: id  0 | task 0 | adaptive draft-max profit: 8 -> 4 (score=17.95)
0.22.286.227 I adaptive-dm: disabling speculative depth (best_score=22.646 baseline=22.646 profit_min=0.050 below_count=8)
0.22.286.234 I slot apply_adapti: id  0 | task 0 | adaptive draft-max profit: 4 -> 0 (score=22.65)
0.23.990.522 I slot print_timing: id  0 | task 0 | n_decoded =    100, tg =  24.06 t/s, tg_3s =  24.06 t/s
0.27.014.305 I slot print_timing: id  0 | task 0 | n_decoded =    205, tg =  28.55 t/s, tg_3s =  34.72 t/s
0.30.029.440 I slot print_timing: id  0 | task 0 | n_decoded =    311, tg =  30.51 t/s, tg_3s =  35.16 t/s
0.33.035.817 I slot print_timing: id  0 | task 0 | n_decoded =    415, tg =  31.44 t/s, tg_3s =  34.59 t/s
0.36.048.880 I slot print_timing: id  0 | task 0 | n_decoded =    518, tg =  31.95 t/s, tg_3s =  34.18 t/s
0.39.058.500 I slot print_timing: id  0 | task 0 | n_decoded =    623, tg =  32.41 t/s, tg_3s =  34.89 t/s
0.42.085.713 I slot print_timing: id  0 | task 0 | n_decoded =    728, tg =  32.72 t/s, tg_3s =  34.69 t/s
0.45.112.701 I slot print_timing: id  0 | task 0 | n_decoded =    834, tg =  32.99 t/s, tg_3s =  35.02 t/s
0.48.139.442 I slot print_timing: id  0 | task 0 | n_decoded =    939, tg =  33.17 t/s, tg_3s =  34.69 t/s
0.51.163.207 I slot print_timing: id  0 | task 0 | n_decoded =   1042, tg =  33.26 t/s, tg_3s =  34.06 t/s
0.54.190.224 I slot print_timing: id  0 | task 0 | n_decoded =   1147, tg =  33.39 t/s, tg_3s =  34.69 t/s
0.57.194.259 I slot print_timing: id  0 | task 0 | n_decoded =   1251, tg =  33.49 t/s, tg_3s =  34.62 t/s
1.00.212.606 I slot print_timing: id  0 | task 0 | n_decoded =   1355, tg =  33.56 t/s, tg_3s =  34.46 t/s
1.03.212.633 I slot print_timing: id  0 | task 0 | n_decoded =   1456, tg =  33.57 t/s, tg_3s =  33.67 t/s
1.06.237.430 I slot print_timing: id  0 | task 0 | n_decoded =   1560, tg =  33.62 t/s, tg_3s =  34.38 t/s
1.09.263.025 I slot print_timing: id  0 | task 0 | n_decoded =   1665, tg =  33.69 t/s, tg_3s =  34.70 t/s
1.12.279.836 I slot print_timing: id  0 | task 0 | n_decoded =   1768, tg =  33.71 t/s, tg_3s =  34.14 t/s
1.15.295.396 I slot print_timing: id  0 | task 0 | n_decoded =   1873, tg =  33.77 t/s, tg_3s =  34.82 t/s
1.18.316.806 I slot print_timing: id  0 | task 0 | n_decoded =   1977, tg =  33.81 t/s, tg_3s =  34.42 t/s
1.21.320.078 I slot print_timing: id  0 | task 0 | n_decoded =   2081, tg =  33.85 t/s, tg_3s =  34.63 t/s
1.22.248.595 I slot print_timing: id  0 | task 0 | prompt eval time =    2877.71 ms /  2903 tokens (    0.99 ms per token,  1008.79 tokens per second)
1.22.248.600 I slot print_timing: id  0 | task 0 |        eval time =   62414.04 ms /  2113 tokens (   29.54 ms per token,    33.85 tokens per second)
1.22.248.601 I slot print_timing: id  0 | task 0 |       total time =   65291.75 ms /  5016 tokens
1.22.248.601 I slot print_timing: id  0 | task 0 |    graphs reused =       2098
1.22.248.609 I slot print_timing: id  0 | task 0 | draft acceptance = 0.00000 (    0 accepted /   322 generated), mean len =  1.00
1.22.248.820 I slot      release: id  0 | task 0 | stop processing: n_tokens = 5015, truncated = 0
Logs - No Spec
llama-server ^
	--model A:\models\Qwen3.6-27B-NEO-CODE-2T-OT-Q5_K_S.gguf ^
	--mmproj "S:\LLMs\Qwen3.6-27B-mmproj-BF16.gguf" ^
	--image-min-tokens 1024 ^
	--ctx-size 128000 ^
	--batch-size 2048 ^
	--gpu-layers all ^
	--cache-type-k q8_0 ^
	--cache-type-v q8_0 ^
	--spec-draft-type-k q8_0 ^
	--spec-draft-type-v q8_0 ^
	--fit off ^
	--no-prefill-assistant ^
	--api-key sk-ik-llama ^
	--chat-template-file "S:\LLMs\Qwen3.6-27B.jinja" ^
	--no-mmap ^
	--main-gpu 1 ^
	--split-mode layer ^
	--tensor-split 51,49 ^
	--parallel 1 --kv-unified ^
	--ctx-checkpoints 32 ^
	--checkpoint-min-step 1024 ^
	--cache-ram 12288 ^
	--reasoning-preserve ^
	--temp 0.6 --top-k 20 --top-p 0.95 --min-p 0.0 ^
	--repeat-penalty 1.0 --presence-penalty 0.0 



.\run_qwen3.6_27B_BeeLlama_4_0_no_spec.bat
0.00.134.194 I cmn  common_param: common_params_print_info: verbosity = 3 (adjust with the `-lv N` CLI arg)
0.00.377.319 I srv    load_model: loading model 'A:\models\Qwen3.6-27B-NEO-CODE-2T-OT-Q5_K_S.gguf'
0.09.356.747 I srv    load_model: loaded multimodal model, 'S:\LLMs\Qwen3.6-27B-mmproj-BF16.gguf'
0.09.409.186 I srv    load_model: initializing, n_slots = 1, n_ctx_slot = 128000, kv_unified = 'true'
0.09.434.268 I srv  llama_server: model loaded
0.09.434.278 I srv  llama_server: listening on http://127.0.0.1:8080
0.26.717.254 I slot get_availabl: id  0 | task -1 | selected slot by LRU, t_last = -1
0.26.717.321 I slot launch_slot_: id  0 | task 0 | processing task, is_child = 0
0.31.626.380 I slot print_timing: id  0 | task 0 | n_decoded =    114, tg =  37.86 t/s, tg_3s =  37.86 t/s
0.34.648.361 I slot print_timing: id  0 | task 0 | n_decoded =    228, tg =  37.79 t/s, tg_3s =  37.72 t/s
0.37.655.918 I slot print_timing: id  0 | task 0 | n_decoded =    342, tg =  37.83 t/s, tg_3s =  37.90 t/s
0.40.664.332 I slot print_timing: id  0 | task 0 | n_decoded =    455, tg =  37.76 t/s, tg_3s =  37.56 t/s
0.43.680.994 I slot print_timing: id  0 | task 0 | n_decoded =    569, tg =  37.77 t/s, tg_3s =  37.79 t/s
0.46.712.479 I slot print_timing: id  0 | task 0 | n_decoded =    683, tg =  37.74 t/s, tg_3s =  37.61 t/s
0.49.717.824 I slot print_timing: id  0 | task 0 | n_decoded =    796, tg =  37.72 t/s, tg_3s =  37.60 t/s
0.52.740.749 I slot print_timing: id  0 | task 0 | n_decoded =    910, tg =  37.72 t/s, tg_3s =  37.71 t/s
0.55.756.300 I slot print_timing: id  0 | task 0 | n_decoded =   1023, tg =  37.69 t/s, tg_3s =  37.47 t/s
0.58.764.205 I slot print_timing: id  0 | task 0 | n_decoded =   1136, tg =  37.68 t/s, tg_3s =  37.57 t/s
1.01.776.239 I slot print_timing: id  0 | task 0 | n_decoded =   1249, tg =  37.66 t/s, tg_3s =  37.52 t/s
1.04.779.745 I slot print_timing: id  0 | task 0 | n_decoded =   1362, tg =  37.66 t/s, tg_3s =  37.62 t/s
1.07.795.484 I slot print_timing: id  0 | task 0 | n_decoded =   1475, tg =  37.65 t/s, tg_3s =  37.47 t/s
1.10.804.798 I slot print_timing: id  0 | task 0 | n_decoded =   1588, tg =  37.64 t/s, tg_3s =  37.55 t/s
1.13.812.032 I slot print_timing: id  0 | task 0 | n_decoded =   1701, tg =  37.64 t/s, tg_3s =  37.58 t/s
1.16.812.209 I slot print_timing: id  0 | task 0 | n_decoded =   1813, tg =  37.62 t/s, tg_3s =  37.33 t/s
1.19.826.985 I slot print_timing: id  0 | task 0 | n_decoded =   1926, tg =  37.61 t/s, tg_3s =  37.48 t/s
1.22.836.027 I slot print_timing: id  0 | task 0 | n_decoded =   2038, tg =  37.59 t/s, tg_3s =  37.22 t/s
1.25.850.307 I slot print_timing: id  0 | task 0 | n_decoded =   2150, tg =  37.56 t/s, tg_3s =  37.16 t/s
1.28.865.548 I slot print_timing: id  0 | task 0 | n_decoded =   2262, tg =  37.54 t/s, tg_3s =  37.14 t/s
1.31.882.072 I slot print_timing: id  0 | task 0 | n_decoded =   2375, tg =  37.54 t/s, tg_3s =  37.46 t/s
1.34.890.801 I slot print_timing: id  0 | task 0 | n_decoded =   2487, tg =  37.53 t/s, tg_3s =  37.22 t/s
1.37.914.823 I slot print_timing: id  0 | task 0 | n_decoded =   2600, tg =  37.52 t/s, tg_3s =  37.37 t/s
1.40.933.866 I slot print_timing: id  0 | task 0 | n_decoded =   2713, tg =  37.51 t/s, tg_3s =  37.43 t/s
1.43.937.162 I slot print_timing: id  0 | task 0 | n_decoded =   2825, tg =  37.51 t/s, tg_3s =  37.29 t/s
1.46.946.557 I slot print_timing: id  0 | task 0 | n_decoded =   2937, tg =  37.49 t/s, tg_3s =  37.22 t/s
1.49.970.579 I slot print_timing: id  0 | task 0 | n_decoded =   3049, tg =  37.48 t/s, tg_3s =  37.04 t/s
1.52.991.436 I slot print_timing: id  0 | task 0 | n_decoded =   3162, tg =  37.48 t/s, tg_3s =  37.41 t/s
1.56.002.830 I slot print_timing: id  0 | task 0 | n_decoded =   3274, tg =  37.47 t/s, tg_3s =  37.19 t/s
1.59.009.598 I slot print_timing: id  0 | task 0 | n_decoded =   3386, tg =  37.46 t/s, tg_3s =  37.25 t/s
1.59.171.756 I slot print_timing: id  0 | task 0 | prompt eval time =    1898.09 ms /  2903 tokens (    0.65 ms per token,  1529.43 tokens per second)
1.59.171.762 I slot print_timing: id  0 | task 0 |        eval time =   90556.30 ms /  3392 tokens (   26.70 ms per token,    37.46 tokens per second)
1.59.171.763 I slot print_timing: id  0 | task 0 |       total time =   92454.39 ms /  6295 tokens
1.59.171.766 I slot print_timing: id  0 | task 0 |    graphs reused =       3378
1.59.172.030 I slot      release: id  0 | task 0 | stop processing: n_tokens = 6294, truncated = 0

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions