Views
No views yet
tid2eid routing tensors (issues #24591, #25598, labeled wontfix).patches/, build llama.cpp with CUDA, run with --tensor-split 1,1 --split-mode layer. See instructions below.| File | Size | BPW | Max Context (96GB VRAM) | Speed (2x RTX 4090 48GB) |
|---|---|---|---|---|
DSV4-Flash-162B-REAP-Q2_K.gguf | 56 GB | ~2.96 | 200K | 28-29 tok/s |
DSV4-Flash-162B-REAP-Q3_K_M.gguf | 73 GB | ~3.74 | 128K (Q4 KV) | ~13 tok/s |
tid2eid routing tensors. Stock llama.cpp crashes after 2-3 prompts with:CUDA error: illegal memory accessmmid.cuggml/src/ggml-cuda/mmid.cumm_ids_helper kernel uses warp_reduce_any which only checks if ANY thread in the warp matched. When the same expert appears twice for one token (as REAP does), multiple threads try to write to the same memory slot, causing a race condition and illegal memory access.warp_reduce_any with a warp-level prefix sum (inclusive scan). This:store arrayn_expert_used_template == 0): Uses full-warp prefix sumneu_padded grouppatches/mmid.cu in this repo. The unified diff is in patches/mmid.cu.patch.src/llama-quant.cpptid2eid tensors are i32 type and cannot be dequantized, causing:llama_model_quantize: failed to quantize: cannot dequantize/convert tensor type i32tensor_allows_quantization():1// do not quantize i32 routing tensors (DeepSeek V4 tid2eid)
2quantize &= name.find("tid2eid") == std::string::npos;patches/llama-quant.cpp.patch.1# 1. Clone llama.cpp (latest version)
2git clone https://github.com/ggml-org/llama.cpp.git
3cd llama.cpp
4
5# 2. Copy patched files over the originals
6# Download mmid.cu and llama-quant.cpp from the patches/ folder in this repo
7cp mmid.cu ggml/src/ggml-cuda/mmid.cu
8cp llama-quant.cpp src/llama-quant.cpp
9
10# 3. Build with CUDA
11# Adjust CUDA_ARCHITECTURES for your GPU:
12# 89 = RTX 4090 (Ada)
13# 86 = RTX 3090 (Ampere)
14# 90 = H100 (Hopper)
15mkdir build && cd build
16cmake .. -DGGML_CUDA=ON \
17 -DCMAKE_CUDA_ARCHITECTURES=89 \
18 -DCMAKE_BUILD_TYPE=Release \
19 -DLLAMA_BUILD_TESTS=OFF \
20 -DLLAMA_BUILD_EXAMPLES=OFF
21cmake --build . -j$(nproc) --target llama-server llama-quantize1./build/bin/llama-server \
2 --model DSV4-Flash-162B-REAP-Q2_K.gguf \
3 --ctx-size 204800 \
4 --n-gpu-layers 99 \
5 --tensor-split 1,1 \
6 --split-mode layer \
7 --cache-type-k q4_0 --cache-type-v q4_0 \
8 --port 8032 --host 0.0.0.0 \
9 -t 8 --parallel 1 -fa on1./build/bin/llama-server \
2 --model DSV4-Flash-162B-REAP-Q3_K_M.gguf \
3 --ctx-size 131072 \
4 --n-gpu-layers 99 \
5 --tensor-split 1,1 \
6 --split-mode layer \
7 --cache-type-k q4_0 --cache-type-v q4_0 \
8 --port 8032 --host 0.0.0.0 \
9 -t 8 --parallel 1 -fa on| Config | Context | Speed | Stability | VRAM |
|---|---|---|---|---|
| Q2_K + Q4 KV | 200K | 28-29 tok/s | 8/8 tests passed | 88 GB |
| Q3_K_M + Q4 KV | 128K | ~13 tok/s | Crashed after 1 prompt | 95.9 GB |
--tensor-split 1,1 --split-mode layer to distribute across 2 GPUs