You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[Engine] inkling2 cuda-ep2: GPU 0 holds the trunk and all 48 KV visits - split the global KV across both cards (12 GB pairs spend 4 GiB of reserve and 383 host experts on it) #6915
[Engine] (speed, kernels, models, the server and API)
Desktop app, Terminal or source?
Source: cobra91/Strata-DualGPU @ perf/inkling2-iq2-moe (e68cde9b37, engine 0.1.66), built standalone with CUDA 13.0.48 for sm_86.
What I would like
In cuda-ep2, all KV lives on GPU 0 while GPU 1 holds only routed experts. On a pair of equal cards that makes GPU 0's VRAM the hard bound on context, and every GiB reserved for the cache is an expert pushed to the host tier. I would like an opt-in way to place some of the KV on GPU 1 — the 8 global KV visits are the obvious candidates (4 on each card), or shard by the device that owns each layer's experts.
This is a feature request, not a bug report; the current behaviour is coherent, it is just expensive on symmetric 12 GB pairs.
What I measured (2x RTX 3060 12 GB, sm_86, Linux, PHB, p2p=0)
At 0 reserve the split is clean (1536 GPU0 + 1536 GPU1, 0 host), so the 383 host experts exist only because a 4 GiB reserve has to come out of one card. The same file at either UD-Q4_K_XL (17.63 GB) or UD-IQ4_XS spills 384 / 383 experts at 4096 — the reservation, not the model size, sets that number.
Depth curve with the cache fully resident: 46 tok/s at 4K, 44 at 8K, 36 at 16-22K, 30 at 32K, 26.4 at 112K. llama.cpp on the same cards with the same weights is 29.8 flat to 160K, so this engine is 88 % of it at 110K — the gap is exactly the single-card KV bound plus the 160K context llama.cpp can reach by splitting layers and cache.
Prior art in this project
@EliahHofmann reports in #6811 a prompt-attention split for ik2: GPU 1 keeps a copy of the full-layer K/V rows (4.1 GiB) and takes a chunk of keys [0, s), GPU 0 merges one partial per (query, head) — 253K-token prefill 377 s -> 271 s, decode 22.8 -> 41.7 tok/s; 144K decode 32.8 -> 50.2. That is the same idea at the attention level and suggests it pays.
Expected behaviour
With --kv k8v4 --max-context 131072 on 2x12 GB: either no host expert tier, or a much smaller one (the ~380 experts we spill now would buy ~1.2 GiB, i.e. about a third of the reserve needed at 112K). Cross-GPU attention merges per visit would be the cost, which the zero-copy mapped staging in #6815 already provides a mechanism for.
What I did not test
No source changes; this is a request based on measurements only.
Not tested on asymmetric pairs (5080 + 4060 Ti), where the core-on-GPU-0 placement is the right trade and this change should stay off.
Single run per cell, synthetic prompt ids, no drafter, no quality or recall checks.
Full context and the other numbers are in #6811 (comments of 2026-11-23, including the k8v4/4096 table and the falsified IQ4_XS hypothesis).
Activity