Upload README.md with huggingface_hub
Browse files
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>
|
| 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 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 29 |
|
| 30 |
-
|
| 31 |
|
| 32 |
---
|
| 33 |
|
| 34 |
-
## What
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 35 |
|
| 36 |
-
The
|
| 37 |
|
| 38 |
-
|
| 39 |
-
|
| 40 |
-
|
| 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 |
-
|
| 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 |
-
###
|
| 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 |
-
|
| 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 |
-
|
| 54 |
-
|
|
|
|
| 55 |
|
| 56 |
---
|
| 57 |
|
| 58 |
-
##
|
| 59 |
|
| 60 |
-
|
| 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 |
-
###
|
|
|
|
| 67 |
|
| 68 |
-
|
|
|
|
|
|
|
|
|
|
| 69 |
|
| 70 |
-
|
| 71 |
-
|
| 72 |
|
| 73 |
-
|
| 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 |
-
##
|
| 85 |
|
| 86 |
-
###
|
|
|
|
|
|
|
| 87 |
|
| 88 |
```sh
|
| 89 |
-
|
| 90 |
-
|
|
|
|
| 91 |
```
|
| 92 |
|
| 93 |
-
###
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 94 |
|
| 95 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 96 |
|
| 97 |
```sh
|
| 98 |
-
|
|
|
|
|
|
|
| 99 |
```
|
| 100 |
|
| 101 |
-
|
| 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 |
-
###
|
| 118 |
|
| 119 |
```sh
|
| 120 |
make strix-halo -j"$(nproc)"
|
|
|
|
| 121 |
```
|
| 122 |
|
| 123 |
-
|
| 124 |
|
| 125 |
-
|
| 126 |
|
| 127 |
-
```sh
|
| 128 |
-
make rocm-doctor
|
| 129 |
```
|
| 130 |
-
|
| 131 |
-
|
| 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 |
-
###
|
| 154 |
|
| 155 |
-
|
| 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 |
-
|
| 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 |
-
##
|
| 192 |
|
| 193 |
-
|
|
| 194 |
-
| :--- |
|
| 195 |
-
|
|
| 196 |
-
|
|
| 197 |
-
|
|
| 198 |
-
|
|
| 199 |
|
| 200 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 201 |
| :--- | :--- |
|
| 202 |
-
|
|
| 203 |
-
|
|
| 204 |
-
|
|
|
|
|
|
|
|
| 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 |
-
|
| 218 |
|
| 219 |
-
|
|
|
|
| 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.*
|