Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
19 commits
Select commit Hold shift + click to select a range
cc75a80
qwen35: DSpark speculative decoding support
davide221 Aug 18, 2026
b57738b
qwen35: per-step verify length for DSpark confidence gate
davide221 Aug 18, 2026
86eba54
ggml: fused DeltaNet decode kernels for HIP
davide221 Aug 18, 2026
cd2fc08
ggml: 64x64 MMQ tiles for dense verify widths on RDNA
davide221 Aug 18, 2026
fa345d6
qwen35: stacked projections and fused DeltaNet decode graph
davide221 Aug 18, 2026
e9e8cf4
qwen35: adaptive speculation policy and chain-path profiling
davide221 Aug 18, 2026
f1281da
ggml: FA vec kernel splits short KV spans across two blocks
davide221 Aug 18, 2026
cb08540
qwen35: adaptive policy probe step reacts fast
davide221 Aug 18, 2026
9df0a0a
qwen35: adaptive policy uses the measured spec/plain step-time ratio
davide221 Aug 18, 2026
ebc69e6
qwen35: DFlash 2 drafter support (dynamic convs + candidate selector)
davide221 Aug 19, 2026
324eb8b
ggml: skip the pathological mmq_x=32 small tile on RDNA
davide221 Aug 19, 2026
480e60a
Merge origin/main into qwen38-dspark
davide221 Aug 19, 2026
8f2d4fb
ggml: tree-mode support for the grouped-cols GDN kernel
davide221 Aug 20, 2026
4465965
qwen35: DFlash2 selector-scored DDTree candidates
davide221 Aug 20, 2026
2ff7afa
qwen35: fix and gate the chunked delta-net prefill path
davide221 Aug 20, 2026
9a32fda
ggml: binary exponentiation for the fp64 RoPE angle
davide221 Aug 20, 2026
a9f8296
ggml: dual-tile MMQ dispatch on RDNA4
davide221 Aug 20, 2026
1e0f49f
ggml: non-temporal weight loads in the IQ4_XS decode GEMV
davide221 Aug 20, 2026
bd56778
qwen35: expose tunable DFlash block size
davide221 Aug 21, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions server/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -454,6 +454,7 @@ add_library(dflash_common STATIC
src/common/dynamic_backend.cpp
src/common/domino_head.cpp
src/common/dspark_head.cpp
src/common/dflash2_head.cpp
src/common/target_shard_ipc.cpp
src/common/target_shard_ipc_daemon.cpp
src/common/dflash_feature_ring.cpp
Expand Down
10 changes: 10 additions & 0 deletions server/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -521,6 +521,16 @@ Same DFlash + PFlash stack on AMD GPUs. PR #119 ports the Phase 2 rocWMMA flashp

**RDNA4 — Radeon AI PRO R9700 (`gfx1201`, 32 GB).** First-class RDNA4 target as of this build. Qwen3.6-27B Q4_K_M + DFlash draft (`dflash-draft-3.6-q4_k_m.gguf`), `--ddtree-budget=22`: **54.65 tok/s mean DFlash decode** across the 10-prompt HumanEval suite (`bench_he.py --n-gen 256`, AL 7.14, range 36.9–93.0 tok/s) on ROCm 7.1.1. The rocWMMA Phase 2 flashprefill kernels are numerically correct on RDNA4 — ROCm 7.1's rocWMMA handles the gfx12 WMMA operand-format change internally, so no kernel changes are needed (`test_flashprefill_kernels` PASS on `gfx1201`: max diff 5e-4, e2e `flash_prefill_forward_bf16` at S=8192 in 10.7 ms/iter). Note `gfx1200` (RX 9060) and `gfx1201` (RX 9070 / R9700) are **not** code-object compatible — build for `gfx1201` explicitly for the R9700.

For Qwen3.8-27B IQ4_XS with the Q8_0 DFlash2 drafter, the drafter's metadata
block size is conservative on the R9700. `--draft-block-size 12` is the
general-purpose setting measured on `gfx1201`: 230.2 versus 159.8 aggregate
decode tok/s on the ten-prompt HumanEval benchmark (+44%), 178.5 versus 139.6
tok/s across all 164 HumanEval+ tasks (+28%), and 145/164 versus 143/164
pass@1. A code-heavy deployment can use `--draft-block-size 16` for 279.1
tok/s (+75%) on the short HumanEval benchmark, at the cost of small regressions
on some low-acceptance prose prompts. Values are intentionally explicit rather
than GPU defaults because the optimum depends on the drafter and workload.

```bash
git clone --recurse-submodules https://github.com/Luce-Org/lucebox-hub && cd lucebox-hub/server

Expand Down
30 changes: 30 additions & 0 deletions server/deps/llama.cpp/ggml/include/ggml.h
Original file line number Diff line number Diff line change
Expand Up @@ -2741,6 +2741,24 @@ extern "C" {
struct ggml_tensor * c,
struct ggml_tensor * parent_ids);

// dflash extension: fused causal-conv step for recurrent decode/verify.
// Replaces transpose + concat(state, x) + ssm_conv + silu + state
// write-back with one kernel.
// x: [C, T, S] f32, rows contiguous (token stride may be
// larger than C, e.g. a row-slice of a stacked GEMV)
// c: [K, C] f32 depthwise conv weights
// conv_state: [K-1, C, S] f32 history; READ, then OVERWRITTEN in
// place with the last K-1 conv inputs
// conv_input_out: optional [>= K-1+T, C, S] f32; receives the full
// conv window (history rows then x rows) per channel,
// for speculative-decode rollback. May be a view.
// Returns silu(conv(x)) as [C, T, S]. CUDA/HIP only.
GGML_API struct ggml_tensor * ggml_ssm_conv_step(
struct ggml_context * ctx,
struct ggml_tensor * x,
struct ggml_tensor * c,
struct ggml_tensor * conv_state,
struct ggml_tensor * conv_input_out);
// SpecLA heavy-light convolution. Applies compact accepted inputs to the
// durable conv state, then verifies the current tree without committing
// speculative inputs. Current input factors are written directly to the
Expand Down Expand Up @@ -2907,6 +2925,18 @@ extern "C" {
struct ggml_tensor * tensor,
bool skip_intermediate);

// dflash extension: let the kernel derive the gates from the raw
// projections instead of graph-side sigmoid/softplus ops:
// beta_val = sigmoid(beta_raw)
// g_val = exp(softplus(alpha_raw + dt_bias[h]) * A[h])
// `g` then carries alpha_raw and `beta` carries beta_raw (both [1,H,T,S]);
// gate_ba is a contiguous f32 [2*H] tensor holding [dt_bias | A]
// (src[9], op_params[10] = 1). Only for the non-tree, non-KDA,
// non-SpecLA CUDA/HIP path.
GGML_API void ggml_gated_delta_net_set_raw_gates(
struct ggml_tensor * tensor,
struct ggml_tensor * gate_ba);

// dflash extension: tree-mode gated delta net for DDTree-style
// speculative decoding verify. `parent_ids` is an int32 tensor of shape
// [n_tokens, n_seqs] where entry [t, s] is the index within sequence s of
Expand Down
2 changes: 2 additions & 0 deletions server/deps/llama.cpp/ggml/src/ggml-cpu/ops.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9332,6 +9332,8 @@ void ggml_compute_forward_flash_attn_back(
static void ggml_compute_forward_ssm_conv_f32(
const ggml_compute_params * params,
ggml_tensor * dst) {
// dflash: the fused step mode (ggml_ssm_conv_step) is CUDA/HIP only
GGML_ASSERT(ggml_get_op_params_i32(dst, 0) == 0 && "ggml_ssm_conv_step is not supported on CPU");
const ggml_tensor * src0 = dst->src[0]; // conv_x
const ggml_tensor * src1 = dst->src[1]; // conv1d.weight

Expand Down
5 changes: 4 additions & 1 deletion server/deps/llama.cpp/ggml/src/ggml-cuda/fattn-vec.cuh
Original file line number Diff line number Diff line change
Expand Up @@ -534,7 +534,10 @@ void ggml_cuda_flash_attn_ext_vec_case_impl(ggml_backend_cuda_context & ctx, ggm
const bool need_f16_K = type_K == GGML_TYPE_F16;
const bool need_f16_V = type_V == GGML_TYPE_F16;
constexpr size_t nbytes_shared = 0;
launch_fattn<D, cols_per_block, 1>(ctx, dst, fattn_kernel, nwarps, nbytes_shared, D, need_f16_K, need_f16_V, false);
// The kernel walks the KV sequence in steps of nthreads (not D); telling
// launch_fattn so lets it split a short KV span (e.g. a 256-token window
// at head_dim 256) across two blocks per head instead of one.
launch_fattn<D, cols_per_block, 1>(ctx, dst, fattn_kernel, nwarps, nbytes_shared, nthreads, need_f16_K, need_f16_V, false);
}

template <int D, ggml_type type_K, ggml_type type_V>
Expand Down
Loading
Loading