ds4 icon indicating copy to clipboard operation
ds4 copied to clipboard

Multi-GPU for nvidia

Open vacekj opened this issue 6 months ago • 29 comments

Any interest in implementing multi-gpu CUDA setups? I have a 4x3090 + 128GB RAM I would love to use with these quants, since other quants are currently lacking in accuracy or just straight up don't exist.

vacekj avatar May 13 '26 21:05 vacekj

Hi, general interest, yes. Ability to help, no because of lack of the hardware. Interested in trying this with Metal: yes, once new hardware arrives (a couple of weeks hopefully). So I believe would be great to know the results you get and decide if we can merge it. Thanks.

antirez avatar May 14 '26 15:05 antirez

Possibly related https://github.com/antirez/ds4/issues/108, it's practically unusable (or with small context for 1 user) on RTX6K, any ideas?

d3y4n avatar May 15 '26 18:05 d3y4n

My use case is for multi-gpu inference is the DGX Spark x4 ring topology with CX7 cable with theoretical speed 200 Gbs (I have measured 198 Gbs). Available for testing this feature!

loretoparisi avatar May 23 '26 18:05 loretoparisi

Hi, general interest, yes. Ability to help, no because of lack of the hardware. Interested in trying this with Metal: yes, once new hardware arrives (a couple of weeks hopefully). So I believe would be great to know the results you get and decide if we can merge it. Thanks.

I would love to get this working for metal. I can both contribute code and possiably test.

CobraSoftware avatar May 28 '26 02:05 CobraSoftware

Hey everyone, I've been working on getting a multi-gpu setup running with my dual Nvidia box (two A6000 ada with 48GB each). This is very much a WIP and I won't open any PRs until we know it works (both correct and performant) on multiple gpu setups.

I'm at the stage where I can share and hopefully get some help with other configurations. Here's the deets (some AI produced text for better formatting):

The pipeline is wired end-to-end on my fork at https://github.com/cchuter/ds4 — single-tier behavior is bit-equivalent to upstream, GPU-only multi-tier placements run, and --gpu-vram 44,44 produces real numbers on my 2× RTX 6000 Ada box.

I'm hitting two reproducible bugs that I'd love eyes on from other people with multi-GPU NVIDIA boxes. The biggest single thing slowing this down is having only one piece of hardware to test against.

TL;DR

What Multi-GPU pipeline-parallel for DeepSeek-V4-Flash, GPU-only execution path
Fork cchuter/ds4 main
Works 44,44 GiB split across 2 GPUs at sm_89 (Ada) — ~225 tok/s prefill, ~37 tok/s gen
Bug 1 session_create OOM with larger budgets (47/47, auto) even when weights fit
Bug 2 cudaMemcpyPeer flakiness on RTX 6000 Ada — flickers DIRECT ↔ BOUNCE between runs
Need Reproduce on different GPU pairs (NVLink, Ampere, Hopper); measure deltas

Bench numbers (mine)

Model: DeepSeek-V4-Flash-IQ2XXS (~80 GiB on disk), 2× RTX 6000 Ada (48 GiB each, PCIe NODE topology, no NVLink), driver 570.207, CUDA 12.

config        ctx   prefill_tps   gen_tps   kv_cache
--gpu-vram 0  2048         1.94      1.59    -
--gpu-vram 44,44 2048    225.00     37.85    52 MB
--gpu-vram 44,44 4096    219.50     37.14    80 MB
--gpu-vram 44,44 6144    219.36     37.13   109 MB
--gpu-vram 44,44 8192    218.17     36.22   137 MB

~116× speedup on prefill, ~24× on gen, throughput essentially flat across context size up to 8K. Layout:

multi-GPU layout:
  GPU0: layers 0-21 + embedding         (41.6 / 44.0 GB)
  GPU1: layers 22-42 + output head      (39.4 / 44.0 GB)
ds4: peer access matrix (validated): 0->1 BOUNCE 1->0 BOUNCE

(Peer access falls back to a pinned-host bounce buffer here because of bug 2 below.)

Bug 1 — session_create OOM at "obviously fits" budgets

--gpu-vram 47,47 and --gpu-vram auto both place the entire model successfully (model + cache log shows ~80 GiB registered, layout printed with several GiB slack per device), then the session_create call OOMs allocating the KV cache for ctx=4096:

multi-GPU layout:
  GPU0: layers 0-23 + embedding       (45.3 / 47.0 GB)
  GPU1: layers 24-42 + output head    (35.7 / 47.0 GB)
ds4: CUDA (no-copy) registered 80.76 GiB model mapping for multi-tier selective cache
ds4: CUDA tensor alloc failed: out of memory
ds4: CUDA tensor alloc failed: out of memory
... (×many)
ds4-bench: failed to create session

KV cache for ctx=4096 × 43 layers shouldn't need >10 GB. Single-tier engine in the same --ctx-max 4096 config initializes fine. Something in the multi-tier per-layer KV allocation is over-allocating or not respecting the device budget after weight upload. Suspected files: ds4.c around ds4_session_create graph allocation walking the placement table.

Bug 2 — cudaMemcpyPeer flakiness on RTX 6000 Ada

The runtime validation we put in ds4_gpu_init_multi flickers between DIRECT and BOUNCE on the same hardware minutes apart. Same driver (570.207), same workload state. Multi-size probe (4 KiB / 256 KiB / 1 MiB / 16 MiB × 4 iters) correctly catches both states and falls back to a pinned-host bounce buffer when validation fails — but the underlying driver behavior is genuinely non-deterministic. This might be a driver bug.

I'd love to know whether other Ada / Ampere / Hopper pairs show the same flicker or are deterministic.

What I'm asking for

If you have any multi-GPU NVIDIA box (even mismatched cards), please:

  1. Pull the fork and build (instructions below).
  2. Try ds4-bench --gpu-vram 44,44 (adjust to your VRAM) — does it produce numbers? What's prefill / gen tok/s?
  3. Try ds4-bench --gpu-vram auto — does it OOM during session_create like mine, or does it run cleanly?
  4. Check the peer-access log line at init — DIRECT or BOUNCE?
  5. Report your card model, driver version, and CUDA version.

Configurations of particular interest:

  • NVLink-bridged pairs (would the OOM disappear with peer DIRECT working reliably?)
  • A6000 / RTX 6000 Ada (do they all show the peer flicker?)
  • H100 (does this behave entirely differently?)

Build and run

Prerequisites

  • Linux box
  • NVIDIA driver supporting your target compute capability
  • CUDA toolkit (12.x verified)
  • gcc, make
  • A DeepSeek-V4-Flash GGUF (IQ2XXS is the smallest at ~80 GiB; needs both GPUs combined ≥ ~85 GiB available)

Clone

git clone https://github.com/cchuter/ds4
cd ds4

Build with CUDA

Replace sm_89 with your card's compute capability (sm_75 Turing, sm_80 A100, sm_86 A6000/3090, sm_89 Ada/4090/RTX 6000 Ada, sm_90 H100):

# If CUDA is at /usr/local/cuda (standard):
make cuda CUDA_ARCH=sm_89 -j4

# If CUDA is at /usr/lib/cuda (Debian / Ubuntu apt):
CUDA_HOME=/usr/lib/cuda make cuda CUDA_ARCH=sm_89 -j4

This produces ds4-cli, ds4-bench, ds4-server, ds4-agent, ds4-eval.

Download a model

If you don't have a DeepSeek-V4-Flash GGUF, see download_model.sh in the repo or the upstream README. The IQ2XXS variant is what these instructions assume:

DeepSeek-V4-Flash-IQ2XXS-w2Q2K-AProjQ8-SExpQ8-OutQ8-chat-v2-imatrix.gguf

It's ~80 GiB. Higher quants exist but won't fit two 48 GiB GPUs.

Run the bench

Single-GPU baseline (does not fit IQ2XXS at 48 GiB; useful only for smaller quants):

./ds4-bench \
    --prompt-file tests/long_context_story_prompt.txt \
    -m /path/to/DeepSeek-V4-Flash-IQ2XXS-...gguf \
    --cuda --gpu-vram 48 \
    --ctx-start 2048 --ctx-max 8192 --gen-tokens 64

The configuration that works for me (please try and report deltas):

./ds4-bench \
    --prompt-file tests/long_context_story_prompt.txt \
    -m /path/to/DeepSeek-V4-Flash-IQ2XXS-...gguf \
    --cuda --gpu-vram 44,44 \
    --ctx-start 2048 --ctx-max 8192 --gen-tokens 64

Auto-detect (reproduces bug 1 for me):

./ds4-bench \
    --prompt-file tests/long_context_story_prompt.txt \
    -m /path/to/DeepSeek-V4-Flash-IQ2XXS-...gguf \
    --cuda --gpu-vram auto \
    --ctx-start 2048 --ctx-max 8192 --gen-tokens 64

CPU baseline for comparison:

./ds4-bench \
    --prompt-file tests/long_context_story_prompt.txt \
    -m /path/to/DeepSeek-V4-Flash-IQ2XXS-...gguf \
    --cuda --gpu-vram 0 \
    --ctx-start 2048 --ctx-max 2048 --gen-tokens 64

Run the server on multiple GPUs

ds4-server accepts the same --gpu-vram and --gpu-devices flags:

./ds4-server \
    -m /path/to/DeepSeek-V4-Flash-IQ2XXS-...gguf \
    --cuda --gpu-vram 44,44 \
    --host 127.0.0.1 --port 8080 \
    --ctx 8192 --tokens 4096 \
    --warm-weights

To restrict to specific devices:

./ds4-server -m ... --cuda --gpu-vram auto --gpu-devices 0,2 --host 127.0.0.1 --port 8080

OpenAI-compatible chat endpoint available at http://127.0.0.1:8080/v1/chat/completions once it logs multi-GPU layout: and (for non-multi-tier paths) backend initialized for graph diagnostics.

What output to capture in a reply

Paste:

  1. Output of nvidia-smi -L
  2. Driver + CUDA version (nvcc --version, nvidia-smi | head -3)
  3. The bench output for --gpu-vram <your-split>
  4. The bench output for --gpu-vram auto (whether it OOMs or runs)
  5. The peer-access log line from the init: ds4: peer access matrix (validated): 0->1 ... 1->0 ...

Other things to know

  • If your combined VRAM doesn't fit your chosen quant, the engine cleanly refuses rather than silently falling back.
  • MTP (multi-token prediction) is disabled in multi-tier mode for now.

Thanks for any cycles you can throw at this — multi-GPU testing across actually-different hardware is the unblock.

And megathanks to @antirez for making this awesome project.

cchuter avatar May 28 '26 18:05 cchuter

  1. nvidia-smi -L GPU 0: NVIDIA GeForce RTX 3090 (UUID: GPU-a3c6762e-0665-e520-cc7a-254d2312fea6) GPU 1: NVIDIA GeForce RTX 3090 (UUID: GPU-36eb7bab-a061-4d3d-3b24-80b9cc3caa3b) GPU 2: NVIDIA GeForce RTX 3090 (UUID: GPU-128c29f6-21a5-f1d0-30a3-9ba4c93a36ff) GPU 3: NVIDIA GeForce RTX 3090 (UUID: GPU-cf89a9a9-2a24-2f94-769b-21a2132090b0) GPU 4: NVIDIA GeForce RTX 3090 (UUID: GPU-fc27b972-e42c-45a5-ba56-05f53437e2d2) GPU 5: NVIDIA GeForce RTX 3090 (UUID: GPU-0dcc633e-ae65-65cd-da0a-794a03226237) GPU 6: NVIDIA GeForce RTX 3090 (UUID: GPU-d8f62de0-f4a0-aaf5-7ce6-ec5869768ec2) GPU 7: NVIDIA GeForce RTX 3090 (UUID: GPU-250d22bd-5117-b0ec-8993-188409d175d6) *no NVLINK

  2. nvcc --version nvcc: NVIDIA (R) Cuda compiler driver Copyright (c) 2005-2025 NVIDIA Corporation Built on Fri_Nov__7_07:23:37_PM_PST_2025 Cuda compilation tools, release 13.1, V13.1.80 Build cuda_13.1.r13.1/compiler.36836380_0

  3. nvidia-smi | head -3 +-----------------------------------------------------------------------------------------+ | NVIDIA-SMI 580.142 Driver Version: 580.142 CUDA Version: 13.0 |

  4. ds4-bench: context buffers 365.60 MiB (ctx=8257, backend=cuda, prefill_chunk=4096, raw_kv_rows=4352, compressed_kv_rows=3) ds4: GPU config: 8 devices [0,1,2,3,4,5,6,7] requested, budgets 12,12,12,12,12,12,12,12 GB; auto=false ds4: CUDA backend initialized on NVIDIA GeForce RTX 3090 (sm_86) dev=0 ds4: CUDA backend initialized on NVIDIA GeForce RTX 3090 (sm_86) dev=1 ds4: CUDA backend initialized on NVIDIA GeForce RTX 3090 (sm_86) dev=2 ds4: CUDA backend initialized on NVIDIA GeForce RTX 3090 (sm_86) dev=3 ds4: CUDA backend initialized on NVIDIA GeForce RTX 3090 (sm_86) dev=4 ds4: CUDA backend initialized on NVIDIA GeForce RTX 3090 (sm_86) dev=5 ds4: CUDA backend initialized on NVIDIA GeForce RTX 3090 (sm_86) dev=6 ds4: CUDA backend initialized on NVIDIA GeForce RTX 3090 (sm_86) dev=7 multi-GPU layout: GPU0: layers 0-4 + embedding (10.2 / 12.0 GB) GPU1: layers 5-10 (11.1 / 12.0 GB) GPU2: layers 11-16 (11.1 / 12.0 GB) GPU3: layers 17-22 (11.1 / 12.0 GB) GPU4: layers 23-28 (11.1 / 12.0 GB) GPU5: layers 29-34 (11.1 / 12.0 GB) GPU6: layers 35-40 (11.1 / 12.0 GB) GPU7: layers 41-42 + output head (4.2 / 12.0 GB) ds4: peer access matrix (validated): 0->1 BOUNCE 0->2 BOUNCE 0->3 BOUNCE 0->4 BOUNCE 0->5 BOUNCE 0->6 BOUNCE 0->7 BOUNCE 1->0 BOUNCE 1->2 BOUNCE 1->3 BOUNCE 1->4 BOUNCE 1->5 BOUNCE 1->6 BOUNCE 1->7 BOUNCE 2->0 BOUNCE 2->1 BOUNCE 2->3 BOUNCE 2->4 BOUNCE 2->5 BOUNCE 2->6 BOUNCE 2->7 BOUNCE 3->0 BOUNCE 3->1 BOUNCE 3->2 BOUNCE 3->4 BOUNCE 3->5 BOUNCE 3->6 BOUNCE 3->7 BOUNCE 4->0 BOUNCE 4->1 BOUNCE 4->2 BOUNCE 4->3 BOUNCE 4->5 BOUNCE 4->6 BOUNCE 4->7 BOUNCE 5->0 BOUNCE 5->1 BOUNCE 5->2 BOUNCE 5->3 BOUNCE 5->4 BOUNCE 5->6 BOUNCE 5->7 BOUNCE 6->0 BOUNCE 6->1 BOUNCE 6->2 BOUNCE 6->3 BOUNCE 6->4 BOUNCE 6->5 BOUNCE 6->7 BOUNCE 7->0 BOUNCE 7->1 BOUNCE 7->2 BOUNCE 7->3 BOUNCE 7->4 BOUNCE 7->5 BOUNCE 7->6 BOUNCE ds4: CUDA (no-copy) host registration skipped: OS call failed or operation not supported on this OS ctx_tokens,prefill_tokens,prefill_tps,gen_tokens,gen_tps,kvcache_bytes 2048,2048,390.64,64,26.42,52184460 4096,2048,367.99,64,25.57,80373132 6144,2048,365.77,64,25.57,108561804 8192,2048,363.37,64,24.86,136750476

  5. With --gpu-vram auto it OOMs

DoktorMincs avatar May 29 '26 03:05 DoktorMincs

Thanks so much for testing this out for me and nice setup. You're getting about 25 tokens/sec generation. (with a lot of bounces ;)

I have a fix for --gpu-vram auto (not extensively tested) that you can pull down:

git clone -b feat/mgpu-auto-vram-fix --single-branch https://github.com/cchuter/ds4.git

or

git fetch origin feat/mgpu-auto-vram-fix
git switch feat/mgpu-auto-vram-fix

you can also give setups like --gpu-vram 23,23,23,23 a shot to see if performance improves (I have some ideas on getting up to 2x performance, but I'm just trying to get it working right now - mtp should be a huge win)

cchuter avatar May 29 '26 03:05 cchuter

Any interest in implementing multi-gpu CUDA setups? I have a 4x3090 + 128GB RAM I would love to use with these quants, since other quants are currently lacking in accuracy or just straight up don't exist.

I’m in a scenario similar to yours: 2x A40 (48 GB each) on a single server. Since multi-GPU support is not available, I tried running two DS4 instances — one acting as coordinator and the other as a worker — both pointing to localhost.

It’s not elegant, but it could have enabled local parallelization… except that two DS4 instances cannot run on the same host.

It would be great if this limitation could be addressed.

EDIT18:57 GMT+2: By inserting a return; immediately after entering the ds4_acquire_instance_lock function in order to bypass it, I was able to run two instances on the same server in worker–coordinator mode.

The q2-q4-imatrix model does not fit within two A40 GPUs, so I added a third server connected over 25 Gbit Ethernet (average ping latency is around 0.035 ms) with two additional A40s, splitting the model as follows:

  • Server A

    • Layers 0:15
    • Layers 16:31
  • Server B

    • Layers 32:output

The benchmark was executed with the following parameters:

./ds4-bench \
  --prompt-file speed-bench/promessi_sposi.txt \
  --ctx-start 2048 \
  --ctx-max 32000 \
  --step-incr 2048 \
  --gen-tokens 128

Performance results:

  • ~440 TPS during prefill
  • ~21 TPS during generation

The benchmark crashed during the sixth iteration with the following error:

ds4-bench: distributed replay restore at 14336 failed:
distributed worker closed connection

In any case… it works!

egiorno avatar Jun 04 '26 11:06 egiorno

Any interest in implementing multi-gpu CUDA setups? I have a 4x3090 + 128GB RAM I would love to use with these quants, since other quants are currently lacking in accuracy or just straight up don't exist.

I’m in a scenario similar to yours: 2x A40 (48 GB each) on a single server. Since multi-GPU support is not available, I tried running two DS4 instances — one acting as coordinator and the other as a worker — both pointing to localhost.

It’s not elegant, but it could have enabled local parallelization… except that two DS4 instances cannot run on the same host.

It would be great if this limitation could be addressed.

EDIT18:57 GMT+2: By inserting a return; immediately after entering the ds4_acquire_instance_lock function in order to bypass it, I was able to run two instances on the same server in worker–coordinator mode.

The q2-q4-imatrix model does not fit within two A40 GPUs, so I added a third server connected over 25 Gbit Ethernet (average ping latency is around 0.035 ms) with two additional A40s, splitting the model as follows:

  • Server A

    • Layers 0:15
    • Layers 16:31
  • Server B

    • Layers 32:output

The benchmark was executed with the following parameters:

./ds4-bench
--prompt-file speed-bench/promessi_sposi.txt
--ctx-start 2048
--ctx-max 32000
--step-incr 2048
--gen-tokens 128 Performance results:

  • ~440 TPS during prefill
  • ~21 TPS during generation

The benchmark crashed during the sixth iteration with the following error:

ds4-bench: distributed replay restore at 14336 failed:
distributed worker closed connection

In any case… it works!

I used to run multi vender GPU on the same machine using basically this but with RPC using llamacpp(not saying the underlying is equal but the process of running two servers on same machine, one for rocm and one for cuda). I tried to ruin two DS4 on the same machine but I was block by the already running message.

JsThiago avatar Jun 06 '26 16:06 JsThiago

I used to run multi vender GPU on the same machine using basically this but with RPC using llamacpp(not saying the underlying is equal but the process of running two servers on same machine, one for rocm and one for cuda). I tried to ruin two DS4 on the same machine but I was block by the already running message.

edit ds4.c and insert "return;" immediately after entering the ds4_acquire_instance_lock function and compile again. This way you can bypass the check of already running instance. --- not elegant ;) ---

egiorno avatar Jun 07 '26 08:06 egiorno

I've made a local tag of my fork that has multi-gpu support for cuda devices: https://github.com/cchuter/ds4/releases/tag/mgpu-v0.1.0

It's still a WIP, but I was able to get a complete terminal-bench run with it:

┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━┓
┃ Metric                         ┃ Value          ┃
┡━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━┩
│ Agent                          │ terminus-2-ds4 │
│ Dataset                        │ terminal-bench │
│ Trials                         │ 87             │
│ Errors                         │ 36             │
│                                │                │
│ Mean                           │ 0.404          │
│                                │                │
│ Reward Distribution            │                │
│   reward = 0.0                 │ 51             │
│   reward = 1.0                 │ 36             │
│                                │                │
│ Exception Distribution         │                │
│   AgentTimeoutError            │ 34             │
│   RuntimeError                 │ 1              │
│   EnvironmentStartTimeoutError │ 1              │
└────────────────────────────────┴────────────────┘

This is actually quite good (with a under 90GB Q2 quant!). Most failures are timeouts (this is very common with local inference).

I ran the same harness with DeepSeek API (cost around $5) and was only able to achieve a Mean of a little over ~.5.

I have no idea how they're getting the numbers they report in their published papers (Above .6).

Here's how I ran ther server:

ds4-server --cuda --gpu-vram 47,47 \
    -m gguf/DeepSeek-V4-Flash-IQ2XXS-w2Q2K-AProjQ8-SExpQ8-OutQ8-chat-v2-imatrix.gguf \
    --host 0.0.0.0 --port 8080 \
    --ctx 131072 --tokens 8192 \
    --prefill-chunk 2048 \
    --kv-disk-dir ~/.ds4/server-kv --kv-disk-space-mb 8192 \
    --warm-weights

I have a dual A6000 Ada box - each gpu has 48GB VRAM

To get the code and run it:

git clone --branch mgpu-v0.1.0 --depth 1 https://github.com/cchuter/ds4.git

I'm trying to get the latest upstream changes integrated, but I have been unsuccessful - The cuda and underlying server code has had many changes! This project moves fast, @anitrez - If I can ever figure that out, I'll make a PR.

In the meantime, here's a multi-gpu version of ds4 that you can use for agentic coding that works quite well. I average 35-40 token/s generation.

I also have detailed info on how i did the performance enhancements for cuda (nsys process)- +10% token generation and +20% prefill - if anyone is interested.

cchuter avatar Jun 10 '26 15:06 cchuter

Thanks for your work on this @cchuter, I've been really wanting to get ds4 running locally!

Tested on Arch Linux with 8 x RTX 3090, and 128GB system RAM. No NVLink. Unfortunately, I'm not having any success getting https://github.com/cchuter/ds4/releases/tag/mgpu-v0.1.0 working with either ds4-server, or ds4-bench. It builds, and starts up ok, but fails on the first request.

System information

nvidia-smi -L                                                                                                                                                                                                                                                                                                                                     
GPU 0: NVIDIA GeForce RTX 3090 (UUID: GPU-1c8bee46-0eb8-ac8c-0030-36a9084843e1)
GPU 1: NVIDIA GeForce RTX 3090 (UUID: GPU-ab464141-ee9d-9df1-0c0e-5c2448079715)
GPU 2: NVIDIA GeForce RTX 3090 (UUID: GPU-e4639dee-14a8-2d6d-7775-2a9923a45be7)
GPU 3: NVIDIA GeForce RTX 3090 (UUID: GPU-be7149a0-0937-2780-8729-64be95ad25b4)
GPU 4: NVIDIA GeForce RTX 3090 (UUID: GPU-2922d3be-cd90-3422-4de1-d37d408b07ba)
GPU 5: NVIDIA GeForce RTX 3090 (UUID: GPU-e7efd0e8-be45-c675-f82b-fa260bcd32e0)
GPU 6: NVIDIA GeForce RTX 3090 (UUID: GPU-934080c2-c2ae-655d-b0e2-7fb144dfe476)
GPU 7: NVIDIA GeForce RTX 3090 (UUID: GPU-f549f99d-35f4-8e29-e380-87700d47c03b)

nvcc --version                                                                                                                                                                                                                                                                                                                                    
nvcc: NVIDIA (R) Cuda compiler driver
Copyright (c) 2005-2026 NVIDIA Corporation
Built on Thu_Mar_19_11:12:51_PM_PDT_2026
Cuda compilation tools, release 13.2, V13.2.78
Build cuda_13.2.r13.2/compiler.37668154_0

nvidia-smi | head -3                                                                                                                                                                                                                                                                                                                              
Sun Jun 14 21:44:26 2026
+-----------------------------------------------------------------------------------------+
| NVIDIA-SMI 595.71.05              Driver Version: 595.71.05      CUDA Version: 13.2     |

Benchmarks

Manually set GPU

./ds4-bench \                                                                                                                                                                                                                                                                                                                                      HEAD [?]
    --prompt-file tests/long_context_story_prompt.txt \
    --model /home/hubby/ds4/gguf/DeepSeek-V4-Flash-Layers37-42Q4KExperts-OtherExpertLayersIQ2XXSGateUp-Q2KDown-AProjQ8-SExpQ8-OutQ8-chat-v2-imatrix-fixed.gguf \
    --cuda --gpu-vram 21,21,21,21,21,21,21,21 \
    --ctx-start 2048 --ctx-max 8192 --gen-tokens 64
ds4-bench: context buffers 365.60 MiB (ctx=8257, backend=cuda, prefill_chunk=4096, raw_kv_rows=4352, compressed_kv_rows=3)
ds4: GPU config: 8 devices [0,1,2,3,4,5,6,7] requested, budgets 21,21,21,21,21,21,21,21 GB; auto=false
ds4: CUDA backend initialized on NVIDIA GeForce RTX 3090 (sm_86) dev=0
ds4: CUDA backend initialized on NVIDIA GeForce RTX 3090 (sm_86) dev=1
ds4: CUDA backend initialized on NVIDIA GeForce RTX 3090 (sm_86) dev=2
ds4: CUDA backend initialized on NVIDIA GeForce RTX 3090 (sm_86) dev=3
ds4: CUDA backend initialized on NVIDIA GeForce RTX 3090 (sm_86) dev=4
ds4: CUDA backend initialized on NVIDIA GeForce RTX 3090 (sm_86) dev=5
ds4: CUDA backend initialized on NVIDIA GeForce RTX 3090 (sm_86) dev=6
ds4: CUDA backend initialized on NVIDIA GeForce RTX 3090 (sm_86) dev=7
multi-GPU layout:
  GPU0: layers 0-7 + embedding  (15.8 / 17.0 GB)
  GPU1: layers 8-15  (14.8 / 17.0 GB)
  GPU2: layers 16-23  (14.8 / 17.0 GB)
  GPU3: layers 24-31  (14.8 / 17.0 GB)
  GPU4: layers 32-38  (16.4 / 17.0 GB)
  GPU5: layers 39-42 + output head  (14.7 / 17.0 GB)
  GPU6: (no transformer layers)  (0.0 / 17.0 GB)
  GPU7: (no transformer layers)  (0.0 / 17.0 GB)
ds4: per-tier graph scratch reserved: 3.96 GiB (pre-subtracted from each GPU budget)
ds4: peer access matrix (validated): 0->1 BOUNCE 0->2 BOUNCE 0->3 BOUNCE 0->4 BOUNCE 0->5 BOUNCE 0->6 BOUNCE 0->7 BOUNCE 1->0 BOUNCE 1->2 BOUNCE 1->3 BOUNCE 1->4 BOUNCE 1->5 BOUNCE 1->6 BOUNCE 1->7 BOUNCE 2->0 BOUNCE 2->1 BOUNCE 2->3 BOUNCE 2->4 BOUNCE 2->5 BOUNCE 2->6 BOUNCE 2->7 BOUNCE 3->0 BOUNCE 3->1 BOUNCE 3->2 BOUNCE 3->4 BOUNCE 3->5 BOUNCE 3->6 BOUNCE 3->7 BOUNCE 4->0 BOUNCE 4->1 BOUNCE 4->2 BOUNCE 4->3 BOUNCE 4->5 BOUNCE 4->6 BOUNCE 4->7 BOUNCE 5->0 BOUNCE 5->1 BOUNCE 5->2 BOUNCE 5->3 BOUNCE 5->4 BOUNCE 5->6 BOUNCE 5->7 BOUNCE 6->0 BOUNCE 6->1 BOUNCE 6->2 BOUNCE 6->3 BOUNCE 6->4 BOUNCE 6->5 BOUNCE 6->7 BOUNCE 7->0 BOUNCE 7->1 BOUNCE 7->2 BOUNCE 7->3 BOUNCE 7->4 BOUNCE 7->5 BOUNCE 7->6 BOUNCE
ds4: CUDA (no-copy) host registration skipped: operation not supported
ctx_tokens,prefill_tokens,prefill_tps,gen_tokens,gen_tps,kvcache_bytes
ds4: CUDA q8 fp16 cache budget exhausted; using q8 kernels (request=8.00 MiB cached=0.00 GiB free=3.46 GiB reserve=4.00 GiB total=23.56 GiB)
ds4-bench: prefill to 2048 failed: cuda prefill failed

Automatically set GPU

./ds4-bench \                                                                                                                                                                                                                                                                                                                                      HEAD [?]
    --prompt-file tests/long_context_story_prompt.txt \
    --model /home/hubby/ds4/gguf/DeepSeek-V4-Flash-Layers37-42Q4KExperts-OtherExpertLayersIQ2XXSGateUp-Q2KDown-AProjQ8-SExpQ8-OutQ8-chat-v2-imatrix-fixed.gguf \
    --cuda --gpu-vram auto \
    --ctx-start 2048 --ctx-max 8192 --gen-tokens 64
ds4-bench: context buffers 365.60 MiB (ctx=8257, backend=cuda, prefill_chunk=4096, raw_kv_rows=4352, compressed_kv_rows=3)
ds4: GPU config: 8 devices [0,1,2,3,4,5,6,7] requested, budgets 21,21,21,21,21,21,21,21 GB; auto=true
ds4: CUDA backend initialized on NVIDIA GeForce RTX 3090 (sm_86) dev=0
ds4: CUDA backend initialized on NVIDIA GeForce RTX 3090 (sm_86) dev=1
ds4: CUDA backend initialized on NVIDIA GeForce RTX 3090 (sm_86) dev=2
ds4: CUDA backend initialized on NVIDIA GeForce RTX 3090 (sm_86) dev=3
ds4: CUDA backend initialized on NVIDIA GeForce RTX 3090 (sm_86) dev=4
ds4: CUDA backend initialized on NVIDIA GeForce RTX 3090 (sm_86) dev=5
ds4: CUDA backend initialized on NVIDIA GeForce RTX 3090 (sm_86) dev=6
ds4: CUDA backend initialized on NVIDIA GeForce RTX 3090 (sm_86) dev=7
multi-GPU layout:
  GPU0: layers 0-7 + embedding  (15.8 / 17.3 GB)
  GPU1: layers 8-16  (16.7 / 17.3 GB)
  GPU2: layers 17-25  (16.7 / 17.3 GB)
  GPU3: layers 26-34  (16.7 / 17.3 GB)
  GPU4: layers 35-39  (14.3 / 17.3 GB)
  GPU5: layers 40-42 + output head  (11.2 / 17.3 GB)
  GPU6: (no transformer layers)  (0.0 / 17.3 GB)
  GPU7: (no transformer layers)  (0.0 / 17.3 GB)
ds4: per-tier graph scratch reserved: 3.96 GiB (pre-subtracted from each GPU budget)
ds4: peer access matrix (validated): 0->1 BOUNCE 0->2 BOUNCE 0->3 BOUNCE 0->4 BOUNCE 0->5 BOUNCE 0->6 BOUNCE 0->7 BOUNCE 1->0 BOUNCE 1->2 BOUNCE 1->3 BOUNCE 1->4 BOUNCE 1->5 BOUNCE 1->6 BOUNCE 1->7 BOUNCE 2->0 BOUNCE 2->1 BOUNCE 2->3 BOUNCE 2->4 BOUNCE 2->5 BOUNCE 2->6 BOUNCE 2->7 BOUNCE 3->0 BOUNCE 3->1 BOUNCE 3->2 BOUNCE 3->4 BOUNCE 3->5 BOUNCE 3->6 BOUNCE 3->7 BOUNCE 4->0 BOUNCE 4->1 BOUNCE 4->2 BOUNCE 4->3 BOUNCE 4->5 BOUNCE 4->6 BOUNCE 4->7 BOUNCE 5->0 BOUNCE 5->1 BOUNCE 5->2 BOUNCE 5->3 BOUNCE 5->4 BOUNCE 5->6 BOUNCE 5->7 BOUNCE 6->0 BOUNCE 6->1 BOUNCE 6->2 BOUNCE 6->3 BOUNCE 6->4 BOUNCE 6->5 BOUNCE 6->7 BOUNCE 7->0 BOUNCE 7->1 BOUNCE 7->2 BOUNCE 7->3 BOUNCE 7->4 BOUNCE 7->5 BOUNCE 7->6 BOUNCE
ds4: CUDA (no-copy) host registration skipped: operation not supported
ctx_tokens,prefill_tokens,prefill_tps,gen_tokens,gen_tps,kvcache_bytes
ds4: CUDA q8 fp16 cache budget exhausted; using q8 kernels (request=8.00 MiB cached=0.00 GiB free=3.46 GiB reserve=4.00 GiB total=23.56 GiB)
ds4-bench: prefill to 2048 failed: cuda prefill failed

rmhubbert avatar Jun 14 '26 20:06 rmhubbert

Hmm, weird. I am using a similar setup, but with 6x3090:

CUDA_VISIBLE_DEVICES=0,1,2,4,5,6 ./ds4-bench --prompt-file tests/long_context_story_prompt.txt --model ds4flash.gguf --cuda --gpu-vram 21,21,21,21,21,21 --ctx-start 2048 --ctx-max 8192 --gen-tokens 64 ds4-bench: context buffers 365.60 MiB (ctx=8257, backend=cuda, prefill_chunk=4096, raw_kv_rows=4352, compressed_kv_rows=3) ds4: GPU config: 6 devices [0,1,2,3,4,5] requested, budgets 21,21,21,21,21,21 GB; auto=false ds4: CUDA backend initialized on NVIDIA GeForce RTX 3090 (sm_86) dev=0 ds4: CUDA backend initialized on NVIDIA GeForce RTX 3090 (sm_86) dev=1 ds4: CUDA backend initialized on NVIDIA GeForce RTX 3090 (sm_86) dev=2 ds4: CUDA backend initialized on NVIDIA GeForce RTX 3090 (sm_86) dev=3 ds4: CUDA backend initialized on NVIDIA GeForce RTX 3090 (sm_86) dev=4 ds4: CUDA backend initialized on NVIDIA GeForce RTX 3090 (sm_86) dev=5 multi-GPU layout: GPU0: layers 0-7 + embedding (15.8 / 17.0 GB) GPU1: layers 8-15 (14.8 / 17.0 GB) GPU2: layers 16-23 (14.8 / 17.0 GB) GPU3: layers 24-31 (14.8 / 17.0 GB) GPU4: layers 32-39 (14.8 / 17.0 GB) GPU5: layers 40-42 + output head (6.1 / 17.0 GB) ds4: per-tier graph scratch reserved: 3.96 GiB (pre-subtracted from each GPU budget) ds4: peer access matrix (validated): 0->1 BOUNCE 0->2 BOUNCE 0->3 BOUNCE 0->4 BOUNCE 0->5 BOUNCE 1->0 BOUNCE 1->2 BOUNCE 1->3 BOUNCE 1->4 BOUNCE 1->5 BOUNCE 2->0 BOUNCE 2->1 BOUNCE 2->3 BOUNCE 2->4 BOUNCE 2->5 BOUNCE 3->0 BOUNCE 3->1 BOUNCE 3->2 BOUNCE 3->4 BOUNCE 3->5 BOUNCE 4->0 BOUNCE 4->1 BOUNCE 4->2 BOUNCE 4->3 BOUNCE 4->5 BOUNCE 5->0 BOUNCE 5->1 BOUNCE 5->2 BOUNCE 5->3 BOUNCE 5->4 BOUNCE ds4: CUDA (no-copy) registered 80.77 GiB model mapping for multi-tier selective cache ctx_tokens,prefill_tokens,prefill_tps,gen_tokens,gen_tps,kvcache_bytes ds4: CUDA q8 fp16 cache budget exhausted; using q8 kernels (request=8.00 MiB cached=0.00 GiB free=3.31 GiB reserve=4.00 GiB total=23.56 GiB) 2048,2048,107.31,64,25.57,52184460 4096,2048,105.64,64,24.74,80373132 6144,2048,105.74,64,24.70,108561804 8192,2048,105.43,64,24.05,136750476

I am skipping GPU3, because that is a GTX 2080ti (still, soon to be replaced by a 3090). And i am using a different LLM: cyberneurova-DeepSeek-V4-Flash-abliterated-IQ2XXS-w2Q2K-AProjQ8-SExpQ8-OutQ8-chat-v2-imatrix-aligned.gguf

For, ehh, science :) I had the same error you got (cuda prefill failed) with some other LLM (Also an abliterated, but without the 'w2Q2K-AProjQ8-SExpQ8-OutQ8' part)

GirlPower68 avatar Jun 14 '26 22:06 GirlPower68

Interesting, thanks @GirlPower68! I tried just using the exact same command as yourself, in case that helped, but no luck there.

I also tried different CUDA versions, namely 13.1, 13.2, and 13.3 to see if that might help, but no luck there either.

I'll try that model you mentioned and report back.

rmhubbert avatar Jun 15 '26 16:06 rmhubbert

Ok, progress! No idea why, but I can get it working when using the model @GirlPower68 suggested, namely - audreyt/CyberNeurova-DeepSeek-V4-Flash-abliterated-GGUF

Prefill is slow, but it works, which is amazing!

@antirez / @cchuter, let me know if I can help with any testing needing done. As I mentioned before, I have an 8x RTX 3090 rig and would love to help get this model running for folks with more budget minded set ups like myself, especially since vLLM have explicitly said they won't be doing Ampere support.

ds4: GPU config: 8 devices [0,1,2,3,4,5,6,7] requested, budgets 23,23,23,23,23,23,23,23 GB; auto=false
ds4: CUDA backend initialized on NVIDIA GeForce RTX 3090 (sm_86) dev=0
ds4: CUDA backend initialized on NVIDIA GeForce RTX 3090 (sm_86) dev=1
ds4: CUDA backend initialized on NVIDIA GeForce RTX 3090 (sm_86) dev=2
ds4: CUDA backend initialized on NVIDIA GeForce RTX 3090 (sm_86) dev=3
ds4: CUDA backend initialized on NVIDIA GeForce RTX 3090 (sm_86) dev=4
ds4: CUDA backend initialized on NVIDIA GeForce RTX 3090 (sm_86) dev=5
ds4: CUDA backend initialized on NVIDIA GeForce RTX 3090 (sm_86) dev=6
ds4: CUDA backend initialized on NVIDIA GeForce RTX 3090 (sm_86) dev=7
multi-GPU layout:
  GPU0: layers 0-7 + embedding  (16.2 / 17.1 GB)
  GPU1: layers 8-15  (15.5 / 17.1 GB)
  GPU2: layers 16-23  (15.5 / 17.1 GB)
  GPU3: layers 24-31  (15.5 / 17.1 GB)
  GPU4: layers 32-39  (15.5 / 17.1 GB)
  GPU5: layers 40-42 + output head  (6.4 / 17.1 GB)
  GPU6: (no transformer layers)  (0.0 / 17.1 GB)
  GPU7: (no transformer layers)  (0.0 / 17.1 GB)
ds4: per-tier graph scratch reserved: 5.89 GiB (pre-subtracted from each GPU budget)
ds4: peer access matrix (validated): 0->1 BOUNCE 0->2 BOUNCE 0->3 BOUNCE 0->4 BOUNCE 0->5 BOUNCE 0->6 BOUNCE 0->7 BOUNCE 1->0 BOUNCE 1->2 BOUNCE 1->3 BOUNCE 1->4 BOUNCE 1->5 BOUNCE 1->6 BOUNCE 1->7 BOUNCE 2->0 BOUNCE 2->1 BOUNCE 2->3 BOUNCE 2->4 BOUNCE 2->5 BOUNCE 2->6 BOUNCE 2->7 BOUNCE 3->0 BOUNCE 3->1 BOUNCE 3->2 BOUNCE 3->4 BOUNCE 3->5 BOUNCE 3->6 BOUNCE 3->7 BOUNCE 4->0 BOUNCE 4->1 BOUNCE 4->2 BOUNCE 4->3 BOUNCE 4->5 BOUNCE 4->6 BOUNCE 4->7 BOUNCE 5->0 BOUNCE 5->1 BOUNCE 5->2 BOUNCE 5->3 BOUNCE 5->4 BOUNCE 5->6 BOUNCE 5->7 BOUNCE 6->0 BOUNCE 6->1 BOUNCE 6->2 BOUNCE 6->3 BOUNCE 6->4 BOUNCE 6->5 BOUNCE 6->7 BOUNCE 7->0 BOUNCE 7->1 BOUNCE 7->2 BOUNCE 7->3 BOUNCE 7->4 BOUNCE 7->5 BOUNCE 7->6 BOUNCE
ds4: CUDA (no-copy) host registration skipped: operation not supported
0615 22:03:22 ds4-server: context buffers 5855.75 MiB (ctx=262144, backend=cuda, prefill_chunk=4096, raw_kv_rows=4352, compressed_kv_rows=65538)
0615 22:03:22 ds4-server: listening on http://0.0.0.0:5801
0615 22:03:44 ds4-server: chat ctx=0..3098:3098 TOOLS prompt start
ds4: CUDA q8 fp16 cache budget exhausted; using q8 kernels (request=8.00 MiB cached=0.00 GiB free=1.02 GiB reserve=4.00 GiB total=23.56 GiB)
0615 22:04:22 ds4-server: chat ctx=0..3098:3098 TOOLS prompt done 38.021s
0615 22:04:24 ds4-server: chat ctx=3098..3148:50 gen=50 TOOLS DSML_START decoding chunk=23.83 t/s avg=23.83 t/s 2.098s
0615 22:04:26 ds4-server: chat ctx=3148..3185:37 gen=87 TOOLS DSML_START DSML_END decoding chunk=23.85 t/s avg=23.84 t/s 3.649s
0615 22:04:26 ds4-server: tool calls ctx=0..3098:3098 n=1 raw_dsml=1 ids=[call_5d5a2b2e11ad3d0e8c9cce23e5d7e9ec] names=[search_web]
0615 22:04:26 ds4-server: chat ctx=0..3098:3098 gen=87 TOOLS DSML_START DSML_END finish=tool_calls 41.670s
0615 22:04:27 ds4-server: live kv cache miss live=3185 prompt=4527 common=3086 reason=token-mismatch
0615 22:04:27 ds4-server: chat ctx=0..4527:4527 TOOLS prompt start
0615 22:04:27 ds4-server: chat ctx=0..4527:4527 TOOLS prefill chunk 0/4527 (0.0%) chunk=0.00 t/s avg=0.00 t/s 0.000s
0615 22:05:17 ds4-server: chat ctx=0..4527:4527 TOOLS prefill chunk 4096/4527 (90.5%) chunk=81.45 t/s avg=81.45 t/s 50.291s
0615 22:05:23 ds4-server: chat ctx=0..4527:4527 TOOLS prefill chunk 4527/4527 (100.0%) chunk=77.68 t/s avg=81.07 t/s 55.839s
0615 22:05:23 ds4-server: chat ctx=0..4527:4527 TOOLS prompt done 55.839s
0615 22:05:25 ds4-server: chat ctx=4527..4577:50 gen=50 TOOLS DSML_START decoding chunk=24.93 t/s avg=24.93 t/s 2.006s
0615 22:05:26 ds4-server: chat ctx=4577..4597:20 gen=70 TOOLS DSML_START DSML_END decoding chunk=24.47 t/s avg=24.80 t/s 2.823s
0615 22:05:26 ds4-server: tool calls ctx=0..4527:4527 n=1 raw_dsml=1 ids=[call_1b99eef28518c88a924a0d39dae9999e] names=[fetch_url]
0615 22:05:26 ds4-server: chat ctx=0..4527:4527 gen=70 TOOLS DSML_START DSML_END finish=tool_calls 58.662s
0615 22:05:26 ds4-server: live kv cache miss live=4597 prompt=7832 common=3608 reason=token-mismatch
0615 22:05:26 ds4-server: chat ctx=0..7832:7832 TOOLS prompt start
0615 22:05:26 ds4-server: chat ctx=0..7832:7832 TOOLS prefill chunk 0/7832 (0.0%) chunk=0.00 t/s avg=0.00 t/s 0.000s
0615 22:06:16 ds4-server: chat ctx=0..7832:7832 TOOLS prefill chunk 4096/7832 (52.3%) chunk=81.72 t/s avg=81.72 t/s 50.123s
0615 22:07:02 ds4-server: chat ctx=0..7832:7832 TOOLS prefill chunk 7832/7832 (100.0%) chunk=80.90 t/s avg=81.33 t/s 96.302s
0615 22:07:02 ds4-server: chat ctx=0..7832:7832 TOOLS prompt done 96.302s
0615 22:07:04 ds4-server: chat ctx=7832..7882:50 gen=50 TOOLS THINKING decoding chunk=23.61 t/s avg=23.61 t/s 2.118s
0615 22:07:06 ds4-server: chat ctx=7882..7932:50 gen=100 TOOLS THINKING decoding chunk=24.16 t/s avg=23.88 t/s 4.187s
0615 22:07:09 ds4-server: chat ctx=7932..7982:50 gen=150 TOOLS THINKING decoding chunk=24.15 t/s avg=23.97 t/s 6.258s
0615 22:07:11 ds4-server: chat ctx=7982..8032:50 gen=200 TOOLS THINKING decoding chunk=24.15 t/s avg=24.01 t/s 8.329s
0615 22:07:13 ds4-server: chat ctx=8032..8082:50 gen=250 TOOLS THINKING decoding chunk=24.16 t/s avg=24.04 t/s 10.398s
0615 22:07:15 ds4-server: chat ctx=8082..8132:50 gen=300 TOOLS decoding chunk=24.13 t/s avg=24.06 t/s 12.470s
0615 22:07:17 ds4-server: chat ctx=8132..8182:50 gen=350 TOOLS decoding chunk=24.16 t/s avg=24.07 t/s 14.539s
0615 22:07:19 ds4-server: chat ctx=8182..8232:50 gen=400 TOOLS decoding chunk=23.72 t/s avg=24.03 t/s 16.647s
0615 22:07:21 ds4-server: chat ctx=8232..8282:50 gen=450 TOOLS decoding chunk=23.59 t/s avg=23.98 t/s 18.766s
0615 22:07:23 ds4-server: chat ctx=8282..8332:50 gen=500 TOOLS decoding chunk=23.56 t/s avg=23.94 t/s 20.888s
0615 22:07:25 ds4-server: chat ctx=8332..8382:50 gen=550 TOOLS decoding chunk=23.58 t/s avg=23.90 t/s 23.008s
0615 22:07:27 ds4-server: chat ctx=8382..8432:50 gen=600 TOOLS decoding chunk=23.58 t/s avg=23.88 t/s 25.128s
0615 22:07:30 ds4-server: chat ctx=8432..8482:50 gen=650 TOOLS decoding chunk=23.58 t/s avg=23.85 t/s 27.249s
0615 22:07:32 ds4-server: chat ctx=8482..8532:50 gen=700 TOOLS decoding chunk=23.58 t/s avg=23.83 t/s 29.370s
0615 22:07:33 ds4-server: chat ctx=8532..8553:21 gen=721 TOOLS decoding chunk=23.53 t/s avg=23.83 t/s 30.262s
0615 22:07:33 ds4-server: chat ctx=0..7832:7832 gen=721 TOOLS finish=stop 126.565s
0615 22:07:33 ds4-server: live kv cache miss live=8553 prompt=750 common=1 reason=token-mismatch
0615 22:07:33 ds4-server: chat ctx=0..750:750 prompt start
0615 22:07:42 ds4-server: chat ctx=0..750:750 prompt done 9.210s
0615 22:07:44 ds4-server: chat ctx=750..800:50 gen=50 THINKING decoding chunk=27.47 t/s avg=27.47 t/s 1.820s
0615 22:07:45 ds4-server: chat ctx=800..850:50 gen=100 THINKING decoding chunk=27.06 t/s avg=27.26 t/s 3.668s
0615 22:07:47 ds4-server: chat ctx=850..900:50 gen=150 THINKING decoding chunk=26.98 t/s avg=27.17 t/s 5.521s
0615 22:07:49 ds4-server: chat ctx=900..950:50 gen=200 decoding chunk=26.91 t/s avg=27.10 t/s 7.379s
0615 22:07:49 ds4-server: chat ctx=950..956:6 gen=206 decoding chunk=26.77 t/s avg=27.09 t/s 7.603s
0615 22:07:49 ds4-server: thinking live checkpoint remembered ctx=0..750:750 live=956 visible=3349
0615 22:07:49 ds4-server: chat ctx=0..750:750 gen=206 finish=stop 16.813s
0615 22:07:49 ds4-server: live kv cache miss live=956 prompt=641 common=6 reason=token-mismatch
0615 22:07:49 ds4-server: chat ctx=0..641:641 prompt start
0615 22:07:57 ds4-server: chat ctx=0..641:641 prompt done 7.903s
0615 22:07:59 ds4-server: chat ctx=641..691:50 gen=50 THINKING decoding chunk=27.84 t/s avg=27.84 t/s 1.796s
0615 22:08:01 ds4-server: chat ctx=691..741:50 gen=100 THINKING decoding chunk=27.20 t/s avg=27.51 t/s 3.635s
0615 22:08:03 ds4-server: chat ctx=741..791:50 gen=150 THINKING decoding chunk=27.14 t/s avg=27.39 t/s 5.477s
0615 22:08:05 ds4-server: chat ctx=791..841:50 gen=200 THINKING decoding chunk=27.08 t/s avg=27.31 t/s 7.323s
0615 22:08:06 ds4-server: chat ctx=841..891:50 gen=250 THINKING decoding chunk=27.03 t/s avg=27.25 t/s 9.173s
0615 22:08:08 ds4-server: chat ctx=891..941:50 gen=300 THINKING decoding chunk=26.92 t/s avg=27.20 t/s 11.030s
0615 22:08:10 ds4-server: chat ctx=941..991:50 gen=350 THINKING decoding chunk=26.87 t/s avg=27.15 t/s 12.891s
0615 22:08:12 ds4-server: chat ctx=991..1041:50 gen=400 THINKING decoding chunk=26.69 t/s avg=27.09 t/s 14.764s
0615 22:08:14 ds4-server: chat ctx=1041..1091:50 gen=450 THINKING decoding chunk=26.37 t/s avg=27.01 t/s 16.660s
0615 22:08:16 ds4-server: chat ctx=1091..1141:50 gen=500 THINKING decoding chunk=26.26 t/s avg=26.93 t/s 18.564s
0615 22:08:18 ds4-server: chat ctx=1141..1191:50 gen=550 THINKING decoding chunk=26.19 t/s avg=26.86 t/s 20.474s
0615 22:08:20 ds4-server: chat ctx=1191..1241:50 gen=600 THINKING decoding chunk=26.16 t/s avg=26.80 t/s 22.385s
0615 22:08:22 ds4-server: chat ctx=1241..1291:50 gen=650 THINKING decoding chunk=26.13 t/s avg=26.75 t/s 24.299s
0615 22:08:24 ds4-server: chat ctx=1291..1341:50 gen=700 THINKING decoding chunk=26.12 t/s avg=26.70 t/s 26.213s
0615 22:08:25 ds4-server: chat ctx=1341..1391:50 gen=750 THINKING decoding chunk=26.09 t/s avg=26.66 t/s 28.129s
0615 22:08:27 ds4-server: chat ctx=1391..1441:50 gen=800 THINKING decoding chunk=26.02 t/s avg=26.62 t/s 30.051s
0615 22:08:29 ds4-server: chat ctx=1441..1491:50 gen=850 THINKING decoding chunk=26.04 t/s avg=26.59 t/s 31.971s
0615 22:08:31 ds4-server: chat ctx=1491..1541:50 gen=900 THINKING decoding chunk=25.96 t/s avg=26.55 t/s 33.897s
0615 22:08:33 ds4-server: chat ctx=1541..1591:50 gen=950 THINKING decoding chunk=25.95 t/s avg=26.52 t/s 35.824s
0615 22:08:35 ds4-server: chat ctx=1591..1641:50 gen=1000 THINKING decoding chunk=25.88 t/s avg=26.49 t/s 37.756s
0615 22:08:37 ds4-server: chat ctx=1641..1691:50 gen=1050 THINKING decoding chunk=25.81 t/s avg=26.45 t/s 39.693s
0615 22:08:39 ds4-server: chat ctx=1691..1741:50 gen=1100 THINKING decoding chunk=25.77 t/s avg=26.42 t/s 41.634s
0615 22:08:41 ds4-server: chat ctx=1741..1791:50 gen=1150 THINKING decoding chunk=25.73 t/s avg=26.39 t/s 43.577s
0615 22:08:43 ds4-server: chat ctx=1791..1841:50 gen=1200 THINKING decoding chunk=25.65 t/s avg=26.36 t/s 45.526s
0615 22:08:45 ds4-server: chat ctx=1841..1891:50 gen=1250 THINKING decoding chunk=25.61 t/s avg=26.33 t/s 47.478s
0615 22:08:47 ds4-server: chat ctx=1891..1941:50 gen=1300 THINKING decoding chunk=25.53 t/s avg=26.30 t/s 49.436s
0615 22:08:49 ds4-server: chat ctx=1941..1991:50 gen=1350 THINKING decoding chunk=25.47 t/s avg=26.26 t/s 51.400s
0615 22:08:51 ds4-server: chat ctx=1991..2041:50 gen=1400 THINKING decoding chunk=25.39 t/s avg=26.23 t/s 53.369s
0615 22:08:53 ds4-server: chat ctx=2041..2091:50 gen=1450 THINKING decoding chunk=25.08 t/s avg=26.19 t/s 55.362s
0615 22:08:54 ds4-server: chat ctx=2091..2134:43 gen=1493 decoding chunk=24.94 t/s avg=26.15 t/s 57.087s
0615 22:08:54 ds4-server: thinking live checkpoint remembered ctx=0..641:641 live=2134 visible=2783
0615 22:08:54 ds4-server: chat ctx=0..641:641 gen=1493 finish=stop 64.990s

rmhubbert avatar Jun 15 '26 21:06 rmhubbert

Great news, thanks so much for testing.

I don't have access to a multi-gpu box right now, but the issue appears to be on some GGUFs it uses the kq4_routed_tensor kernel which is currently skipped in my tag during prefill (it's a tiny fix). Can you try this branch:

git fetch origin
git checkout fix/q4k-routed-prefill-on-v0.1.0
CUDA_HOME=/usr/lib/cuda make cuda CUDA_ARCH=sm_86 -j4
./ds4-bench
    --prompt-file tests/long_context_story_prompt.txt
    --model gguf/DeepSeek-V4-Flash-Layers37-42Q4KExperts-OtherExpertLayersIQ2XXSGateUp-Q2KDown-AProjQ8-SExpQ8-OutQ8-chat-v2-imatrix-fixed.gguf
    --cuda --gpu-vram 23,23,23,23,23,23,23,23
    --ctx-start 2048 --ctx-max 4096 --gen-tokens 64

Three possible outcomes:
1. **Prefill works** → fix is good, please share the numbers.
2. **Prefill still fails with a different error** → kernels have a shape constraint I missed; please paste the full log so I can look.
3. **CUDA illegal memory access / kernel launch error** → the Q4_K batch kernels have a bug independent of the guard. Set `DS4_CUDA_MOE_NO_Q4_EXPERT_TILES=1` to force the decode-only path (then prefill will still fail but with a cleaner error), and let me know.

cchuter avatar Jun 17 '26 17:06 cchuter

It seems to work. With your 'old' code i would get

ds4-bench: prefill to 2048 failed: cuda prefill failed

With your new code: CUDA_VISIBLE_DEVICES=0,1,2,4,5,6 ./ds4-bench --prompt-file tests/long_context_story_prompt.txt --model ../llm/antirez/DeepSeek-V4-Flash-Layers37-42Q4KExperts-OtherExpertLayersIQ2XXSGateUp-Q2KDown-AProjQ8-SExpQ8-OutQ8-chat-v2-imatrix-fixed.gguf --cuda --gpu-vram 23,23,23,23,23,23 --ctx-start 2048 --ctx-max 4096 --gen-tokens 64 ds4-bench: context buffers 365.60 MiB (ctx=4161, backend=cuda, prefill_chunk=4096, raw_kv_rows=4352, compressed_kv_rows=3) ds4: GPU config: 6 devices [0,1,2,3,4,5] requested, budgets 23,23,23,23,23,23 GB; auto=false ds4: CUDA backend initialized on NVIDIA GeForce RTX 3090 (sm_86) dev=0 ds4: CUDA backend initialized on NVIDIA GeForce RTX 3090 (sm_86) dev=1 ds4: CUDA backend initialized on NVIDIA GeForce RTX 3090 (sm_86) dev=2 ds4: CUDA backend initialized on NVIDIA GeForce RTX 3090 (sm_86) dev=3 ds4: CUDA backend initialized on NVIDIA GeForce RTX 3090 (sm_86) dev=4 ds4: CUDA backend initialized on NVIDIA GeForce RTX 3090 (sm_86) dev=5 multi-GPU layout: GPU0: layers 0-8 + embedding (17.6 / 19.1 GB) GPU1: layers 9-17 (16.7 / 19.1 GB) GPU2: layers 18-26 (16.7 / 19.1 GB) GPU3: layers 27-35 (16.7 / 19.1 GB) GPU4: layers 36-40 (16.0 / 19.1 GB) GPU5: layers 41-42 + output head (7.6 / 19.1 GB) ds4: per-tier graph scratch reserved: 3.93 GiB (pre-subtracted from each GPU budget) ds4: peer access matrix (validated): 0->1 BOUNCE 0->2 BOUNCE 0->3 BOUNCE 0->4 BOUNCE 0->5 BOUNCE 1->0 BOUNCE 1->2 BOUNCE 1->3 BOUNCE 1->4 BOUNCE 1->5 BOUNCE 2->0 BOUNCE 2->1 BOUNCE 2->3 BOUNCE 2->4 BOUNCE 2->5 BOUNCE 3->0 BOUNCE 3->1 BOUNCE 3->2 BOUNCE 3->4 BOUNCE 3->5 BOUNCE 4->0 BOUNCE 4->1 BOUNCE 4->2 BOUNCE 4->3 BOUNCE 4->5 BOUNCE 5->0 BOUNCE 5->1 BOUNCE 5->2 BOUNCE 5->3 BOUNCE 5->4 BOUNCE ds4: CUDA (no-copy) registered 90.89 GiB model mapping for multi-tier selective cache ctx_tokens,prefill_tokens,prefill_tps,gen_tokens,gen_tps,kvcache_bytes ds4: CUDA q8 fp16 cache budget exhausted; using q8 kernels (request=8.00 MiB cached=0.00 GiB free=1.45 GiB reserve=4.00 GiB total=23.56 GiB) 2048,2048,101.40,64,25.65,52184460 4096,2048,99.99,64,24.85,80373132

GirlPower68 avatar Jun 17 '26 18:06 GirlPower68

Likewise! No more cuda prefill failed when running the bench or server built from the new fix branch.

 ./ds4-bench \                                                                                                                                                                                                                                                                                  fix/q4k-routed-prefill-on-v0.1.0
    --prompt-file tests/long_context_story_prompt.txt \
    --gpu-vram 23,23,23,23,23,23,23,23 \
    --ctx-start 2048 --ctx-max 8192 --gen-tokens 64 --model /home/hubby/ds4/gguf/DeepSeek-V4-Flash-Layers37-42Q4KExperts-OtherExpertLayersIQ2XXSGateUp-Q2KDown-AProjQ8-SExpQ8-OutQ8-chat-v2-imatrix-fixed.gguf
ds4-bench: context buffers 365.60 MiB (ctx=8257, backend=cuda, prefill_chunk=4096, raw_kv_rows=4352, compressed_kv_rows=3)
ds4: GPU config: 8 devices [0,1,2,3,4,5,6,7] requested, budgets 23,23,23,23,23,23,23,23 GB; auto=false
ds4: CUDA backend initialized on NVIDIA GeForce RTX 3090 (sm_86) dev=0
ds4: CUDA backend initialized on NVIDIA GeForce RTX 3090 (sm_86) dev=1
ds4: CUDA backend initialized on NVIDIA GeForce RTX 3090 (sm_86) dev=2
ds4: CUDA backend initialized on NVIDIA GeForce RTX 3090 (sm_86) dev=3
ds4: CUDA backend initialized on NVIDIA GeForce RTX 3090 (sm_86) dev=4
ds4: CUDA backend initialized on NVIDIA GeForce RTX 3090 (sm_86) dev=5
ds4: CUDA backend initialized on NVIDIA GeForce RTX 3090 (sm_86) dev=6
ds4: CUDA backend initialized on NVIDIA GeForce RTX 3090 (sm_86) dev=7
multi-GPU layout:
  GPU0: layers 0-8 + embedding  (17.7 / 19.0 GB)
  GPU1: layers 9-17  (16.7 / 19.0 GB)
  GPU2: layers 18-26  (16.7 / 19.0 GB)
  GPU3: layers 27-35  (16.7 / 19.0 GB)
  GPU4: layers 36-40  (16.0 / 19.0 GB)
  GPU5: layers 41-42 + output head  (7.6 / 19.0 GB)
  GPU6: (no transformer layers)  (0.0 / 19.0 GB)
  GPU7: (no transformer layers)  (0.0 / 19.0 GB)
ds4: per-tier graph scratch reserved: 3.96 GiB (pre-subtracted from each GPU budget)
ds4: peer access matrix (validated): 0->1 BOUNCE 0->2 BOUNCE 0->3 BOUNCE 0->4 BOUNCE 0->5 BOUNCE 0->6 BOUNCE 0->7 BOUNCE 1->0 BOUNCE 1->2 BOUNCE 1->3 BOUNCE 1->4 BOUNCE 1->5 BOUNCE 1->6 BOUNCE 1->7 BOUNCE 2->0 BOUNCE 2->1 BOUNCE 2->3 BOUNCE 2->4 BOUNCE 2->5 BOUNCE 2->6 BOUNCE 2->7 BOUNCE 3->0 BOUNCE 3->1 BOUNCE 3->2 BOUNCE 3->4 BOUNCE 3->5 BOUNCE 3->6 BOUNCE 3->7 BOUNCE 4->0 BOUNCE 4->1 BOUNCE 4->2 BOUNCE 4->3 BOUNCE 4->5 BOUNCE 4->6 BOUNCE 4->7 BOUNCE 5->0 BOUNCE 5->1 BOUNCE 5->2 BOUNCE 5->3 BOUNCE 5->4 BOUNCE 5->6 BOUNCE 5->7 BOUNCE 6->0 BOUNCE 6->1 BOUNCE 6->2 BOUNCE 6->3 BOUNCE 6->4 BOUNCE 6->5 BOUNCE 6->7 BOUNCE 7->0 BOUNCE 7->1 BOUNCE 7->2 BOUNCE 7->3 BOUNCE 7->4 BOUNCE 7->5 BOUNCE 7->6 BOUNCE
ds4: CUDA (no-copy) host registration skipped: operation not supported
ctx_tokens,prefill_tokens,prefill_tps,gen_tokens,gen_tps,kvcache_bytes
ds4: CUDA q8 fp16 cache budget exhausted; using q8 kernels (request=8.00 MiB cached=0.00 GiB free=1.59 GiB reserve=4.00 GiB total=23.56 GiB)
2048,2048,81.08,64,25.88,52184460
4096,2048,79.53,64,25.05,80373132
6144,2048,78.99,64,25.03,108561804
8192,2048,78.52,64,24.41,136750476

Unfortunately, I'm seeing a new issue when running inference against DeepSeek-V4-Flash-Layers37-42Q4KExperts-OtherExpertLayersIQ2XXSGateUp-Q2KDown-AProjQ8-SExpQ8-OutQ8-chat-v2-imatrix-fixed.gguf, in that the reasoning output is just <|begin▁of▁sentence|> repeated over and over again.

I am not seeing that issue with cyberneurova-DeepSeek-V4-Flash-abliterated-IQ2XXS-w2Q2K-AProjQ8-SExpQ8-OutQ8-chat-v2-imatrix-aligned.gguf, reasoning, and final content is as expected there.

Here's the output from the inference run where I got the looped <|begin▁of▁sentence|>.

ds4: GPU config: 8 devices [0,1,2,3,4,5,6,7] requested, budgets 23,23,23,23,23,23,23,23 GB; auto=false
ds4: warming mapped tensor pages: 90.88 GiB
ds4: warmed tensor pages in 35.041s (checksum=2917286760)
ds4: CUDA backend initialized on NVIDIA GeForce RTX 3090 (sm_86) dev=0
ds4: CUDA backend initialized on NVIDIA GeForce RTX 3090 (sm_86) dev=1
ds4: CUDA backend initialized on NVIDIA GeForce RTX 3090 (sm_86) dev=2
ds4: CUDA backend initialized on NVIDIA GeForce RTX 3090 (sm_86) dev=3
ds4: CUDA backend initialized on NVIDIA GeForce RTX 3090 (sm_86) dev=4
ds4: CUDA backend initialized on NVIDIA GeForce RTX 3090 (sm_86) dev=5
ds4: CUDA backend initialized on NVIDIA GeForce RTX 3090 (sm_86) dev=6
ds4: CUDA backend initialized on NVIDIA GeForce RTX 3090 (sm_86) dev=7
multi-GPU layout:
  GPU0: layers 0-7 + embedding  (16.2 / 17.1 GB)
  GPU1: layers 8-15  (15.5 / 17.1 GB)
  GPU2: layers 16-23  (15.5 / 17.1 GB)
  GPU3: layers 24-31  (15.5 / 17.1 GB)
  GPU4: layers 32-37  (13.3 / 17.1 GB)
  GPU5: layers 38-41  (14.5 / 17.1 GB)
  GPU6: layer 42 + output head  (4.2 / 17.1 GB)
  GPU7: (no transformer layers)  (0.0 / 17.1 GB)
ds4: per-tier graph scratch reserved: 5.89 GiB (pre-subtracted from each GPU budget)
ds4: peer access matrix (validated): 0->1 BOUNCE 0->2 BOUNCE 0->3 BOUNCE 0->4 BOUNCE 0->5 BOUNCE 0->6 BOUNCE 0->7 BOUNCE 1->0 BOUNCE 1->2 BOUNCE 1->3 BOUNCE 1->4 BOUNCE 1->5 BOUNCE 1->6 BOUNCE 1->7 BOUNCE 2->0 BOUNCE 2->1 BOUNCE 2->3 BOUNCE 2->4 BOUNCE 2->5 BOUNCE 2->6 BOUNCE 2->7 BOUNCE 3->0 BOUNCE 3->1 BOUNCE 3->2 BOUNCE 3->4 BOUNCE 3->5 BOUNCE 3->6 BOUNCE 3->7 BOUNCE 4->0 BOUNCE 4->1 BOUNCEds4: CUDA (no-copy) host registration skipped: operation not supported
0617 21:21:56 ds4-server: context buffers 5855.75 MiB (ctx=262144, backend=cuda, prefill_chunk=4096, raw_kv_rows=4352, compressed_kv_rows=65538)
0617 21:21:57 ds4-server: listening on http://0.0.0.0:5801
0617 21:22:06 ds4-server: chat ctx=0..3144:3144 TOOLS prompt start
ds4: CUDA q8 fp16 cache budget exhausted; using q8 kernels (request=8.00 MiB cached=0.00 GiB free=1.01 GiB reserve=4.00 GiB total=23.56 GiB)
0617 21:22:46 ds4-server: chat ctx=0..3144:3144 TOOLS prompt done 40.186s
0617 21:22:48 ds4-server: chat ctx=3144..3194:50 gen=50 TOOLS THINKING decoding chunk=23.81 t/s avg=23.81 t/s 2.100s
0617 21:22:50 ds4-server: chat ctx=3194..3244:50 gen=100 TOOLS THINKING decoding chunk=23.91 t/s avg=23.86 t/s 4.191s
0617 21:22:51 ds4-server: chat ctx=3244..3267:23 gen=123 TOOLS THINKING decoding chunk=23.91 t/s avg=23.87 t/s 5.153s
ds4-server: thinking not closed, ignoring DSML in reasoning
0617 21:22:51 ds4-server: chat ctx=0..3144:3144 TOOLS final stream failed
0617 21:22:51 ds4-server: chat ctx=0..3144:3144 gen=123 TOOLS THINKING finish=error error="client stream write failed" 45.339s
0617 21:25:01 ds4-server: shutdown requested, draining requests

rmhubbert avatar Jun 17 '26 20:06 rmhubbert

I think we're making progress, thanks again for testing. @rmhubbert , can you run these when you get a chance:

# Test 1: see what tokens the model is actually producing on the mixed-quant GGUF.
# bench's --show-output prints decoded text; if it's gibberish here, the Q4_K
# batch kernels have a numerical bug, not just a "kernel didn't crash" success.
./ds4-bench \
    --prompt-file tests/long_context_story_prompt.txt \
    --model gguf/DeepSeek-V4-Flash-Layers37-42Q4KExperts-OtherExpertLayersIQ2XXSGateUp-Q2KDown-AProjQ8-SExpQ8-OutQ8-chat-v2-imatrix-fixed.gguf \
    --cuda --gpu-vram 23,23,23,23,23,23,23,23 \
    --ctx-start 2048 --ctx-max 2048 --gen-tokens 128 \
    --show-output

# Test 2: disable the Q4_K expert-tile prefill kernels, falling back to the
# qwarp32 per-warp path (which has been working for n_tokens=1 decode).
# If output is sane here, the bug is in the tile8/tile16 kernels specifically.
DS4_CUDA_MOE_NO_Q4_EXPERT_TILES=1 ./ds4-bench \
    --prompt-file tests/long_context_story_prompt.txt \
    --model gguf/DeepSeek-V4-Flash-Layers37-42Q4KExperts-OtherExpertLayersIQ2XXSGateUp-Q2KDown-AProjQ8-SExpQ8-OutQ8-chat-v2-imatrix-fixed.gguf \
    --cuda --gpu-vram 23,23,23,23,23,23,23,23 \
    --ctx-start 2048 --ctx-max 2048 --gen-tokens 128 \
    --show-output

cchuter avatar Jun 17 '26 22:06 cchuter

No problem at all! Same gibberish from both tests, I'm afraid.

Test 1

./ds4-bench \                                                                                                                                                                                                                                                                                                                      
    --prompt-file tests/long_context_story_prompt.txt \
    --model gguf/DeepSeek-V4-Flash-Layers37-42Q4KExperts-OtherExpertLayersIQ2XXSGateUp-Q2KDown-AProjQ8-SExpQ8-OutQ8-chat-v2-imatrix-fixed.gguf \
    --cuda --gpu-vram 23,23,23,23,23,23,23,23 \
    --ctx-start 2048 --ctx-max 2048 --gen-tokens 128 \
    --show-output
ds4-bench: context buffers 193.56 MiB (ctx=2177, backend=cuda, prefill_chunk=2177, raw_kv_rows=2304, compressed_kv_rows=3)
ds4: GPU config: 8 devices [0,1,2,3,4,5,6,7] requested, budgets 23,23,23,23,23,23,23,23 GB; auto=false
ds4: CUDA backend initialized on NVIDIA GeForce RTX 3090 (sm_86) dev=0
ds4: CUDA backend initialized on NVIDIA GeForce RTX 3090 (sm_86) dev=1
ds4: CUDA backend initialized on NVIDIA GeForce RTX 3090 (sm_86) dev=2
ds4: CUDA backend initialized on NVIDIA GeForce RTX 3090 (sm_86) dev=3
ds4: CUDA backend initialized on NVIDIA GeForce RTX 3090 (sm_86) dev=4
ds4: CUDA backend initialized on NVIDIA GeForce RTX 3090 (sm_86) dev=5
ds4: CUDA backend initialized on NVIDIA GeForce RTX 3090 (sm_86) dev=6
ds4: CUDA backend initialized on NVIDIA GeForce RTX 3090 (sm_86) dev=7
multi-GPU layout:
  GPU0: layers 0-9 + embedding  (19.4 / 20.9 GB)
  GPU1: layers 10-20  (20.3 / 20.9 GB)
  GPU2: layers 21-31  (20.3 / 20.9 GB)
  GPU3: layers 32-39  (19.9 / 20.9 GB)
  GPU4: layers 40-42 + output head  (11.1 / 20.9 GB)
  GPU5: (no transformer layers)  (0.0 / 20.9 GB)
  GPU6: (no transformer layers)  (0.0 / 20.9 GB)
  GPU7: (no transformer layers)  (0.0 / 20.9 GB)
ds4: per-tier graph scratch reserved: 2.08 GiB (pre-subtracted from each GPU budget)
ds4: peer access matrix (validated): 0->1 BOUNCE 0->2 BOUNCE 0->3 BOUNCE 0->4 BOUNCE 0->5 BOUNCE 0->6 BOUNCE 0->7 BOUNCE 1->0 BOUNCE 1->2 BOUNCE 1->3 BOUNCE 1->4 BOUNCE 1->5 BOUNCE 1->6 BOUNCE 1->7 BOUNCE 2->0 BOUNCE 2->1 BOUNCE 2->3 BOUNCE 2->4 BOUNCE 2->5 BOUNCE 2->6 BOUNCE 2->7 BOUNCE 3->0 BOUNCE 3->1 BOUNCE 3->2 BOUNCE 3->4 BOUNCE 3->5 BOUNCE 3->6 BOUNCE 3->7 BOUNCE 4->0 BOUNCE 4->1 BOUNCE 4->2 BOUNCE 4->3 BOUNCE 4->5 BOUNCE 4->6 BOUNCE 4->7 BOUNCE 5->0 BOUNCE 5->1 BOUNCE 5->2 BOUNCE 5->3 BOUNCE 5->4 BOUNCE 5->6 BOUNCE 5->7 BOUNCE 6->0 BOUNCE 6->1 BOUNCE 6->2 BOUNCE 6->3 BOUNCE 6->4 BOUNCE 6->5 BOUNCE 6->7 BOUNCE 7->0 BOUNCE 7->1 BOUNCE 7->2 BOUNCE 7->3 BOUNCE 7->4 BOUNCE 7->5 BOUNCE 7->6 BOUNCE
ds4: CUDA (no-copy) host registration skipped: operation not supported
ctx_tokens,prefill_tokens,prefill_tps,gen_tokens,gen_tps,kvcache_bytes
ds4: CUDA q8 fp16 cache budget exhausted; using q8 kernels (request=8.00 MiB cached=0.00 GiB free=1.64 GiB reserve=4.00 GiB total=23.56 GiB)
ds4-bench: gen[ctx=2048] decoded text: "<|begin▁of▁sentence|><|begin▁of▁sentence|><|begin▁of▁sentence|><|begin▁of▁sentence|><|begin▁of▁sentence|><|begin▁of▁sentence|><|begin▁of▁sentence|><|begin▁of▁sentence|><|begin▁of▁sentence|><|begin▁of▁sentence|><|begin▁of▁sentence|><|begin▁of▁sentence|><|begin▁of▁sentence|><|begin▁of▁sentence|><|begin▁of▁sentence|><|begin▁of▁sentence|><|begin▁of▁sentence|><|begin▁of▁sentence|><|begin▁of▁sentence|><|begin▁of▁sentence|><|begin▁of▁sentence|><|begin▁of▁sentence|><|begin▁of▁sentence|><|begin▁of▁sentence|><|begin▁of▁sentence|><|begin▁of▁sentence|><|begin▁of▁sentence|><|begin▁of▁sentence|><|begin▁of▁sentence|><|begin▁of▁sentence|><|begin▁of▁sentence|><|begin▁of▁sentence|><|begin▁of▁sentence|><|begin▁of▁sentence|><|begin▁of▁sentence|><|begin▁of▁sentence|><|begin▁of▁sentence|><|begin▁of▁sentence|><|begin▁of▁sentence|><|begin▁of▁sentence|><|begin▁of▁sentence|><|begin▁of▁sentence|><|begin▁of▁sentence|><|begin▁of▁sentence|><|begin▁of▁sentence|><|begin▁of▁sentence|><|begin▁of▁sentence|><|begin▁of▁sentence|><|begin▁of▁sentence|><|begin▁of▁sentence|><|begin▁of▁sentence|><|begin▁of▁sentence|><|begin▁of▁sentence|><|begin▁of▁sentence|><|begin▁of▁sentence|><|begin▁of▁sentence|><|begin▁of▁sentence|><|begin▁of▁sentence|><|begin▁of▁sentence|><|begin▁of▁sentence|><|begin▁of▁sentence|><|begin▁of▁sentence|><|begin▁of▁sentence|><|begin▁of▁sentence|><|begin▁of▁sentence|><|begin▁of▁sentence|><|begin▁of▁sentence|><|begin▁of▁sentence|><|begin▁of▁sentence|><|begin▁of▁sentence|><|begin▁of▁sentence|><|begin▁of▁sentence|><|begin▁of▁sentence|><|begin▁of▁sentence|><|begin▁of▁sentence|><|begin▁of▁sentence|><|begin▁of▁sentence|><|begin▁of▁sentence|><|begin▁of▁sentence|><|begin▁of▁sentence|><|begin▁of▁sentence|><|begin▁of▁sentence|><|begin▁of▁sentence|><|begin▁of▁sentence|><|begin▁of▁sentence|><|begin▁of▁sentence|><|begin▁of▁sentence|><|begin▁of▁sentence|><|begin▁of▁sentence|><|begin▁of▁sentence|><|begin▁of▁sentence|><|begin▁of▁sentence|><|begin▁of▁sentence|><|begin▁of▁sentence|><|begin▁of▁sentence|><|begin▁of▁sentence|><|begin▁of▁sentence|><|begin▁of▁sentence|><|begin▁of▁sentence|><|begin▁of▁sentence|><|begin▁of▁sentence|><|begin▁of▁sentence|><|begin▁of▁sentence|><|begin▁of▁sentence|><|begin▁of▁sentence|><|begin▁of▁sentence|><|begin▁of▁sentence|><|begin▁of▁sentence|><|begin▁of▁sentence|><|begin▁of▁sentence|><|begin▁of▁sentence|><|begin▁of▁sentence|><|begin▁of▁sentence|><|begin▁of▁sentence|><|begin▁of▁sentence|><|begin▁of▁sentence|><|begin▁of▁sentence|><|begin▁of▁sentence|><|begin▁of▁sentence|><|begin▁of▁sentence|><|begin▁of▁sentence|><|begin▁of▁sentence|><|begin▁of▁sentence|><|begin▁of▁sentence|><|begin▁of▁sentence|><|begin▁of▁sentence|><|begin▁of▁sentence|><|begin▁of▁sentence|>"
2048,2048,83.18,128,25.73,52184460

Test 2

DS4_CUDA_MOE_NO_Q4_EXPERT_TILES=1 ./ds4-bench \                                                                                                                                                                                                                                                                                    
    --prompt-file tests/long_context_story_prompt.txt \
    --model gguf/DeepSeek-V4-Flash-Layers37-42Q4KExperts-OtherExpertLayersIQ2XXSGateUp-Q2KDown-AProjQ8-SExpQ8-OutQ8-chat-v2-imatrix-fixed.gguf \
    --cuda --gpu-vram 23,23,23,23,23,23,23,23 \
    --ctx-start 2048 --ctx-max 2048 --gen-tokens 128 \
    --show-output
ds4-bench: context buffers 193.56 MiB (ctx=2177, backend=cuda, prefill_chunk=2177, raw_kv_rows=2304, compressed_kv_rows=3)
ds4: GPU config: 8 devices [0,1,2,3,4,5,6,7] requested, budgets 23,23,23,23,23,23,23,23 GB; auto=false
ds4: CUDA backend initialized on NVIDIA GeForce RTX 3090 (sm_86) dev=0
ds4: CUDA backend initialized on NVIDIA GeForce RTX 3090 (sm_86) dev=1
ds4: CUDA backend initialized on NVIDIA GeForce RTX 3090 (sm_86) dev=2
ds4: CUDA backend initialized on NVIDIA GeForce RTX 3090 (sm_86) dev=3
ds4: CUDA backend initialized on NVIDIA GeForce RTX 3090 (sm_86) dev=4
ds4: CUDA backend initialized on NVIDIA GeForce RTX 3090 (sm_86) dev=5
ds4: CUDA backend initialized on NVIDIA GeForce RTX 3090 (sm_86) dev=6
ds4: CUDA backend initialized on NVIDIA GeForce RTX 3090 (sm_86) dev=7
multi-GPU layout:
  GPU0: layers 0-9 + embedding  (19.4 / 20.9 GB)
  GPU1: layers 10-20  (20.3 / 20.9 GB)
  GPU2: layers 21-31  (20.3 / 20.9 GB)
  GPU3: layers 32-39  (19.9 / 20.9 GB)
  GPU4: layers 40-42 + output head  (11.1 / 20.9 GB)
  GPU5: (no transformer layers)  (0.0 / 20.9 GB)
  GPU6: (no transformer layers)  (0.0 / 20.9 GB)
  GPU7: (no transformer layers)  (0.0 / 20.9 GB)
ds4: per-tier graph scratch reserved: 2.08 GiB (pre-subtracted from each GPU budget)
ds4: peer access matrix (validated): 0->1 BOUNCE 0->2 BOUNCE 0->3 BOUNCE 0->4 BOUNCE 0->5 BOUNCE 0->6 BOUNCE 0->7 BOUNCE 1->0 BOUNCE 1->2 BOUNCE 1->3 BOUNCE 1->4 BOUNCE 1->5 BOUNCE 1->6 BOUNCE 1->7 BOUNCE 2->0 BOUNCE 2->1 BOUNCE 2->3 BOUNCE 2->4 BOUNCE 2->5 BOUNCE 2->6 BOUNCE 2->7 BOUNCE 3->0 BOUNCE 3->1 BOUNCE 3->2 BOUNCE 3->4 BOUNCE 3->5 BOUNCE 3->6 BOUNCE 3->7 BOUNCE 4->0 BOUNCE 4->1 BOUNCE 4->2 BOUNCE 4->3 BOUNCE 4->5 BOUNCE 4->6 BOUNCE 4->7 BOUNCE 5->0 BOUNCE 5->1 BOUNCE 5->2 BOUNCE 5->3 BOUNCE 5->4 BOUNCE 5->6 BOUNCE 5->7 BOUNCE 6->0 BOUNCE 6->1 BOUNCE 6->2 BOUNCE 6->3 BOUNCE 6->4 BOUNCE 6->5 BOUNCE 6->7 BOUNCE 7->0 BOUNCE 7->1 BOUNCE 7->2 BOUNCE 7->3 BOUNCE 7->4 BOUNCE 7->5 BOUNCE 7->6 BOUNCE
ds4: CUDA (no-copy) host registration skipped: operation not supported
ctx_tokens,prefill_tokens,prefill_tps,gen_tokens,gen_tps,kvcache_bytes
ds4: CUDA q8 fp16 cache budget exhausted; using q8 kernels (request=8.00 MiB cached=0.00 GiB free=1.64 GiB reserve=4.00 GiB total=23.56 GiB)
ds4-bench: gen[ctx=2048] decoded text: "<|begin▁of▁sentence|><|begin▁of▁sentence|><|begin▁of▁sentence|><|begin▁of▁sentence|><|begin▁of▁sentence|><|begin▁of▁sentence|><|begin▁of▁sentence|><|begin▁of▁sentence|><|begin▁of▁sentence|><|begin▁of▁sentence|><|begin▁of▁sentence|><|begin▁of▁sentence|><|begin▁of▁sentence|><|begin▁of▁sentence|><|begin▁of▁sentence|><|begin▁of▁sentence|><|begin▁of▁sentence|><|begin▁of▁sentence|><|begin▁of▁sentence|><|begin▁of▁sentence|><|begin▁of▁sentence|><|begin▁of▁sentence|><|begin▁of▁sentence|><|begin▁of▁sentence|><|begin▁of▁sentence|><|begin▁of▁sentence|><|begin▁of▁sentence|><|begin▁of▁sentence|><|begin▁of▁sentence|><|begin▁of▁sentence|><|begin▁of▁sentence|><|begin▁of▁sentence|><|begin▁of▁sentence|><|begin▁of▁sentence|><|begin▁of▁sentence|><|begin▁of▁sentence|><|begin▁of▁sentence|><|begin▁of▁sentence|><|begin▁of▁sentence|><|begin▁of▁sentence|><|begin▁of▁sentence|><|begin▁of▁sentence|><|begin▁of▁sentence|><|begin▁of▁sentence|><|begin▁of▁sentence|><|begin▁of▁sentence|><|begin▁of▁sentence|><|begin▁of▁sentence|><|begin▁of▁sentence|><|begin▁of▁sentence|><|begin▁of▁sentence|><|begin▁of▁sentence|><|begin▁of▁sentence|><|begin▁of▁sentence|><|begin▁of▁sentence|><|begin▁of▁sentence|><|begin▁of▁sentence|><|begin▁of▁sentence|><|begin▁of▁sentence|><|begin▁of▁sentence|><|begin▁of▁sentence|><|begin▁of▁sentence|><|begin▁of▁sentence|><|begin▁of▁sentence|><|begin▁of▁sentence|><|begin▁of▁sentence|><|begin▁of▁sentence|><|begin▁of▁sentence|><|begin▁of▁sentence|><|begin▁of▁sentence|><|begin▁of▁sentence|><|begin▁of▁sentence|><|begin▁of▁sentence|><|begin▁of▁sentence|><|begin▁of▁sentence|><|begin▁of▁sentence|><|begin▁of▁sentence|><|begin▁of▁sentence|><|begin▁of▁sentence|><|begin▁of▁sentence|><|begin▁of▁sentence|><|begin▁of▁sentence|><|begin▁of▁sentence|><|begin▁of▁sentence|><|begin▁of▁sentence|><|begin▁of▁sentence|><|begin▁of▁sentence|><|begin▁of▁sentence|><|begin▁of▁sentence|><|begin▁of▁sentence|><|begin▁of▁sentence|><|begin▁of▁sentence|><|begin▁of▁sentence|><|begin▁of▁sentence|><|begin▁of▁sentence|><|begin▁of▁sentence|><|begin▁of▁sentence|><|begin▁of▁sentence|><|begin▁of▁sentence|><|begin▁of▁sentence|><|begin▁of▁sentence|><|begin▁of▁sentence|><|begin▁of▁sentence|><|begin▁of▁sentence|><|begin▁of▁sentence|><|begin▁of▁sentence|><|begin▁of▁sentence|><|begin▁of▁sentence|><|begin▁of▁sentence|><|begin▁of▁sentence|><|begin▁of▁sentence|><|begin▁of▁sentence|><|begin▁of▁sentence|><|begin▁of▁sentence|><|begin▁of▁sentence|><|begin▁of▁sentence|><|begin▁of▁sentence|><|begin▁of▁sentence|><|begin▁of▁sentence|><|begin▁of▁sentence|><|begin▁of▁sentence|><|begin▁of▁sentence|><|begin▁of▁sentence|><|begin▁of▁sentence|><|begin▁of▁sentence|><|begin▁of▁sentence|><|begin▁of▁sentence|><|begin▁of▁sentence|>"
2048,2048,82.64,128,25.50,52184460

rmhubbert avatar Jun 17 '26 23:06 rmhubbert