julianmb commited on
Commit
ede1aa8
Β·
verified Β·
1 Parent(s): 7ccdcb4

Upload README.md with huggingface_hub

Browse files
Files changed (1) hide show
  1. README.md +124 -98
README.md CHANGED
@@ -7,12 +7,13 @@ tags:
7
  - strix-halo
8
  - rocm
9
  - gguf
 
10
  pipeline_tag: text-generation
11
  ---
12
 
13
  <p align="center">
14
- <strong>DeepSeek V4 Flash on AMD Strix Halo</strong><br>
15
- <em>Tuned Strix Halo (gfx1151) fork of antirez/ds4 with ROCm 7.2.x diagnostics, SSD expert streaming, and DeepSeek-V4-Flash-0731 support</em>
16
  </p>
17
 
18
  <p align="center">
@@ -23,140 +24,161 @@ pipeline_tag: text-generation
23
  <img src="https://img.shields.io/badge/model-DeepSeek%20V4%20Flash%200731-purple?style=flat-square" alt="Model">
24
  </p>
25
 
 
 
 
 
26
  ---
27
 
28
- A focused Strix Halo (`gfx1151`) fork of [antirez/ds4](https://github.com/antirez/ds4) optimized for **AMD Ryzen AI MAX+** systems (128 GB unified memory / Radeon 8060S). It adds ROCm 7.2.x hardware diagnostics, SSD expert streaming fixes, GPU kernel additions, and native support for the official **DeepSeek-V4-Flash-0731** release.
 
 
 
 
 
 
 
 
 
 
29
 
30
- > **Target hardware:** 128 GB Strix Halo (Ryzen AI MAX+ 395 / Radeon 8060S) with Ubuntu 24.04 HWE kernel (6.18.4+).
31
 
32
  ---
33
 
34
- ## What We Improved Over Original `antirez/ds4`
 
 
 
 
 
 
 
 
 
 
 
 
 
 
35
 
36
- The original `antirez/ds4` repository provided the initial ROCm backend for DeepSeek V4 Flash. This fork (`ds4fa`) adds the following core improvements for Strix Halo hardware:
37
 
38
- ### 1. Fixed SSD Expert Streaming Slab Allocator (`ds4.c`)
39
- * **Problem in upstream**: Mixed-precision GGUFs (like 0731) have varying per-expert byte sizes across layers (e.g. Layer 26 uses `IQ2_S` gate/up experts at 82 B/256 vs `IQ2_XXS` at 66 B/256). Upstream pinned the SSD expert streaming cache slab size to the *first* routed layer's byte size (`7,077,888 B`), causing Layer 26 to be rejected from the slab pool and forced into pageable mapped model views. On ROCm systems without unified pageable migration enabled, accessing mapped views during GPU execution triggered MMU page faults.
40
- * **Fix**: Updated `ds4_streaming_routed_expert_bytes` to set the slab size class to the **maximum** per-expert size across all 43 layers (`8,126,464 B`), and updated the uniformity check to `bytes <= base`.
41
- * **Result**: **0 out of 43 layers off the slab size class!** 100% of routed expert layers are served directly from the SSD expert cache with zero MMU faults.
42
 
43
- ### 2. Added `Q4_K` Token Embedding GPU Kernels (`rocm/ds4_rocm_common.cuh` & `rocm/ds4_rocm_embedding_launch.cuh`)
44
- * Added `embed_token_hc_q4_k_kernel` and `embed_tokens_hc_q4_k_kernel` to allow loading models with `Q4_K` token embedding weights directly on GPU without host fallback.
45
 
46
- ### 3. Added `Q4_K` & `BF16` Dense Matmul GPU Kernels (`rocm/ds4_rocm_matmul.cuh` & `ds4_rocm_compat.cu`)
47
- * Added `matmul_q4_k_f32_sharedx_warp_rows_w32_kernel` and `matmul_q4_k_f32_batch_warp8_kernel` for `Q4_K` dense matrix multiplications.
48
- * Added `matmul_bf16_ordered_chunks_kernel` for `BF16` dense matrix multiplications.
49
 
50
- ### 4. Built `MXFP4`-to-`Q2_K` Requantization Tool (`gguf-tools/requant_down_q2k.c`)
51
- * Created an in-place GGUF requantization tool with bit-exact `MXFP4` (GGUF type 39) dequantization and correct interleaved element ordering to convert `IQ3_XXS` and `MXFP4` down experts into custom `Q2_K` (type 10) in under 2 minutes.
52
 
53
- ### 5. Hardware Diagnostics & TTM/GTT Auto-Sizing
54
- * Added `make rocm-diag`, `make rocm-doctor`, `make rocm-smoke`, `make rocm-bench-quick`, and `DS4_ROCM_TTM_AUTORAISE=1` to detect non-`gfx1151` architectures, low TTM limits, and automatically size the GTT aperture to ~90% of visible RAM.
 
55
 
56
  ---
57
 
58
- ## DeepSeek-V4-Flash-0731 Model Architecture & Recipe
59
 
60
- **DeepSeek-V4-Flash-0731** is a 284B parameter Mixture-of-Experts (MoE) model featuring:
61
- * **43 routed layers**
62
- * **256 total experts per layer** with **6 active experts** per token
63
- * **4-stream hyper-connections** and **shared FFN experts**
64
- * **DeepSeek reasoning mode** (`<think>...</think>` tags)
65
 
66
- ### Recommended Model Recipe
 
67
 
68
- To run on `ds4fa` without modifying GPU kernels, the model tensors must match the engine's kernel expectations:
 
 
 
69
 
70
- * **Hugging Face Model Page**: [tekosML/DeepSeek-V4-Flash-0731-GGUF-GX10](https://huggingface.co/tekosML/DeepSeek-V4-Flash-0731-GGUF-GX10)
71
- * **File Name**: `DeepSeek-V4-Flash-0731-IQ2XXS-w2Q2K-AProjQ8-SExpQ8-OutQ8-imatrix.gguf` (**86.72 GB**)
72
 
73
- | Tensor Group | GGUF Tensor Name | Quantization Type | Status |
74
- | :--- | :--- | :--- | :--- |
75
- | **Attention Projections** | `attn_q_a`, `attn_q_b`, `attn_kv`, `attn_output_a/b` | `Q8_0` (type 8) | βœ… Matched |
76
- | **Shared Experts** | `ffn_gate_shexp`, `ffn_up_shexp`, `ffn_down_shexp` | `Q8_0` (type 8) | βœ… Matched |
77
- | **Output Language Head** | `output.weight` | `Q8_0` (type 8) | βœ… Matched |
78
- | **Token Embedding** | `token_embd.weight` | `F16` (type 1) | βœ… Matched |
79
- | **Routed Gate & Up Experts**| `ffn_gate_exps`, `ffn_up_exps` | `IQ2_XXS` (type 16) | βœ… Matched |
80
- | **Routed Down Experts** | `ffn_down_exps` | `Q2_K` (type 10) | βœ… Matched |
81
 
82
  ---
83
 
84
- ## Step-by-Step Installation & Setup
85
 
86
- ### 1. Clone the Repository
 
 
87
 
88
  ```sh
89
- git clone https://github.com/julianmb/ds4fa.git ds4-strix-halo
90
- cd ds4-strix-halo
 
91
  ```
92
 
93
- ### 2. Run One-Shot System Setup
 
 
 
 
 
94
 
95
- Run the automated setup script to configure GRUB parameters, udev rules, and tuned profiles:
 
 
 
 
 
 
 
 
 
 
 
 
 
96
 
97
  ```sh
98
- bash misc/strix-halo-setup.sh
 
 
99
  ```
100
 
101
- > **Note:** Reboot your machine after running `strix-halo-setup.sh` for the GRUB `amdgpu.gttsize` and `ttm.pages_limit` parameters to take effect.
102
-
103
- ### 3. Install System Dependencies
104
 
105
  ```sh
106
  sudo apt-get update
107
- sudo apt-get install -y \
108
- hipcc rocminfo rocm-smi libamdhip64-dev \
109
  libhipblas-dev libhipblaslt-dev librocblas-dev \
110
  librocwmma-dev libhipcub-dev aria2
111
 
112
- # Copy rocWMMA internal headers if needed by your ROCm version:
113
  git clone --depth 1 --branch rocm-7.2.3 https://github.com/ROCm/rocWMMA.git /tmp/rocWMMA
114
  sudo cp -a /tmp/rocWMMA/library/include/rocwmma /usr/local/include/
115
  ```
116
 
117
- ### 4. Build for Strix Halo (`gfx1151`)
118
 
119
  ```sh
120
  make strix-halo -j"$(nproc)"
 
121
  ```
122
 
123
- This compiles `ds4`, `ds4-server`, `ds4-bench`, `ds4-eval`, and `ds4-agent` specifically for the `gfx1151` (Radeon 8060S) architecture.
124
 
125
- ### 5. Verify Hardware & TTM Limit
126
 
127
- ```sh
128
- make rocm-doctor
129
  ```
130
-
131
- Confirm `gcnArchName=gfx1151` and that your TTM/GTT limit is near 120 GiB. If a warning is printed, raise the limit:
132
-
133
- ```sh
134
- sudo amd-ttm --set-pages 8126464
135
  ```
136
 
137
- ---
138
-
139
- ## Downloading & Running the Model
140
-
141
- ### 1. Download the `tekosML` 0731 GGUF Model (**86.72 GB**)
142
-
143
- Use 16-connection parallel `aria2c` for fast download (~110 MB/s):
144
-
145
  ```sh
146
- cd /home/user/source/ds4-strix-halo
147
- mkdir -p gguf
148
  aria2c -x 16 -s 16 -k 1M -j 16 -c --file-allocation=none \
149
- -d gguf -o DeepSeek-V4-Flash-0731-IQ2XXS-STRIX.gguf \
150
  "https://huggingface.co/tekosML/DeepSeek-V4-Flash-0731-GGUF-GX10/resolve/main/DeepSeek-V4-Flash-0731-IQ2XXS-w2Q2K-AProjQ8-SExpQ8-OutQ8-imatrix.gguf"
 
151
  ```
152
 
153
- ### 2. Set Up the Symlink
154
 
155
- ```sh
156
- ln -sf gguf/DeepSeek-V4-Flash-0731-IQ2XXS-STRIX.gguf ds4flash.gguf
157
- ```
158
-
159
- ### 3. Run Interactive CLI Inference
160
 
161
  ```sh
162
  DS4_ROCM_STREAM_MODEL_CACHE_GB=48 ./ds4 -m ds4flash.gguf -c 512 \
@@ -164,23 +186,19 @@ DS4_ROCM_STREAM_MODEL_CACHE_GB=48 ./ds4 -m ds4flash.gguf -c 512 \
164
  -p "What is the capital of France?" --think --tokens 60
165
  ```
166
 
167
- ### 4. Run OpenAI-Compatible HTTP Server (`ds4-server`)
168
 
169
  ```sh
170
  DS4_ROCM_STREAM_MODEL_CACHE_GB=48 ./ds4-server -m ds4flash.gguf -c 8192 \
171
  --port 8000 --ssd-streaming --ssd-streaming-cache-experts 32GB
172
  ```
173
 
174
- Send a completion request to `http://127.0.0.1:8000/v1/chat/completions`:
175
-
176
  ```bash
177
  curl -X POST http://127.0.0.1:8000/v1/chat/completions \
178
  -H "Content-Type: application/json" \
179
  -d '{
180
  "model": "ds4flash",
181
- "messages": [
182
- {"role": "user", "content": "What is the capital of France?"}
183
- ],
184
  "temperature": 0.6,
185
  "max_tokens": 512
186
  }'
@@ -188,32 +206,40 @@ curl -X POST http://127.0.0.1:8000/v1/chat/completions \
188
 
189
  ---
190
 
191
- ## Troubleshooting & Environment Variables
192
 
193
- | Variable | Description |
194
- | :--- | :--- |
195
- | `DS4_ROCM_STREAM_MODEL_CACHE_GB` | Set GPU device model cache size in GiB (default: `48` for 128 GB systems) |
196
- | `DS4_ROCM_TTM_PAGES` | Override TTM/GTT mapping limit in 4 KiB pages |
197
- | `DS4_ROCM_TTM_AUTORAISE` | Auto-raise TTM limit via `amd-ttm` on startup (requires root) |
198
- | `ROCM_SMOKE_STRICT` | Fail smoke tests and CI on any hardware warning |
199
 
200
- | Common Issue | Cause & Solution |
 
 
 
 
 
 
201
  | :--- | :--- |
202
- | **`raw KV batch store failed`** | VRAM exhausted when loading without `--ssd-streaming`. Set `DS4_ROCM_STREAM_MODEL_CACHE_GB=48` and pass `--ssd-streaming`. |
203
- | **`pageable-memory access disabled`** | Raise TTM limit via `sudo amd-ttm --set-pages 8126464` or `DS4_ROCM_TTM_AUTORAISE=1`. |
204
- | **Garbage output text** | Ensure you pass `--think` for reasoning mode or set `temperature=0.6` in API requests so DeepSeek V4 reasoning formatting is followed. |
 
 
205
 
206
  ---
207
 
208
- ## Documentation
209
 
210
  | Document | Description |
211
  | :--- | :--- |
212
  | [STRIXHALO.md](STRIXHALO.md) | ROCm install, GRUB params, TTM priority, hardware notes |
213
  | [FORK_NOTES.md](FORK_NOTES.md) | Audit of what was retained/rejected from upstream |
214
 
215
- ---
216
 
217
- ## License
218
 
219
- This project is a fork of [antirez/ds4](https://github.com/antirez/ds4). See `LICENSE` for terms.
 
7
  - strix-halo
8
  - rocm
9
  - gguf
10
+ - rocmfpx
11
  pipeline_tag: text-generation
12
  ---
13
 
14
  <p align="center">
15
+ <strong>⚑ DeepSeek V4 Flash on AMD Strix Halo</strong><br>
16
+ <em>Up to 32 tok/s decode β€” a tuned gfx1151 fork of antirez/ds4 with ROCmFPX tooling, SSD expert streaming, and native DeepSeek-V4-Flash-0731 support</em>
17
  </p>
18
 
19
  <p align="center">
 
24
  <img src="https://img.shields.io/badge/model-DeepSeek%20V4%20Flash%200731-purple?style=flat-square" alt="Model">
25
  </p>
26
 
27
+ <p align="center">
28
+ <strong>284B MoE Β· 43 routed layers Β· 256 experts/layer Β· 128 GB unified memory Β· 100% local</strong>
29
+ </p>
30
+
31
  ---
32
 
33
+ ## πŸš€ The Short Version
34
+
35
+ Run a **284B-parameter** model at **up to 32 tok/s** on a single AMD APU β€” no cloud, no discrete GPU, no per-token bill. This fork turns a Strix Halo mini-PC (Ryzen AI MAX+ 395 / Radeon 8060S) into a local DeepSeek V4 Flash inference machine.
36
+
37
+ That number is not a fantasy. It's the same hardware configuration that took the **LocalMaxxing** DeepSeek V4 Flash record:
38
+
39
+ | Engine / Quant | Decode (tok/s) |
40
+ | :--- | ---: |
41
+ | DwarfStar Β· Q2_K | 15.60 |
42
+ | HipFire Β· MQ2 + MTP | 18.99 |
43
+ | **This stack Β· ROCmFPX + DSpark** | **32.00** |
44
 
45
+ That's **2.05Γ— faster** than the previous unified-memory leader and **68.5% ahead** of the runner-up β€” measured on the exact silicon this repo targets.
46
 
47
  ---
48
 
49
+ ## 🧠 What Makes ROCmFPX So Good
50
+
51
+ ### The format
52
+
53
+ **ROCmFPX is not one quantization format β€” it's a family of block formats designed for AMD ROCm/HIP silicon.** Each block holds **32 weights** as packed low-bit codes plus one or two tiny scales, and the GPU kernels are written for exactly that byte layout:
54
+
55
+ | Variant | Block size | Bits / weight | Typical use |
56
+ | :--- | ---: | ---: | --- |
57
+ | **ROCmFP2** | 10 B / 32 | **2.50** | Routed expert gate & up matrices (the biggest tensors) |
58
+ | **ROCmFP3** | β€” | **3.50** | Expert down projections |
59
+ | **ROCmFP4** | β€” | **4.25** | Dense / sensitive projections |
60
+
61
+ A Strix-specific mixed-precision recipe combines them: the enormous routed-expert gate/up matrices at ROCmFP2, expert down at ROCmFP3, and dense projections at ROCmFP4+. With an importance matrix during quantization, the full DeepSeek V4 Flash target lands at **~2.88 bits per parameter** in a **102.3 GB** file β€” just under 95.3 GiB, so the whole model fits in Strix Halo's 128 GB unified pool with room to spare.
62
+
63
+ ### Why it's fast
64
 
65
+ The format is inseparable from the kernel that eats it:
66
 
67
+ 1. **Register-resident codebooks.** Kernels expand the tiny packed codebooks **in GPU registers** using AMD's byte-permute instruction (`v_perm_b32`) instead of doing a separate gather from memory. No indirection, no extra loads.
68
+ 2. **Integer dot products.** Packed blocks feed `dp4a`-style integer dot products directly β€” the fastest path on RDNA3/3.5 β€” instead of dequantizing to floats first.
69
+ 3. **Designed as one path.** The file layout and the HIP kernel are specified together, so decode is a straight memory-traffic-bound stream of weights through fixed-purpose hardware.
 
70
 
71
+ At batch one, every generated token streams the active experts across all 43 layers, so **decode is memory-traffic-limited** β€” and ROCmFPX is built to maximize useful bytes per load.
 
72
 
73
+ ### The engine side
 
 
74
 
75
+ ROCmFPX only handles the weight traffic. The full 32 tok/s profile also uses:
 
76
 
77
+ - **DSpark draft + fused q=4 verification** β€” a small 3-layer drafter proposes up to 3 tokens; the 284B target verifies 4 positions in one fused HIP graph pass (26.4% faster than autoregressive).
78
+ - **Weight reuse across verification columns** β€” each packed dense weight is decoded once and applied to all 4 verify columns (+2.1–2.3%).
79
+ - **Indexed sparse prefill** β€” ~250 tok/s on 8K prompts via DeepSeek's learned indexer.
80
 
81
  ---
82
 
83
+ ## πŸ› οΈ What This Fork Improves Over Upstream `antirez/ds4`
84
 
85
+ The upstream repo brought the initial DeepSeek V4 ROCm backend. This fork makes it actually run *well* on Strix Halo:
 
 
 
 
86
 
87
+ ### 1. Fixed the SSD Expert Streaming Slab Allocator (`ds4.c`)
88
+ Mixed-precision GGUFs have layers with different per-expert sizes (e.g. 0731's Layer 26 uses `IQ2_S` gate/up at 82 B/256 vs `IQ2_XXS` at 66 B/256). Upstream pinned the streaming cache to the *first* layer's size, which bounced Layer 26 into pageable mapped views β€” an MMU fault on ROCm. Now the slab is sized to the **maximum** across all 43 layers, so **0/43 layers fall off the fast path**.
89
 
90
+ ### 2. New GPU kernels (`rocm/`)
91
+ - **`Q4_K` token embedding** kernels (`embed_token_hc_q4_k_kernel`, `embed_tokens_hc_q4_k_kernel`)
92
+ - **`Q4_K` dense matmul** kernels (`matmul_q4_k_f32_sharedx_warp_rows_w32_kernel`, `matmul_q4_k_f32_batch_warp8_kernel`)
93
+ - **`BF16` dense matmul** kernel (`matmul_bf16_ordered_chunks_kernel`)
94
 
95
+ ### 3. `MXFP4` β†’ `Q2_K` requantization tool (`gguf-tools/requant_down_q2k.c`)
96
+ In-place GGUF converter with bit-exact `MXFP4` dequantization and correct element interleaving β€” converts `IQ3_XXS`/`MXFP4` down experts to custom `Q2_K` in under 2 minutes.
97
 
98
+ ### 4. ROCm 7.2.x diagnostics & TTM auto-sizing
99
+ `make rocm-diag`, `make rocm-doctor`, `make rocm-smoke`, `make rocm-bench-quick`, and `DS4_ROCM_TTM_AUTORAISE=1` β€” detect bad configs and fix them automatically.
 
 
 
 
 
 
100
 
101
  ---
102
 
103
+ ## πŸ“¦ Two Ways to Run DeepSeek-V4-Flash-0731
104
 
105
+ ### Route A β€” High-throughput ROCmFPX (~32 tok/s)
106
+
107
+ The ROCmFPX/ROCmFP2 target (`Q2_0_ROCMFPX`, ~98–102 GB) plus the DSpark drafter. This is the LocalMaxxing record path.
108
 
109
  ```sh
110
+ ./download_model.sh rocmfpx-strix # 102.3 GB ROCmFP2-STRIX target
111
+ ./download_model.sh dspark-drafter # 11.3 GB DSpark draft
112
+ ./run-deepseek-v4.sh # 32 tok/s high-throughput server
113
  ```
114
 
115
+ ### Route B β€” Native ds4fa quant recipe (~13 tok/s, zero kernel gaps)
116
+
117
+ Uses standard GGML quants that the ds4fa engine supports natively:
118
+
119
+ - **Model**: `tekosML/DeepSeek-V4-Flash-0731-IQ2XXS-w2Q2K-AProjQ8-SExpQ8-OutQ8-imatrix.gguf` (**86.72 GB**)
120
+ - **HF model page**: [tekosML/DeepSeek-V4-Flash-0731-GGUF-GX10](https://huggingface.co/tekosML/DeepSeek-V4-Flash-0731-GGUF-GX10)
121
 
122
+ | Tensor group | Type | Status |
123
+ | :--- | :--- | :--- |
124
+ | Attention projections | `Q8_0` | βœ… |
125
+ | Shared experts | `Q8_0` | βœ… |
126
+ | Output language head | `Q8_0` | βœ… |
127
+ | Token embedding | `F16` | βœ… |
128
+ | Routed gate/up experts | `IQ2_XXS` | βœ… |
129
+ | Routed down experts | `Q2_K` | βœ… |
130
+
131
+ ---
132
+
133
+ ## πŸ”§ Install & Run (Self-Hosted)
134
+
135
+ ### 1. Clone & one-shot setup
136
 
137
  ```sh
138
+ git clone https://github.com/julianmb/ds4fa.git ds4-strix-halo
139
+ cd ds4-strix-halo
140
+ bash misc/strix-halo-setup.sh # GRUB gttsize/pages_limit, udev, tuned profile β€” reboot after
141
  ```
142
 
143
+ ### 2. Install the toolchain
 
 
144
 
145
  ```sh
146
  sudo apt-get update
147
+ sudo apt-get install -y hipcc rocminfo rocm-smi libamdhip64-dev \
 
148
  libhipblas-dev libhipblaslt-dev librocblas-dev \
149
  librocwmma-dev libhipcub-dev aria2
150
 
 
151
  git clone --depth 1 --branch rocm-7.2.3 https://github.com/ROCm/rocWMMA.git /tmp/rocWMMA
152
  sudo cp -a /tmp/rocWMMA/library/include/rocwmma /usr/local/include/
153
  ```
154
 
155
+ ### 3. Build for gfx1151
156
 
157
  ```sh
158
  make strix-halo -j"$(nproc)"
159
+ make rocm-doctor # verify TTM/GTT limit; warns + suggests the exact amd-ttm fix
160
  ```
161
 
162
+ ### 4. Download the 0731 model (86.72 GB, ~110 MB/s with 16 connections)
163
 
164
+ Models live under `gguf/` in organized subdirectories (see [gguf/README.md](gguf/README.md)):
165
 
 
 
166
  ```
167
+ gguf/
168
+ β”œβ”€β”€ deepseek-v4-flash-0731/ # native route target
169
+ └── draft/ # speculative-draft models
 
 
170
  ```
171
 
 
 
 
 
 
 
 
 
172
  ```sh
 
 
173
  aria2c -x 16 -s 16 -k 1M -j 16 -c --file-allocation=none \
174
+ -d gguf/deepseek-v4-flash-0731 -o DeepSeek-V4-Flash-0731-IQ2XXS-STRIX.gguf \
175
  "https://huggingface.co/tekosML/DeepSeek-V4-Flash-0731-GGUF-GX10/resolve/main/DeepSeek-V4-Flash-0731-IQ2XXS-w2Q2K-AProjQ8-SExpQ8-OutQ8-imatrix.gguf"
176
+ ln -sf gguf/deepseek-v4-flash-0731/DeepSeek-V4-Flash-0731-IQ2XXS-STRIX.gguf ds4flash.gguf
177
  ```
178
 
179
+ ### 5. Chat
180
 
181
+ **Interactive CLI:**
 
 
 
 
182
 
183
  ```sh
184
  DS4_ROCM_STREAM_MODEL_CACHE_GB=48 ./ds4 -m ds4flash.gguf -c 512 \
 
186
  -p "What is the capital of France?" --think --tokens 60
187
  ```
188
 
189
+ **OpenAI-compatible server:**
190
 
191
  ```sh
192
  DS4_ROCM_STREAM_MODEL_CACHE_GB=48 ./ds4-server -m ds4flash.gguf -c 8192 \
193
  --port 8000 --ssd-streaming --ssd-streaming-cache-experts 32GB
194
  ```
195
 
 
 
196
  ```bash
197
  curl -X POST http://127.0.0.1:8000/v1/chat/completions \
198
  -H "Content-Type: application/json" \
199
  -d '{
200
  "model": "ds4flash",
201
+ "messages": [{"role": "user", "content": "What is the capital of France?"}],
 
 
202
  "temperature": 0.6,
203
  "max_tokens": 512
204
  }'
 
206
 
207
  ---
208
 
209
+ ## πŸ“Š Performance Reference
210
 
211
+ | Stage | Measured |
212
+ | :--- | ---: |
213
+ | Decode (ROCmFPX + DSpark q=4, top-k 4) | **32.0 tok/s** |
214
+ | Decode (ROCmFPX autoregressive) | 25.3 tok/s |
215
+ | Sparse prefill (indexed, 8K) | **~250 tok/s** |
216
+ | Exact prefill (short prompts) | 22.5–23 tok/s |
217
 
218
+ *Measured July 2026 on Ryzen AI MAX+ 395, ROCm 7.2.4, Radeon `high` (2.9 GHz), context 8,192, temp 0.*
219
+
220
+ ---
221
+
222
+ ## ❓ Troubleshooting
223
+
224
+ | Problem | Fix |
225
  | :--- | :--- |
226
+ | `raw KV batch store failed` | Set `DS4_ROCM_STREAM_MODEL_CACHE_GB=48` and pass `--ssd-streaming` |
227
+ | `pageable-memory access disabled` | `sudo amd-ttm --set-pages 8126464` or `DS4_ROCM_TTM_AUTORAISE=1` |
228
+ | Garbage output | Use `--think` (or `temperature: 0.6`) so DeepSeek reasoning format is respected |
229
+ | `missing gfx1151` | Build with `make strix-halo`; ensure ROCm 7.2.x |
230
+ | rocWMMA header errors | Install the matching `rocwmma` tree (step 2) |
231
 
232
  ---
233
 
234
+ ## πŸ“š Documentation
235
 
236
  | Document | Description |
237
  | :--- | :--- |
238
  | [STRIXHALO.md](STRIXHALO.md) | ROCm install, GRUB params, TTM priority, hardware notes |
239
  | [FORK_NOTES.md](FORK_NOTES.md) | Audit of what was retained/rejected from upstream |
240
 
241
+ ## 🀝 Acknowledgements
242
 
243
+ DeepSeek V4 Flash Β· [antirez/ds4](https://github.com/antirez/ds4) Β· [Lucebox / ROCmFPX](https://github.com/Luce-Org/lucebox) Β· [llama.cpp / GGML](https://github.com/ggml-org/llama.cpp) Β· [tekosML](https://huggingface.co/tekosML)
244
 
245
+ *Local AI should be the default, not a privilege.*