defnoteatin commited on
Commit
587cf4d
·
verified ·
1 Parent(s): 2c5b1d2

Update flash_next/README.md with O(1) decode and latest benchmarks

Browse files
Files changed (1) hide show
  1. flash_next/README.md +32 -10
flash_next/README.md CHANGED
@@ -6,6 +6,7 @@ tags:
6
  - pseudobrain
7
  - qwen3.8-flash-next
8
  - qwen4-exp
 
9
  - moe
10
  - gated-deltanet
11
  - dflash2
@@ -22,19 +23,40 @@ tags:
22
  **GitHub Repository & vLLM Plugin:** [https://github.com/defnotean/pseudobrain](https://github.com/defnotean/pseudobrain)
23
  **Hugging Face Weights:** [https://huggingface.co/defnotean1/PseudoBrain-Qwen3.8-Flash-Next-NVFP4](https://huggingface.co/defnotean1/PseudoBrain-Qwen3.8-Flash-Next-NVFP4)
24
  **Speculative Draft Model (`DFlash2`):** [`incoai/Qwen3.8-Flash-Next-DFlash2`](https://huggingface.co/incoai/Qwen3.8-Flash-Next-DFlash2)
 
25
  **Architecture Paper:** [`docs/PSEUDOBRAIN_ARCHITECTURE_PAPER.md`](https://github.com/defnotean/pseudobrain/blob/main/docs/PSEUDOBRAIN_ARCHITECTURE_PAPER.md)
26
 
27
  ## Overview
28
 
29
- **PseudoBrain-Qwen3.8-Flash-Next-NVFP4 (`flash_next`)** is an ultra-sparse Mixture-of-Experts (`48` layers, `512` routed experts with `top-10` active per token + `1` shared expert, Per-Layer Embeddings / PLE) constant-GPU-memory hybrid long-context conversion of `Huihui-Qwen3.8-Flash-Next-abliterated-NVFP4-QAD` (`Qwen4ExpForConditionalGeneration`). All `12` full-attention layers (`[3, 7, 11, ..., 47]`) are converted into **Hybrid Windowed-Attention + Parallel Gated DeltaNet** blocks (`PB27Qwen4ExpDecoderLayer`) alongside `36` native Gated DeltaNet layers, PseudoBrain's **Three-Tier NVMe/Page-Cache Exact Memory Archive** with **True $O(1)$ Constant-Speed Decode**, and native **`DFlash2` multi-layer speculative decoding** (`5` speculative draft tokens per step).
30
 
31
- - **True $O(1)$ Constant-Speed Decode up to `1,000,000` Tokens (`64–183 tok/s` at `500K`):** Decouples the context-scaled prefill retrieval budget (`PB27_MEMORY_SCALE`) from the constant decode budget (`PB27_MEMORY_DECODE_BLOCKS=64`, `PB27_MEMORY_DECODE_RERANK=0`, `PB27_MEMORY_DECODE_STRIDE=64`), warms the GPU LSE-merge cache (`cached_pre_k` / `cached_pre_v`) at the end of `final_prefill`, and uses **2-Level Hierarchical `bf16` Quest Super-Block Bounds** (`64` blocks = `4,096` tokens per super-block) for $O(1)$ (`~0.05 ms`) bound scoring.
32
- - **$O(1)$ Constant GPU KV Cache (`~28 GiB` Total GPU Footprint up to `1,000,000` Tokens):** Uses only `8.1%` of a fixed `6 GiB` KV cache pool even at `1,000,000` tokens on a single NVIDIA GB10 GPU.
33
- - **Strong General Reasoning, Math & Coding Capabilities:**
34
- - **MMLU (`n=300`, 0-shot, greedy):** **`85.00%`** (`255 / 300`, `stderr: 0.0206`)
35
- - **GSM8K (`n=150`, CoT, greedy non-thinking):** **`96.00%`** (`144 / 150`, `stderr: 0.0161`)
36
- - **MMLU-Pro (`n=150`, 10-option CoT, greedy non-thinking):** **`81.33%`** (`122 / 150`, `85.31%` non-truncated)
37
- - **Custom Medium-Hard Coding Benchmark (`flash_next_med`, 33 problems):** **`96.97%` (`32 / 33`)** (`easy: 8/8`, `medium: 12/12`, `fix: 3/3`, `hard: 9/10`, `0` syntax/truncation errors)
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
38
 
39
  ## Long-Context Exact Retrieval & $O(1)$ Decode Benchmark (`8K` to `1,000,000` Tokens)
40
 
@@ -47,7 +69,7 @@ tags:
47
  | **`200,000`** | **`1.0`** | **`1.0`** | **`1.0`** | **`1.0` (`4/4`)** | **`1.0`** | **`125.99s`** | **`50.81 tok/s`** | `8.1%` |
48
  | **`250,000`** | **`1.0`** | **`1.0`** | **`1.0`** | **`1.0` (`4/4`)** | **`1.0`** | **`110.16s`** | **`69.87 tok/s`** (`58.98` `multi4`) | `8.1%` |
49
  | **`500,000`** | **`1.0`** | **`1.0`** | **`1.0`** | **`1.0` (`4/4`)** | **`1.0`** | **`234.05s`** | **`64.91 tok/s`** (`183.54` `needle@0.1`, `47.69` `multi4`) | `8.1%` |
50
- | **`1,000,000`** | **`1.0`** | **`1.0`** | **`1.0`** | **`0.75` (`3/4`)** | `0.0` | **`543.06s`** | **`63.76 tok/s`** (`44.60` mean, `37.27` `multi4`) | `8.1%` |
51
 
52
  ## Quickstart with vLLM + `DFlash2` Speculative Decoding
53
 
@@ -69,6 +91,6 @@ tags:
69
  PB27_MEMORY_DECODE_BLOCKS=64 \
70
  PB27_MEMORY_DECODE_RERANK=0 \
71
  PB27_MEMORY_SUPERBLOCK=64 \
72
- PB27_SPECULATIVE_CONFIG='{"method":"dflash","model":"incoai/Qwen3.8-Flash-Next-DFlash2","num_speculative_tokens":5}' \
73
  bash serving/pb27_vllm/serve.sh defnotean1/PseudoBrain-Qwen3.8-Flash-Next-NVFP4 8000
74
  ```
 
6
  - pseudobrain
7
  - qwen3.8-flash-next
8
  - qwen4-exp
9
+ - abliterated
10
  - moe
11
  - gated-deltanet
12
  - dflash2
 
23
  **GitHub Repository & vLLM Plugin:** [https://github.com/defnotean/pseudobrain](https://github.com/defnotean/pseudobrain)
24
  **Hugging Face Weights:** [https://huggingface.co/defnotean1/PseudoBrain-Qwen3.8-Flash-Next-NVFP4](https://huggingface.co/defnotean1/PseudoBrain-Qwen3.8-Flash-Next-NVFP4)
25
  **Speculative Draft Model (`DFlash2`):** [`incoai/Qwen3.8-Flash-Next-DFlash2`](https://huggingface.co/incoai/Qwen3.8-Flash-Next-DFlash2)
26
+ **Companion Models:** [`PseudoBrain-Nex-35B-A3B-NVFP4`](https://huggingface.co/defnotean1/PseudoBrain-Nex-35B-A3B-NVFP4) | [`PseudoBrain-27B-NVFP4`](https://huggingface.co/defnotean1/PseudoBrain-27B-NVFP4)
27
  **Architecture Paper:** [`docs/PSEUDOBRAIN_ARCHITECTURE_PAPER.md`](https://github.com/defnotean/pseudobrain/blob/main/docs/PSEUDOBRAIN_ARCHITECTURE_PAPER.md)
28
 
29
  ## Overview
30
 
31
+ **PseudoBrain-Qwen3.8-Flash-Next-NVFP4 (`flash_next`)** is an ultra-sparse Mixture-of-Experts (`48` layers, `512` routed experts with `top-10` active per token + `1` shared expert, Per-Layer Embeddings / PLE) constant-GPU-memory hybrid long-context conversion of `edp1096/Huihui-Qwen3.8-Flash-Next-abliterated-NVFP4-QAD` (`huihui-ai/Huihui-Qwen3.8-Flash-Next-abliterated`, `Qwen4ExpForConditionalGeneration`). All `12` full-attention layers (`[3, 7, 11, ..., 47]`) are converted into **Hybrid Windowed-Attention + Parallel Gated DeltaNet** blocks (`PB27Qwen4ExpDecoderLayer`) alongside `36` native Gated DeltaNet layers, PseudoBrain's **Three-Tier NVMe/Page-Cache Exact Memory Archive** with **True $O(1)$ Constant-Speed Decode**, and native **`DFlash2` multi-layer speculative decoding** (`5–8` speculative draft tokens per step).
32
 
33
+ - **True $O(1)$ Constant-Speed Decode up to `1,000,000` Tokens (`44.6–183.5 tok/s` at `500K–1M`):** Decouples the context-scaled prefill retrieval budget (`PB27_MEMORY_SCALE`) from the constant decode budget (`PB27_MEMORY_DECODE_BLOCKS=64`, `PB27_MEMORY_DECODE_RERANK=0`, `PB27_MEMORY_DECODE_STRIDE=64`), warms the GPU LSE-merge cache (`cached_pre_k` / `cached_pre_v`) at the end of `final_prefill`, and uses **2-Level Hierarchical `bf16` Quest Super-Block Bounds** (`64` blocks = `4,096` tokens per super-block) for $O(1)$ (`~0.05 ms`) bound scoring.
34
+ - **Priority-Aware RoPE Sink Repositioning (`_reposition_rope_sinks`):** Dynamically re-rotates retrieved archive blocks into contiguous local RoPE positions just before the `16K` sliding window, reaching **`1,000,000` tokens without static YaRN `factor=4.0` short-context degradation**.
35
+ - **$O(1)$ Constant GPU KV Cache (`~28 GiB` Total GPU Footprint up to `1,000,000` Tokens):** Uses only `8.1%` (`~486 MiB`) of a fixed `6 GiB` KV cache pool even at `1,000,000` tokens on a single NVIDIA GB10 GPU.
36
+
37
+ ## Stock `Qwen3.8-Flash-Next` vs. `PseudoBrain-Qwen3.8-Flash-Next-NVFP4` Comparison
38
+
39
+ ### 1. Capability & Reasoning Benchmarks
40
+
41
+ | Benchmark | Stock `Qwen3.8-Flash-Next` (Official / Base / QAD) | **`PseudoBrain-Qwen3.8-Flash-Next-NVFP4` (Ours)** | Comparison |
42
+ | :--- | :---: | :---: | :---: |
43
+ | **MMLU** (`n=300`, 57 subjects) | `~85.0% – 87.9%` | **`85.00%`** (`255/300`, `±2.06%` stderr) | Within statistical stderr of stock |
44
+ | **MMLU-Pro** (`n=150`, 10-choice college reasoning) | `73.23%` *(Base)* / `80.6%` *(3-Next Instruct)* | **`81.33%`** (`122/150` raw) / **`85.31%`** *(non-truncated)* | **Matches / +0.7% to +4.7% over stock Instruct** |
45
+ | **GSM8K** (`n=150`, strict match) | `93.29%` *(Official tech report)* | **`96.00%`** (`144/150`, `±1.61%` stderr) | **+2.71% above official report** |
46
+ | **Coding** (`LiveCodeBench v6` / `custom_code_bench` 33-problem suite) | `91.9%` *(LCB v6)* / `82.9%` *(Terminal-Bench 2.1 NVFP4)* | **`96.97%`** (`32/33` exact pass at **`74.74 tok/s`**) | Zero degradation from GDN + NVMe PLE |
47
+ | **Long-Context Recall (`AA-LCR` vs. `8K–1M` NIAH/Multi4/Trace4)** | `71.9%` *(FP8)* / `74.1%` *(NVFP4)* / `79.4%` *(LIL QAD)* | **`100.0%` (`35/35`)** at `8K–500K`<br>**`100.0%` (`3/3`)** single-needle at **`1M`**<br>**`75.0%` (`3/4`)** `multi4` at **`1M`** | **Exact 100% single-needle recall all the way to `1,000,000` tokens** |
48
+
49
+ ### 2. Same-Hardware (`DGX Spark GB10, TP1`) Speed & Memory at `65K` and `1,000,000` Tokens
50
+
51
+ Compared directly against the upstream `runtime-qualification.json` in `edp1096/Huihui-Qwen3.8-Flash-Next-abliterated-NVFP4-QAD` measured on the **exact same `DGX Spark (GB10), TP1` hardware**:
52
+
53
+ | Metric on **DGX Spark (GB10, TP1)** | Stock `Huihui-Qwen3.8-Flash-Next-NVFP4-QAD` (`runtime-qualification.json`) | **`PseudoBrain-Qwen3.8-Flash-Next-NVFP4` (Ours)** | Speedup / Savings |
54
+ | :--- | :---: | :---: | :---: |
55
+ | **`65K` Prefill Time (TTFT)** | `38.93 s` (`1,680 tok/s`) | **`21.02 s` (`3,108 tok/s`)** | **1.85× faster prefill (`-46%` latency)** |
56
+ | **`65K` Decode Speed (`tok/s`)** | `35.8 – 39.1 tok/s` *(mean `37.8 tok/s`, MTP-3)* | **`53.4 – 88.3 tok/s`** *(mean **`65.9 tok/s`**, peak **`183.5 tok/s`** w/ DFlash2)* | **1.74× – 2.26× faster decode** |
57
+ | **`1,000,000` (`1M`) Prefill Time (TTFT)** | `1,128.0 – 1,132.2 s` (`18.9 min`, `926 tok/s`) | **`543.06 s`** (`9.0 min`, **`1,801 tok/s`**) | **2.08× faster `1M` prefill (saves ~10 min per `1M` prompt)** |
58
+ | **`1,000,000` (`1M`) Decode Speed (`tok/s`)** | `33.3 – 37.1 tok/s` *(mean `34.9 tok/s`)* | **`44.6 – 67.7 tok/s`** *(mean **`57.1 tok/s`**, `67.7 tok/s` on `1M` needle)* | **1.64× – 1.94× faster decode at `1M` tokens** |
59
+ | **KV Cache Memory at `1M` Tokens** | Full `1,048,576`-token `fp8` KV cache (`--mem-fraction-static 0.86`, `max-running-requests 1`, requires static YaRN `factor=4.0`) | **Fixed `16,384`-token GPU window (`8.1%` of `6 GiB` pool = `~486 MiB`)** + NVMe Quest $O(1)$ archive (`--max-num-seqs 16`, **no static YaRN degradation**) | **~96% less GPU KV cache memory at `1M` + `16` concurrent sequences** |
60
 
61
  ## Long-Context Exact Retrieval & $O(1)$ Decode Benchmark (`8K` to `1,000,000` Tokens)
62
 
 
69
  | **`200,000`** | **`1.0`** | **`1.0`** | **`1.0`** | **`1.0` (`4/4`)** | **`1.0`** | **`125.99s`** | **`50.81 tok/s`** | `8.1%` |
70
  | **`250,000`** | **`1.0`** | **`1.0`** | **`1.0`** | **`1.0` (`4/4`)** | **`1.0`** | **`110.16s`** | **`69.87 tok/s`** (`58.98` `multi4`) | `8.1%` |
71
  | **`500,000`** | **`1.0`** | **`1.0`** | **`1.0`** | **`1.0` (`4/4`)** | **`1.0`** | **`234.05s`** | **`64.91 tok/s`** (`183.54` `needle@0.1`, `47.69` `multi4`) | `8.1%` |
72
+ | **`1,000,000`** | **`1.0`** | **`1.0`** | **`1.0`** | **`0.75` (`3/4`)** | `0.0` | **`543.06s`** | **`63.76 tok/s`** (`67.72` `needle@0.1`, `57.1` needle mean, `44.60` overall mean) | `8.1%` |
73
 
74
  ## Quickstart with vLLM + `DFlash2` Speculative Decoding
75
 
 
91
  PB27_MEMORY_DECODE_BLOCKS=64 \
92
  PB27_MEMORY_DECODE_RERANK=0 \
93
  PB27_MEMORY_SUPERBLOCK=64 \
94
+ PB27_SPECULATIVE_CONFIG='{"method":"dflash","model":"incoai/Qwen3.8-Flash-Next-DFlash2","num_speculative_tokens":8}' \
95
  bash serving/pb27_vllm/serve.sh defnotean1/PseudoBrain-Qwen3.8-Flash-Next-NVFP4 8000
96
  ```