Views
No views yet
@ggerganov The sliding window attention issue has been addressed. I observed an improved acceptance rate for long-context prompts, short-context prompts remains the same quality. We need to reconvert HF models to GGUF.
DFlash v2 has been updated and now looks cleaner and more robust. The performance also looks good to me. As discussed with @ggerganov in #24904, this implementation is much simpler and offers better graph reuse.
git clone -b dflash https://github.com/ruixiang63/llama.cpppython convert_hf_to_gguf.py ../Qwen3.6-35B-A3B-DFlash --target-model-dir ../Qwen3.6-35B-A3B --outfile ../Qwen3.6-35B-A3B-DFlash/Qwen3.6-35B-A3B-DFlash-bf16.gguf --outtype bf161cmake -B build -DGGML_CUDA=ON
2
3cmake --build build --config Release -j1cmake -B build -DGGML_VULKAN=ON
2
3cmake --build build --config Release -j
1version = 1
2
3[*]
4flash-attn = on
5mlock = off
6mmap = off
7fit = on
8warmup = on
9batch-size = 256
10ubatch-size = 256
11cache-type-k = q4_0
12cache-type-v = q5_1
13kv-unified = true
14swa-full = true
15jinja = true
16direct-io = off
17cache-prompt = true
18cache-ram = 28672
19n-gpu-layers = 99
20reasoning = off
21reasoning-budget = 0
22chat-template-kwargs = {"preserve_thinking": true}
23spec-default = true
24ctx-checkpoints = 64
25parallel = 1
26threads-http = 1
27ctx-size = 65536
28
29# --- MODELS ---
30[LuffyTheFox/Qwen3.6-35B-A3B-Uncensored-Claude-Genesis-GGUF]
31alias = LuffyTheFox/Qwen3.6-35B-A3B-Uncensored-Claude-Genesis-GGUF
32model = /root/.cache/llama.cpp/LuffyTheFox/Qwen3.6-35B-A3B-Uncensored-Claude-Genesis-GGUF/Qwen3.6-35B-A3B-Uncensored-Claude-Genesis-V3-APEX-Compact.gguf
33mmproj = /root/.cache/llama.cpp/mmproj/mmproj-Qwen3.6-35B-A3B-Uncensored-BF16.gguf
34#spec-draft-model = /root/.cache/llama.cpp/mtp/Qwen3.6-35B-A3B-MTP-q4_0.gguf
35#spec-draft-model = /root/.cache/llama.cpp/eagle3/eagle3-draft-q8_0.gguf
36spec-draft-model = /root/.cache/llama.cpp/dflash/Qwen3.6-35B-A3B-DFlash-q8_0.gguf
37temperature = 0.7
38top-k = 20
39top-p = 0.8
40presence-penalty = 1.5
41repeat-penalty = 1.0
42seed = 42
43spec-type = draft-dflash,ngram-mod,ngram-map-k4v
44spec-draft-n-max = 7
45spec-draft-p-min = 0.50
46spec-draft-prio = 2
47spec-draft-prio-batch = 2
48spec-ngram-mod-n-match = 24
49spec-ngram-mod-n-min = 48
50spec-ngram-mod-n-max = 64
51spec-ngram-map-k4v-size-n = 8
52spec-ngram-map-k4v-size-m = 24
53spec-ngram-map-k4v-min-hits = 2spec-draft-n-max (https://github.com/ggml-org/llama.cpp/pull/22105#issuecomment-4799827892)@ruixiang63 Is--spec-draft-n-max 15the recommended for dflash?It depends on the DFlash model. Most DFlash models are trained with a block size of 16, meaning one diffusion forward pass usesid_last + <mask>*15. This value is specified in the DFlash model config asblock_size.However, I found that some models were trained with different block sizes. For example:
- z-lab/LLaMA3.1-8B-Instruct-DFlash-UltraChat:
block_size=10- z-lab/gpt-oss-120b-DFlash:
block_size=10- z-lab/gpt-oss-20b-DFlash:
block_size=8So in practice, we can set--spec-draft-n-max <= block_size - 1. If it exceeds that value, the current code logic will clamp it toblock_size - 1. @ggerganov
1git clone -b master https://github.com/ggml-org/llama.cpp
2git remote add ruixiang63 https://github.com/ruixiang63/llama.cpp
3git fetch ruixiang63
4git checkout -b dflash-test origin/master
5git merge ruixiang63/dflash --no-edit1layer.bq = create_tensor(tn(LLM_TENSOR_ATTN_Q, "bias", i), {n_embd_head_k * n_head}, TENSOR_NOT_REQUIRED);
2layer.bk = create_tensor(tn(LLM_TENSOR_ATTN_K, "bias", i), {n_embd_k_gqa}, TENSOR_NOT_REQUIRED);
3layer.bv = create_tensor(tn(LLM_TENSOR_ATTN_V, "bias", i), {n_embd_v_gqa}, TENSOR_NOT_REQUIRED);
4layer.bo = create_tensor(tn(LLM_TENSOR_ATTN_OUT, "bias", i), {n_embd}, TENSOR_NOT_REQUIRED);1layer.wq_b = create_tensor(tn(LLM_TENSOR_ATTN_Q, "bias", i), {n_embd_head_k * n_head}, TENSOR_NOT_REQUIRED);
2layer.wk_b = create_tensor(tn(LLM_TENSOR_ATTN_K, "bias", i), {n_embd_k_gqa}, TENSOR_NOT_REQUIRED);
3layer.wv_b = create_tensor(tn(LLM_TENSOR_ATTN_V, "bias", i), {n_embd_v_gqa}, TENSOR_NOT_REQUIRED);
4layer.wo_b = create_tensor(tn(LLM_TENSOR_ATTN_OUT, "bias", i), {n_embd}, TENSOR_NOT_REQUIRED);1 cur = build_attn(inp_attn,
2 model.layers[il].wo, NULL, NULL, // 3rd tensor parameter (wo_s)
3 Qcur, Kcur, Vcur, nullptr, nullptr, nullptr, kq_scale, il);--dflash param is added to the llama-speculative-simple test