witcheer commited on
Commit
47bc658
·
verified ·
1 Parent(s): b115dde

Upload reports/diffusion-vs-ar.md with huggingface_hub

Browse files
Files changed (1) hide show
  1. reports/diffusion-vs-ar.md +81 -0
reports/diffusion-vs-ar.md ADDED
@@ -0,0 +1,81 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Block diffusion vs its autoregressive twin on one RTX 5090: the hyped speedup doesn't show — AR wins at every length
2
+
3
+ **Rig:** one RTX 5090 32GB · llama.cpp diffusion-gemma build (PR #24427, sm_120 CUDA) ·
4
+ **gemma-4-26B-A4B-it** (autoregressive) vs **diffusiongemma-26B-A4B-it** (block diffusion) ·
5
+ both **Q4_K_M**, both **source-converted through the same pipeline** · batch 1 · temp 0.4
6
+
7
+ **Setup:** These are the same Gemma-4 26B-A4B checkpoint family — one trained autoregressive, one as a
8
+ block-diffusion variant — so the only variable is the *generation paradigm*. Both were converted from the
9
+ original `google/…` safetensors with the **same** `convert_hf_to_gguf.py` and **plain** `Q4_K_M` (no imatrix),
10
+ run on the **same** llama.cpp build, same GPU. AR is served via `llama-server` (reasoning off → clean final
11
+ answers); diffusion via `llama-diffusion-gemma-cli` (128 steps, entropy-bound early-stop to ~48). Throughput
12
+ is each runtime's own **load-excluded** generation timing. **Effective answer tok/s = answer_tokens /
13
+ generation_seconds** — the fair cross-paradigm metric, because diffusion pays a *fixed* canvas cost
14
+ regardless of how long the answer is.
15
+
16
+ ## The board
17
+
18
+ | prompt | answer len | AR tok/s | diffusion **eff** tok/s | diffusion raw canvas tok/s | AR faster by |
19
+ |---|---|---|---|---|---|
20
+ | factual-short | 2 | 114\* | 0.8 | 104 | **142×** |
21
+ | factual | 32 | 242 | 9.0 | 72 | **27×** |
22
+ | math | 16 | 249 | 4.5 | 73 | **55×** |
23
+ | reasoning | 256 | 248 | 107.6 | 107 | **2.3×** |
24
+ | explain-med | 256 | 245 | 72.5 | 72 | **3.4×** |
25
+ | generate-long | 256 | 251 | 71.9 | 72 | **3.5×** |
26
+
27
+ \* factual-short's AR rate is cold-start / 3-token measurement noise; AR steady-state is ~248 tok/s.
28
+ **VRAM: AR 17.6 GB · diffusion 19.6 GB.**
29
+
30
+ ## The finding
31
+
32
+ **On its own autoregressive twin — identical training family, params, quant, hardware — block diffusion is
33
+ slower at every answer length, and uses more VRAM.** AR holds a rock-steady **~248 tok/s**. Diffusion pays a
34
+ fixed **~2.5–3.5 s** cost to denoise a 256-token canvas no matter how short the answer is, so:
35
+
36
+ - **Short answers are catastrophic** — a 2-token reply ("Canberra") still costs the whole canvas: **0.8 eff
37
+ tok/s vs ~240** (≈140–300× slower).
38
+ - **Even its best case loses** — a reasoning answer that *fills* the 256 canvas peaks at **107 tok/s, still
39
+ 2.3× slower than AR**.
40
+ - **The raw canvas rate (72–108 tok/s) never reaches AR's ~248 either** — so the gap isn't only wasted canvas;
41
+ the paradigm is intrinsically slower at this scale.
42
+
43
+ The widely-shared day-0 claim ("~120+ t/s, *faster* than autoregressive") **does not reproduce** on a single
44
+ 5090 at Q4_K_M, batch 1.
45
+
46
+ ## Quality
47
+
48
+ Both answer the factual prompts correctly (Canberra; Leonardo da Vinci, ~1503). In no-think mode **AR produced
49
+ clean, correct, complete answers on all six — including the bat-and-ball trap (`$0.05`, correct, with no
50
+ thinking channel)**. Diffusion **can't** be put in no-think mode (the CLI exposes no thinking control), so on
51
+ the four reasoning-heavy prompts it dumped raw `<|channel>thought` into the canvas and never resolved a clean
52
+ final answer (math truncated mid-formula at 16 tokens). So in practice AR was both faster *and* cleaner — with
53
+ the honest caveat that the diffusion CLI's lack of no-think control handicaps it on those prompts.
54
+
55
+ ## Why diffusion might still matter (just not here)
56
+
57
+ Block diffusion's theoretical win is **parallelism** — denoising many tokens at once should amortize on long
58
+ outputs and, especially, under heavy **batching**. This test is **batch 1** on one GPU — the worst case for
59
+ it. The honest read: any throughput advantage needs serving load this rig didn't test, or more mature kernels
60
+ (PR #24427 is a draft). What's *measured*: at the single-stream interactive scale most people run locally,
61
+ autoregressive wins decisively.
62
+
63
+ ## Caveats
64
+
65
+ - Single RTX 5090, **batch 1**, Q4_K_M, temp 0.4 — no batching/concurrency (diffusion's best case is untested).
66
+ - diffusion-gemma support is an **unmerged draft PR (#24427)** with an experimental sampler — kernels may improve.
67
+ - Both models were **converted from source** with the PR's own converter, because *every* public GGUF (unsloth,
68
+ AlexAtomic, …) is missing the PR's self-conditioning tensors and won't load.
69
+ - AR forced no-think (clean answers); diffusion has **no** no-think control — the quality comparison is
70
+ asymmetric on reasoning prompts.
71
+
72
+ ## Worth it?
73
+
74
+ For **local single-stream use on a 5090 today: autoregressive Gemma-4 is the pick** — 2–300× faster and
75
+ cleaner output. Block diffusion is a genuinely interesting paradigm worth re-testing under batching and once
76
+ the kernels mature — but the day-0 "faster than AR" hype isn't real at this scale.
77
+
78
+ **Sources**
79
+ - llama.cpp diffusion-gemma PR: https://github.com/ggml-org/llama.cpp/pull/24427
80
+ - google/diffusiongemma-26B-A4B-it: https://huggingface.co/google/diffusiongemma-26B-A4B-it
81
+ - runner + chart: https://github.com/notwitcheer/llm-bench-rig (`scripts/diff_vs_ar.py`, `scripts/chart_diff_vs_ar.py`)