You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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).
I reviewed the Discussions, and have a new and useful enhancement to share.
Feature Description
Add support for DFlash 2 block-diffusion speculative decoding draft models (e.g. z-lab/Qwen3.8-27B-DFlash2-GGUF and incoai/Qwen3.8-27B-DFlash2-GGUF).
Upstream llama.cpp has an implementation under PR ggml-org#27342 (feat(speculative): add DFlash 2 block-diffusion speculative decoding). It would be great to have this supported in BeeLlama to allow DFlash 2 drafters to be used alongside BeeLlama's adaptive --spec-dm-controller profit and KVarN KV cache optimizations.
Motivation
Currently in BeeLlama v0.4.3, attempting to use a DFlash 2 GGUF draft model fails at startup with a tensor count mismatch:
1.08.699.199 I srv load_model: loading model 'unsloth/Qwen3.8-27B-GGUF'
1.09.116.086 E llama_model_load: error loading model: done_getting_tensors: wrong number of tensors; expected 81, got 58
1.09.116.100 E llama_model_load_from_file_impl: failed to load model
1.09.116.154 W srv load_model: [spec] failed to measure draft model memory: failed to load model
...
1.12.591.756 I common_speculative_init_result: loading draft model '/cache/models--z-lab--Qwen3.8-27B-DFlash2-GGUF/snapshots/.../Qwen3.8-27B-DFlash2-Q4_K_M.gguf'
1.12.952.819 E llama_model_load: error loading model: done_getting_tensors: wrong number of tensors; expected 81, got 58
1.12.952.826 E llama_model_load_from_file_impl: failed to load model
1.12.952.827 E common_speculative_init_result: failed to load draft model
1.12.952.834 E srv load_model: failed to load draft model
1.12.953.108 E srv llama_server: exiting due to model loading error
Why it happens:
DFlash 1 (supported in v0.4.3) uses 58 tensors.
DFlash 2 GGUFs contain 81 tensors because of two architectural additions:
Because the current GGUF loader does not recognize these 23 new tensor names, llama_model_load detects unmapped tensors and aborts with wrong number of tensors; expected 81, got 58.
Prerequisites
Feature Description
Add support for DFlash 2 block-diffusion speculative decoding draft models (e.g.
z-lab/Qwen3.8-27B-DFlash2-GGUFandincoai/Qwen3.8-27B-DFlash2-GGUF).Upstream
llama.cpphas an implementation under PR ggml-org#27342 (feat(speculative): add DFlash 2 block-diffusion speculative decoding). It would be great to have this supported in BeeLlama to allow DFlash 2 drafters to be used alongside BeeLlama's adaptive--spec-dm-controller profitand KVarN KV cache optimizations.Motivation
Currently in BeeLlama
v0.4.3, attempting to use a DFlash 2 GGUF draft model fails at startup with a tensor count mismatch:Command:
Logs:
Why it happens:
selector_hidden.weight,selector_predecessor.weight,selector_successor.weightblk.*.attn_conv_base,blk.*.attn_conv_proj.weight,blk.*.ffn_conv_base,blk.*.ffn_conv_proj.weightllama_model_loaddetects unmapped tensors and aborts withwrong number of tensors; expected 81, got 58.Possible Implementation
llama.cppPR spec : add DFlash2 support (local convolution + candidate selector) ggml-org/llama.cpp#27342:LLM_TENSOR_ATTN_CONV_*,LLM_TENSOR_FFN_CONV_*,LLM_TENSOR_SELECTOR_*).dflashto recognize and load all 81 tensors.--spec-dm-controller profit(dynamic draft length) and KVarN draft cache offloading (--cache-type-k-draft/--cache-type-v-draft).