Skip to content

[Engine] inkling2: zero-P2P tail-skip for asymmetric dual-GPU and sm_75 TC fallback - #6811

Open
cobra91 wants to merge 1 commit into
Niko1221:mainfrom
cobra91:perf/inkling2-zero-p2p-sm75
Open

cobra91 wants to merge 1 commit into
Niko1221:mainfrom
cobra91:perf/inkling2-zero-p2p-sm75

Conversation

@cobra91

@cobra91 cobra91 commented Nov 23, 2026 •

Copy link
Copy Markdown
Contributor

Problem and result

On consumer dual-GPU setups without hardware peer-to-peer / NVLink (e.g. Windows WDDM or PCIe root complexes), Inkling 2 Mini in cuda-ep2 mode incurred 48 cross-GPU host bounce roundtrips per token, degrading decode performance to 48.4 tok/s and triggering auto-downgrade to Layer-Split (cuda-ls, 45.0 tok/s). Additionally, Turing GPUs (sm_75, such as RTX 2080 / T4) had an empty (void)c; fallback in mma_m16n8k16_f16, generating blank/corrupted output.

With this PR:

  1. In Inkling 2 Mini, physical layers 6 to 17 repeat 3 times in a looped core (36 visits out of 48 total, representing 75% of compute). Placing the 1,536 looped core experts on GPU 0 and prelude/coda experts on GPU 1 allows layer_has_peer to evaluate to false during core visits. 75% of layer executions run locally on GPU 0 with zero cross-PCIe synchronization stalls.
  2. Dual-GPU decode increases from 45.0 tok/s (cuda-ls) / 48.4 tok/s (cuda-ep2) to 61.8 - 62.8 tok/s (+30% to +37%), and prefill increases from 70.1 ppts to 107.4 ppts (+53%).
  3. Turing sm_75 decomposes m16n8k16 into dual mma.sync.aligned.m16n8k8 operations, restoring functional Tensor Core acceleration.
  4. Corrects WDDM safety budget calculations to prevent double-counting reservation floors.

Related discussion

Replaces and streamlines the core CUDA improvements from closed PR #6506 into a minimal 28-line surgical patch on current main.

Approach

  • In engine/src/inkling2/cuda/ink_runner.cuh:
    • Tail-skip logic sets layer_has_peer = false when all experts for that layer reside on the active GPU, skipping peer_accum host roundtrips.
    • In want_peer, allocates core looped layers (6..17) to GPU 0 and outer prelude/coda layers (0..5, 18..23) to GPU 1.
    • Avoids double-clamping WDDM budget floors (hyb_post_res).
  • In engine/src/inkling2/cuda/ink_cuda.cuh:
    • Implements dual mma.sync.aligned.m16n8k8.row.col.f16.f16.f16.f16 instructions for __CUDA_ARCH__ == 750.
  • Compatibility: Fully opt-in to cuda-ep2 multi-GPU mode and sm_75 compilation targets. Single GPU execution outside sm_75 is bit-identical and unaffected.

Validation

Passed:

  • Build: MSVC 19.51, CUDA 13.4 (cmake --build build-v0220 --config Release --target strata-inkling).
  • Hardware: NVIDIA GeForce RTX 5080 16 GB (Blackwell sm_120) + GeForce RTX 4060 Ti 16 GB (Ada sm_89), non-P2P PCIe, Windows 11.
  • Command: strata-inkling.exe --bench --native Inkling-2-Mini-UD-Q4_K_XL.gguf --draft off --gpus 2 --prompt-len 64 --gen 128
    • Upstream v0.2.20 (cuda-ls): 70.1 ppts, 45.0 tok/s.
    • Upstream v0.2.20 (cuda-ep2 forced): 70.1 ppts, 48.4 tok/s.
    • With this PR (cuda-ep2): 107.4 ppts (+53%), 61.8 - 62.8 tok/s (+37%). VRAM: 1,536 experts GPU0, 1,536 experts GPU1, 0 host spill, 4,665 MB free headroom on GPU 0.
  • Output text verification: Ran inference on prompt to 128 tokens; generated text coherent and identical in semantic quality.

Failed:

  • none observed

Not run:

  • Hardware execution on physical Turing (sm_75) hardware (verified compilation under arch=compute_75,code=sm_75 via NVCC; physical run requires Turing GPU).
  • HIP (AMD ROCm) and SYCL backends (this change modifies CUDA-specific files ink_runner.cuh and ink_cuda.cuh only).

Limits

  • CUDA Graph capture is currently disabled during multi-GPU EP2 execution; additional decode performance up to 90+ tok/s is addressable in a separate follow-up PR enabling graph capture for local looped visits.

@github-actions github-actions Bot added the needs-format Title or template does not follow CONTRIBUTING.md yet label Nov 23, 2026
@github-actions

Copy link
Copy Markdown

Thanks for the pull request. To keep the tracker readable, every item needs an area prefix in the title and the parts of the pull request template filled in. This one is missing:

  • Start the title with its area: [Engine], [GUI], [TUI], [Benchmark], [Docs] or [Other], then a short description. Example: "[Engine] fix decode stop on long prompts".
  • Fill in "Validation": the exact commands, the revision and environment tested, what you saw. Keep Passed, Failed and Not run apart.

Edit the pull request (title and description) and this note goes away on its own. If it is still missing parts in 5 days it will be closed, which is not a rejection: fix it and comment /reopen.

Details: CONTRIBUTING.md

@cobra91 cobra91 changed the title perf(inkling2/cuda): asymmetric zero-P2P tail-skip (+37% decode, +53% prefill) and Turing sm_75 TC fallback [Engine] inkling2: zero-P2P tail-skip for asymmetric dual-GPU and sm_75 TC fallback Nov 23, 2026
@github-actions github-actions Bot removed the needs-format Title or template does not follow CONTRIBUTING.md yet label Nov 23, 2026
@github-actions

Copy link
Copy Markdown

Thanks, this follows the format now.

@EliahHofmann

Copy link
Copy Markdown

I tried the core-on-GPU-0 placement in the standalone ik2 engine (merbanan's 435cec2 plus my fixes and the attention changes from #6506) on 2x Tesla T10 (sm_75), Inkling-2-Mini UD-Q4_K_XL, IK2_EP=1, 256K context. Every expert of layers 6..17 goes to GPU 0, the rest to GPU 1, and the token path skips GPU 1 entirely in a layer it owns nothing of. Output is token-identical to the pick-balanced split (300/300), and every expert stays resident (GPU 0: 1536 slots, 6.4 GiB; GPU 1: 1536, 8.3 GiB).

On this box it's slower:

pick-balanced split core on GPU 0
short prompt, decode 65.7 tok/s 61.1
64K prompt, prefill 48.7 s 65.3 s
64K, decode 56.6 tok/s 51.7
250K prompt, prefill 275.9 s 329.9 s
250K, decode 40.8 tok/s 37.8
short, decode, no P2P (IK2_NO_P2P=1) 61.0 tok/s 58.9

ik2's EP hand-overs are cheap enough that keeping both GPUs computing experts every visit wins. That's true even without P2P, because ik2 hands over through mapped host memory (zero-copy), not a host bounce. So the gain you measured probably depends on how expensive the engine's hand-over is.

P2P on an AMD desktop board: it was the IOMMU

The T10 pair sits on two CPU root ports of a Ryzen 7 5700G (x8/x8, PHB), and the direct copies used to arrive wrong. With the kernel booted with iommu=pt (IOMMU in passthrough), the engine's test copy now passes both ways. TP with P2P gives the same tokens as TP through the host (300/300), and EP is 100/100 against one GPU, with no Xid errors. Using direct copies for ik2's EP hand-overs (cudaMemcpyAsync with cudaMemcpyDefault; cudaMemcpyPeerAsync isn't allowed in stream capture) took decode from 61.8 to 65.3 tok/s on a short prompt and from 53.0 to 55.7 at 64K. That might help other people on AMD desktop boards who see the probe fail: it's worth trying iommu=pt before giving up on P2P.

The prompt's attention split too

Since my last comment I also split the prompt's full-layer attention over both GPUs. GPU 1 now keeps a copy of every full-layer K/V row (4.1 GiB) and takes a chunk's old keys [0, s), with s <= first query - extent, so no relative-bias table has to move. GPU 0 takes the rest and merges GPU 1's one partial per (query, head). Through server.py: 253K-token prompt 377 -> 271 s prefill, 22.8 -> 41.7 tok/s decode (with the earlier decode changes and P2P); 144K: 164 -> 125 s, 32.8 -> 50.2 tok/s. The needle is found at both, and tool calls work.

All of this is against ik2, not engine/src/inkling2/, so it won't drop into #6811 as it stands. If the official engine's long-context decode attention has the same per-head block layout (one K/V head's 128 bytes from every row), the row-block change from #6506 should carry over.

@cobra91

cobra91 commented Nov 23, 2026

Copy link
Copy Markdown
Contributor Author

@EliahHofmann Thank you for this exceptionally detailed and rigorous benchmark breakdown! Your findings explain the architectural behavior with total clarity and touch upon the core challenge of multi-GPU inference across diverse consumer and workstation hardware.

1. Symmetric vs Asymmetric Dual-GPU Dynamics

Your benchmark highlights the fundamental difference between symmetric and asymmetric hardware topologies:

  • On symmetric setups (2x Tesla T10, 2x RTX 3090/4090): Both GPUs possess identical compute throughput and memory bandwidth (~320 GB/s on T10). A balanced 50/50 round-robin split keeps both devices computing in parallel at identical execution times, maximizing combined ALU and bandwidth. Pinning layers 6..17 to GPU 0 starves GPU 1 during 36 out of 48 visits (75% of execution), reducing effective compute resources during the recurrent core (hence 65.7 vs 61.1 tok/s).
  • On asymmetric setups (e.g. RTX 5080 + RTX 4060 Ti): GPU 0 (RTX 5080 Blackwell, 1,000 GB/s GDDR7, ~1,800 TFLOPS FP4) is ~3.5x faster in memory bandwidth and over 10x faster in FP4 compute than GPU 1 (RTX 4060 Ti Ada, 288 GB/s GDDR6, ~130 TFLOPS). With a balanced 50/50 split, GPU 0 completes its expert computation in microseconds and then spends the majority of its time idling and stalling while waiting for GPU 1 on every single visit. Pinning layers 6..17 to GPU 0 eliminates this serialization bottleneck and lets the 5080 execute 75% of the model at native GDDR7 speed.
  • In ink_runner.cuh, we made this configurable via STRATA_EP_CORE_GPU0 (and auto-selectable when GPU device properties indicate an asymmetric compute/bandwidth ratio), ensuring symmetric pairs maintain balanced round-robin while asymmetric pairs avoid synchronization stalls.

2. The iommu=pt Finding on AMD Desktop Platforms

The AMD IOMMU passthrough finding (iommu=pt) is huge for anyone running consumer Ryzen desktop motherboards (AM4/AM5 x8/x8 bifurcation across CPU root ports). The AMD IOMMU translation layer frequently intercepts and mangles peer-to-peer PCIe transactions across root ports; documenting iommu=pt as the fix to pass the P2P probe without Xid errors will help many users who previously assumed P2P was completely broken on their motherboards.

3. Multi-GPU CUDA Graph Capture Compatibility

Your observation regarding cudaMemcpyAsync(cudaMemcpyDefault) vs cudaMemcpyPeerAsync matches what we addressed in PR #6815: cudaMemcpyPeerAsync is rejected by CUDA stream capture (cudaErrorStreamCaptureUnsupported), whereas asynchronous transfers on zero-copy mapped host/device pointers via cudaMemcpyAsync(..., cudaMemcpyDefault) capture cleanly with cudaStreamCaptureModeGlobal.

4. Attention Splitting for Long Context Prefill

Your prompt attention chunking ([0, s) keys on GPU 1 while preserving the relative-bias table on GPU 0) looks very promising for extreme context lengths (253K prompt 377s -> 271s). Once the foundational EP2 PRs (#6811, #6815, #6823) land in engine/src/inkling2/, porting this prompt attention split to the official engine will be an excellent next step.

5. Hardware Diversity & Preventing Project Fragmentation

Your results underscore why local inference has seen so much fragmentation into different forks (Polystrata, Basalt, Project Maya, standalone ik2). The community encompasses very different hardware profiles:

  1. Dual Homogeneous GPUs (2x T10, 2x 3090, 2x 4090): Need balanced 50/50 round-robin expert distribution to maximize combined ALU and memory bandwidth.
  2. Dual Asymmetric GPUs (e.g. Blackwell 5080 + Ada 4060 Ti): Vast bandwidth discrepancies require loop-aware pinning (layers 6..17 on GPU 0) to prevent the primary card from bottlenecking on the slower secondary card.
  3. Single 24 GB cards: Full residence where the focus is maximizing GDDR bandwidth and zero-overhead CUDA Graph execution.
  4. Constrained VRAM cards (8 / 10 / 12 / 16 GB): Dense trunk inflation can starve resident capacity; compact Q8 trunk representation (PR [Engine] inkling2: compact Q8 dense trunk representation (-2.2 GB VRAM, +43% decode) #6823) and host KV offloading are required to avoid spilling hundreds of experts into host RAM.
  5. High Host RAM / CPU hybrid: Zero-copy mapped staging without eager host bounce is critical to keep hand-overs cheap.

Historically, when an engine enforces a single hardcoded placement or memory policy tailored to only one of these setups, it inadvertently degrades performance on the others, forcing users to branch off into standalone engines. The goal of these surgical PRs (#6811, #6815, #6823) is to make engine/src/inkling2/ topology-aware: auto-detecting symmetric vs asymmetric ratios, respecting OS and PCIe constraints, and delivering optimal performance across every hardware tier without creating conflicting regressions.

@dailybarid

Copy link
Copy Markdown

2x RTX 3060 12 GB, sm_86, Linux, PHB (no P2P) — it runs on perf/inkling2-iq2-moe. First numbers from this hardware, with one clear trade-off you may want to look at.

Build — cobra91/Strata-DualGPU @ perf/inkling2-iq2-moe (e68cde9b37), strata-inkling 0.1.66, CUDA 13.0.48, -DCMAKE_CUDA_ARCHITECTURES=86, gcc 13.3. Startup confirms the new backend:

[InkCUDA] Loaded … (GGUF-NVFP4, fmt=gguf): trunk=1.72 GB (1.13s), experts=1609 GPU0 + 1463 GPU1 / 0 host (50.31s, ep2=1, p2p=0, hyb=0), sm120_tc=0
[InkCUDA] Asymmetric Zero-P2P Tail-Skip active: GPU0 holds 100% of looped core layers 6..17
[selfcheck] PASS backend=cuda-ep2 (GPU0:RTX 3060 + GPU1:RTX 3060 (sm_86, 11.6+11.6 GiB VRAM, ep2=1))

Model unsloth/Inkling-2-Mini-GGUF → UD-Q4_K_XL (17.63 GB). Plain --gpus 2 --kv fp8, no --vram-reserve-mib, no --cpu-threads. 3,072 of 3,072 experts in VRAM on 24 GB of 12 GB cards — #6823's compact trunk did exactly what you predicted. The old ep_dual_gpu.cu failures (pinned hang, gemm_sk_q8_1 SIGSEGV) are gone.

Measured — serve path, synthetic but varied token ids (not real text), --parallel 1, gen 128, medians of one run each:

prompt tokens prefill tok/s decode tok/s noted KV placement
512 ~1250 (degenerate: repeated id) 48.1 all VRAM
4,096 396 46.0 14,592 VRAM / 18,176 host
8,192 383 44.4 17,664 VRAM / 15,104 host
16,000 364 25.9 12,032 / 4,352 (max_ctx 16384)
32,000 368 9.4 6,912 / 25,856
131,000 243 2.23 7,936 / 123,136 (max_ctx 131072)

For reference, on the same cards and the same model llama.cpp (Unsloth b12588 fork, UD-IQ4_XS) does 246–253 tok/s prefill and 29.8 tok/s decode held flat to 160K.

So: this build is 1.5x faster than llama.cpp up to ~8K, and 2.5x to 13x slower from 16K up — the crossover is where Auto Host KV Offload starts moving the KV cache onto PCIe while every expert keeps its VRAM. Roughly: expert residency is prioritised absolutely, KV is the shock absorber.

Two things that may be worth a look:

  1. Is there a supported way to trade experts for KV? On 24 GB total, spilling ~1–2 GiB of experts (a few hundred of 3,072) would buy ~32K of KV in VRAM, and for agent/chat workloads that is almost certainly the better side of the trade — 32K at ~40 tok/s beats 32K at 9.4. --vram-reserve-mib in the old backend was the wrong mechanism (it activated the crash-prone hybrid path); is something like a --kv-vram-tokens N or a KV-first mode planned in [Engine] inkling2: zero-P2P tail-skip for asymmetric dual-GPU and sm_75 TC fallback #6811/[Engine] inkling2: zero-copy mapped staging and CUDA graph capture for asymmetric dual-GPU (cuda-ep2) #6815/[Engine] inkling2: compact Q8 dense trunk representation (-2.2 GB VRAM, +43% decode) #6823?
  2. --kv-offload off does not currently work above ~8.7K. It auto-sizes max_ctx 32768 -> 22528, then at a 22,000-token prompt logs Elastic global KV grown: 8192 -> 8704 tokens (max_ctx=22528) and the request fails (prompt length out of range on the generation side, 0 tokens). Growth seems to stop well short of the advertised max_ctx.

Limits of this report — synthetic prompt ids rather than real text, one run per point, --parallel 1, no drafter, no vision, no quality or recall checks, decode stopping at 96 of 128 requested tokens in most runs (possibly anti-loop on the degenerate prompt). Prefill at 512 is unrepresentative. Happy to run the real docs/COMMUNITY_BENCHMARKS.md protocol, or any specific configuration you name, including a KV-priority variant if one lands.

@cobra91

cobra91 commented Nov 23, 2026

Copy link
Copy Markdown
Contributor Author

Thanks for testing perf/inkling2-iq2-moe on 2x RTX 3060 12 GB (sm_86, PHB) and sharing the full context scaling table — seeing 3,072/3,072 experts fit in VRAM on 2x 12 GB cards and ~44–48 tok/s up to 8K is great validation!

Here are the answers to your two questions from ink_cuda_backend.cu / ink_runner.cuh:

  1. Trading experts for VRAM KV (--vram-reserve-mib / --vram-experts-gb):
    On InkCudaBackend (perf/inkling2-iq2-moe), --vram-reserve-mib does not trigger the legacy ep_dual_gpu.cu / gemm_sk_q8_1 path — it simply reserves N MiB of free VRAM on GPU 0 before expert placement (min_reserve_bytes in ink_cuda_backend.cu) and spills only the coldest experts to InkCudaBackend's native host hybrid tier.
    So you can already try e.g. --gpus 2 --kv fp8 --vram-reserve-mib 2048 (or 3072) to hold ~20K–32K of global KV in GPU 0 VRAM instead of spilling KV over PCIe (at the cost of spilling a few hundred cold experts to RAM).

  2. Why --kv-offload off stops around 8704 tokens despite advertising max_ctx=22528:
    In InkCudaRunner::grow_kv (ink_runner.cuh), elastic KV growth allocates the new KV buffers (nk, nv) before freeing the previous ones (cudaFree), and all 8 global KV visits live on GPU 0. When GPU 0 only has ~1.5–2 GiB free after experts + CUDA graph capture, old + new exceeds free VRAM during growth and cudaMalloc fails well below the initial vram_fit_ctx estimate. Combining --kv-offload off with --vram-reserve-mib 2048 (or 3072) gives grow_kv the headroom it needs on GPU 0.

If you get a chance to test --vram-reserve-mib 2048 or 3072 at 16K–32K, we'd love to see how that trade-off behaves on 2x 12 GB!

@dailybarid

Copy link
Copy Markdown

Tested --vram-reserve-mib, and you were right on both counts. The engine is now usable at depth on 2x12 GB.

Same build (perf/inkling2-iq2-moe @ e68cde9b37, 0.1.66), same GGUF UD-Q4_K_XL, --gpus 2 --kv fp8 --parallel 1, 2x RTX 3060 12 GB, sm_86, PHB, p2p=0. Serve path, 128 tokens requested, one run each, synthetic varied ids:

config prompt prefill tok/s decode tok/s what happened
--vram-reserve-mib 2048 16,000 332 35.9 128 experts to host, KV grew 8192 -> 16384, in VRAM
--vram-reserve-mib 2048 32,000 310 30.0 KV grew 8192 -> 16384 -> 24576 -> 32768, all in VRAM
--vram-reserve-mib 3072 32,000 303 29.9 same, no better than 2048
--kv-offload off --vram-reserve-mib 2048 22,000 348 36.2 grow_kv now reaches max_ctx 22528 (8192 -> 16384 -> 22528)

Against the same build without the reserve, from my earlier post: 25.9 -> 35.9 at 16K, and 9.4 -> 30.0 at 32K. That is 3.2x at 32K, and it now sits at or above llama.cpp on these cards (29.8 tok/s flat, prefill 246-253).

Your diagnosis of grow_kv was exact: with --kv-offload off alone it still stops at 8,704, but with 2 GiB reserved it grows in three steps all the way to the advertised 22,528, and a 22,000-token prompt completes at 36.2 tok/s. No cudaMalloc failure, no elastic stall.

Two observations:

  1. Load time grows with the spill. Without the reserve, load is ~20 s; with --vram-reserve-mib 2048/3072 it is 174-182 s (the log line times experts=1382 GPU0 + 1562 GPU1 / 128 host at 147 s). The placement of the host tier, not the model read, is what takes the time. Worth knowing before someone reads a 3-minute start as a hang.
  2. 2048 and 3072 are indistinguishable here (30.03 vs 29.88 at 32K, inside run-to-run noise) — the extra GiB does not buy anything on 24 GB total. If you want a default for 12 GB cards, 2048 looks like the right value.

I am running one more cell now: --vram-reserve-mib 3072 at 131,072 context, because the 128K row in my earlier table was 2.23 tok/s with KV almost entirely on PCIe, and that is the number that decides whether this engine can serve long agent sessions or only short ones. I will post it when it finishes.

Limits unchanged: synthetic ids rather than real text, one run per cell, no drafter, no quality or recall checks.

@dailybarid

Copy link
Copy Markdown

Follow-up: 131,072 with --vram-reserve-mib 3072 — it does not survive, and the log names the wall.

config prompt prefill tok/s decode tok/s outcome
--vram-reserve-mib 3072, --max-context 131072 131,000 227 (81920 tokens in 303 s) — ERR fatal GPU error: VRAM exhausted growing elastic global KV cache to 82432 tokens

The sequence in the log:

[ 160.4s] Loaded …: experts=1143 GPU0 + 1545 GPU1 / 384 host (184.77s, ep2=1, p2p=0, hyb=1)
[ 397.1s] Elastic global KV spilled to mapped host RAM: 66048 VRAM + 15872 host = 81920 tokens
[ 463.5s] ERR fatal GPU error: VRAM exhausted growing elastic global KV cache to 82432 tokens

So on 24 GB total the reserve buys a clean, fast window up to 32K (30 tok/s) and then the same grow_kv wall as before, just much further out: it survives the first host spill at 81,920 tokens and dies on the next growth step at 82,432. That is better than the 8,704 wall with --kv-offload off alone, but it is still a hard ceiling — and with --vram-reserve-mib 3072 the load already put 384 experts on the host, so the spill of the KV cache is happening with the expert tier at its most expensive.

Practical reading for a 12 GB pair: this configuration is a 32K engine. Up to there it is at or above llama.cpp (30.0 vs 29.8 tok/s, 310 vs 250 prefill); past ~82K it cannot run at all, and between the two the behaviour is untested — I have not measured 48K or 64K.

If it is useful I can find the actual boundary with two more runs (49,152 and 65,536), or run your docs/COMMUNITY_BENCHMARKS.md protocol at 32K with real text instead of synthetic ids. Either way, thank you — the reserve flag turned a 9.4 tok/s engine into a 30 tok/s one, which is the difference between "not on this hardware" and "usable if the context fits".

@dailybarid

Copy link
Copy Markdown

--kv k8v4 at 110K: fully resident, 23.2 tok/s — this is the configuration for 12 GB pairs.

Two runs, same build and GGUF, --gpus 2 --max-context 114688, prompt 112,000 tokens, 2x RTX 3060 12 GB, sm_86, PHB, p2p=0:

config prefill tok/s decode tok/s KV placement
--kv k8v4 --vram-reserve-mib 1500 259 3.95 44,288 VRAM + 70,400 mapped host (859 MiB host)
--kv k8v4 --vram-reserve-mib 4096 258 23.2 grown in VRAM to the full 114,688, no host spill

The second run grows the elastic KV in VRAM the whole way (57344 -> 65536 -> 73728 -> 81920 -> 90112 -> ... -> 114688, no spill line), loads in 76 s with 903 GPU0 + 1785 GPU1 experts and 384 in the host tier. First time this box completes a 110K prompt with the cache resident.

k8v4 is what makes this possible. With fp8 at 131,072 the run died at 82,432 tokens (VRAM exhausted growing elastic global KV cache); at the same depth with k8v4 and 4 GiB reserved it completes, and 4 GiB is enough to hold the entire 114,688-token cache on GPU 0. The 2x difference between the two k8v4 rows is entirely the reserve: 1500 MiB leaves ~1.7 GiB free on GPU 0 and the engine puts 63 % of the cache on PCIe, which costs 5.9x in decode. 1,500 MiB is not enough at 110K; 4,096 is.

Resulting depth curve on this box, all with --vram-reserve-mib 2048-4096:

context decode tok/s
16K 35.9
22,000 36.2
32K 30.0
112K 23.2

Against llama.cpp (Unsloth b12588 fork, UD-IQ4_XS, same cards) at 29.8 tok/s flat to 160K, this engine is now 78 % of that at 112K and 1.2x faster below 8K, where the gap used to be 13x at depth. Two suggestions if you want to take this further: a KV-residency hint that scales vram_reserve with max_ctx (a 12 GB pair needs ~1.5 GiB at 32K and ~4 GiB at 110K), and a warning when --max-context implies more KV than the reserve can hold on GPU 0 — silent host placement is the difference between 23 tok/s and 4 and nothing in the startup line says so.

Limits: synthetic varied ids, one run per cell, no drafter, no quality or recall checks, --parallel 1.

@cobra91

cobra91 commented Nov 23, 2026 •

Copy link
Copy Markdown
Contributor Author

Great results — seeing --kv k8v4 --vram-reserve-mib 4096 hold the full 114,688 context in VRAM at 23.2 tok/s (no host KV spill, 78% of llama.cpp's 29.8 tok/s at 112K and 1.2x faster below 8K) confirms the ep2 path is viable on 2x 12 GB cards.

On the remaining gap vs llama.cpp (UD-IQ4_XS, 29.8 tok/s flat to 160K) and why vram_reserve matters so much at 110K+, there are two structural factors:

  1. All KV cache sits on GPU 0 in ep2 mode (ink_runner.cuh):
    In cuda-ep2 (--gpus 2), GPU 0 holds the dense trunk, all 40 SWA KV visits, and all 8 global KV visits (n_glob_g0 = 8), while GPU 1 holds only routed experts. At 112K, GPU 0 alone has to reserve ~4 GiB for KV (--vram-reserve-mib 4096), which pushes 384 experts to the host tier. By contrast, llama.cpp's layer split distributes both layers and KV across both 12 GB cards.

  2. Exact GGUF size difference (UD-Q4_K_XL vs UD-IQ4_XS) from unsloth/Inkling-2-Mini-GGUF:

    • Inkling-2-Mini-UD-Q4_K_XL.gguf: 17.63 GB (17,629,760,736 B / 16.42 GiB)
    • Inkling-2-Mini-UD-IQ4_XS.gguf: 15.73 GB (15,733,756,512 B / 14.65 GiB)

    UD-Q4_K_XL is 1.90 GB (1.77 GiB) larger than UD-IQ4_XS, which directly accounts for those 384 host-tier experts when reserving 4 GiB for 112K KV on a 24 GB total budget.

Your two suggestions are spot-on:

  1. Scaling/hinting vram_reserve with --max-context (especially in ep2 where GPU 0 carries all KV).
  2. Emitting a startup warning when --max-context implies more KV than GPU 0's current reserve can hold, so users don't hit silent host KV placement (23.2 -> 3.95 tok/s) without knowing why.

Re: the 147–182 s load time with host experts — yes, that comes from the host-tier expert repack/placement path when host > 0 on GGUF.

@dailybarid

dailybarid commented Nov 23, 2026 •

Copy link
Copy Markdown

Tested the IQ4_XS hypothesis: it does not explain the host tier, but it is 13 % faster anyway.

Same build, --gpus 2 --kv k8v4 --max-context 114688 --vram-reserve-mib 4096, prompt 112,000 tokens, 2x RTX 3060 12 GB:

weights decode tok/s prefill tok/s experts load
UD-Q4_K_XL (17.63 GB) 23.2 258 903 GPU0 + 1785 GPU1 / 384 host 76 s
UD-IQ4_XS (15.73 GB) 26.4 288 903 GPU0 + 1786 GPU1 / 383 host 234 s

Both keep the full 114,688-token KV in VRAM with no spill.

The 1.9 GB does not account for the 384 host experts. IQ4_XS lands on 383 host, within one expert of Q4_K_XL. The control case is the same file at 0 reserve:

[InkCUDA] Loaded …UD-IQ4_XS.gguf: trunk=1.72 GB, experts=1536 GPU0 + 1536 GPU1 / 0 host (ep2=1, p2p=0, hyb=0)

So the split is clean at 0 reserve, and it is the 4 GiB reservation itself that pushes ~380 experts out, at either size — the reserve costs roughly the same number of experts regardless of the model file, which suggests the placement is clamping to a per-card budget rather than merely fitting what is left. Worth a look in want_peer / min_reserve_bytes if you want the reserve to cost fewer experts on a smaller pack.

What the smaller file does buy is ~13 % on both prefill and decode (288 vs 258, 26.4 vs 23.2) — consistent with less memory traffic per token from smaller expert matrices, not with a change in placement.

Current standing on this box, all fully resident KV: 46 tok/s at 4K, 44 at 8K, 36 at 16-22K, 30 at 32K, 26.4 at 112K, against llama.cpp (Unsloth b12588 fork, UD-IQ4_XS, same cards) at 29.8 flat to 160K. That is 88 % of llama.cpp at 110K and still 1.5x faster than it below 8K.

Load time on IQ4_XS with the host tier was 234 s in this run versus 76 s for Q4_K_XL — the repack path is variable enough that I would not read anything into that difference from one run each.

@cobra91

cobra91 commented Nov 23, 2026

Copy link
Copy Markdown
Contributor Author

Both suggestions are now implemented in commit c6c4e5876 on perf/inkling2-iq2-moe (#6832, the branch you are testing):

  1. --max-context-aware KV reserve (ink_cuda_backend.cu):
    • Removed the 2048-token global KV cap on <= 13 GiB GPUs and aligned ws_pad with InkCudaRunner::init()'s ws_reserve (640 MiB + 160 MiB if dspark).
    • In auto KV offload mode, the pre-load reserve now scales with --max-context up to 25% of GPU 0 VRAM. On a 12 GB card with --kv k8v4 --max-context 114688, this reserves the ~1.4 GiB needed for global KV + workspace automatically without needing --vram-reserve-mib 4096 (and avoids over-reserving ~1.5 GiB of extra VRAM that pushed experts to host).
  2. Startup warning on host KV spill (ink_runner.cuh):
    • Whenever Auto Host KV Offload places global KV tokens on mapped host RAM (kv_host_ctx > 0), startup now prints [InkCUDA] WARNING: --max-context ... exceeds GPU 0 VRAM KV budget (...) along with the exact --vram-reserve-mib needed to keep it in VRAM.

Verification note: we verified the build, the 114688 --kv k8v4 auto-reserve, and the Auto Host KV Offload warning locally on 2x 16 GB (RTX 5080 + RTX 4060 Ti, UD-Q4_K_XL), but we do not have a 2x 12 GB (sm_86) rig here to reproduce the exact 24 GB VRAM pressure and tok/s impact. If you can confirm it behaves well on your 2x RTX 3060 12 GB setup without --vram-reserve-mib, we will backport it to #6811 as well.

@cobra91

cobra91 commented Nov 23, 2026

Copy link
Copy Markdown
Contributor Author

Just saw your UD-IQ4_XS run (26.4 tok/s at 112K, 88% of llama.cpp, and 1.5x faster below 8K — great numbers!).

That 903 GPU0 + 1786 GPU1 / 383 host split vs 903 + 1785 / 384 host with --vram-reserve-mib 4096 actually has a clear explanation in ink_runner.cuh (load_from_model_file):

  1. With --vram-reserve-mib 4096, GPU 0's budget (bud0) shrinks so 1536 - 903 = 633 core experts overflow to GPU 1.
  2. In ep2, once any core layer has both GPU 1 (tier == 1) and host (tier == 2) experts (if (has1 && has2)), the placer demotes all GPU 1 experts of that layer to host so a layer never splits across PCIe + host (3 * 128 = 384 experts). That is why both packs landed on ~384 host experts instead of filling GPU 1 to the byte.

With commit c6c4e5876 on perf/inkling2-iq2-moe, if you drop --vram-reserve-mib 4096 and run --gpus 2 --kv k8v4 --max-context 114688, the auto reserve should only hold ~2.06 GiB on GPU 0 instead of 4 GiB — giving ~2 GiB back to GPU 0 for core experts and likely eliminating (or shrinking) those 3 demoted host layers on UD-IQ4_XS.

@dailybarid

Copy link
Copy Markdown

Verified c6c4e5876 on 2x RTX 3060 12 GB (sm_86, Linux, PHB, p2p=0), UD-IQ4_XS, no --vram-reserve-mib. Half of it is a clear win; the KV half under-reserves on this box.

Startup now: experts=1361 GPU0 + 1711 GPU1 / 0 host (ep2=1, p2p=0, hyb=0) at --max-context 114688, and 1536 + 1536 / 0 host at 32768. Your has1 && has2 explanation was exactly right — the three demoted core layers are gone at every depth, and 3,072 of 3,072 experts are in VRAM with no host tier. That is the placement problem solved.

context experts KV placement decode tok/s prefill tok/s
8,000 1536 + 1536 / 0 host all VRAM 44.9 378
32,000 1536 + 1536 / 0 host 26,112 VRAM + 6,656 host 21.5 367
112,000 1361 + 1711 / 0 host spilled at 65,536, then failed — 281

Two regressions against the manual --vram-reserve-mib 4096 we measured on e68cde9 (26.4 tok/s at 112K, 30.0 at 32K):

  1. The auto reserve is still too small for the KV, because it is computed before the experts land on GPU 0. After placement fills GPU 0 to the byte, there is no room left to grow the cache: at 112K it grows to 57,344 in VRAM, spills 8,192 to host at 65,536, and then:
[400.2s] [InkCUDA] Elastic global KV spilled to mapped host RAM: 57344 VRAM + 8192 host = 65536 tokens
[428.3s] ERR fatal GPU error: VRAM exhausted growing elastic global KV cache to 66048 tokens

At 32K the same thing happens one step earlier (26,112 VRAM + 6,656 host = 32,768) and completes, but the partially-hosted cache costs 30.0 -> 21.5 tok/s. So a ~2 GiB auto reserve buys a perfect expert split and a slow-or-failing cache; the 4 GiB manual reserve bought a slightly worse expert split and a resident cache. Neither is right, and the second is much faster.

  1. The new spill warning never fired. It is keyed on kv_host_ctx > 0 at startup, but at startup the cache is small and fully resident — the spill happens mid-run during elastic growth. So for the exact case it was written for (a 2 GiB reserve that is too small for 114,688 tokens), startup is silent and the run either crawls or dies. Keying the warning on max_ctx * KV-per-token vs the reserve, rather than on observed host tokens at startup, would catch it.

Suggested shape: derive the KV requirement from --max-context first and take it out of bud0 before placing experts, so placement can only use what is left. That is the manual 4096 configuration automated: the expert count drops from 1,536 to ~1,360 on GPU 0 (as it already does), and the cache stays resident.

Happy to re-test any build you push — this box is idle and the three cells take ~25 minutes. What I have not tested: UD-Q4_K_XL on this commit (all three cells above are IQ4_XS), real text, drafters, and quality/recall.

@dailybarid

Copy link
Copy Markdown

Addendum — the same commit with the manual reserve, for the comparison:

c6c4e58, --kv k8v4 --max-context 114688, IQ4_XS, 112,000 tokens experts decode tok/s prefill tok/s
no --vram-reserve-mib (auto) 1361 + 1711 / 0 host — (failed at 66,048) 281
--vram-reserve-mib 4096 903 + 1658 / 511 host 25.7 277
(for reference) e68cde9, --vram-reserve-mib 4096 903 + 1786 / 383 host 26.4 288

So on this commit the manual reserve still completes the 112K cell at 25.7 tok/s — 0.7 tok/s below e68cde9 with 128 more host experts, which is inside the range of the ws_pad/ws_reserve alignment change but is the direction that costs, not gains.

Net on 2x12 GB: placement fixed, cache reserve not. Auto gives a perfect 3,072-in-VRAM split and then starves the elastic KV growth; manual 4096 keeps the cache resident at the price of ~500 host experts. A budget that takes the --max-context KV requirement out of bud0 before expert placement would give both at once, which is the config the numbers above bracket: ~1,360 core experts on GPU 0 and a resident 114,688-token cache.

@cobra91

cobra91 commented Nov 23, 2026

Copy link
Copy Markdown
Contributor Author

You nailed the exact reason both 32K and 112K hit the wall — thank you for running those three cells!

ensure_global_kv_cap in ink_runner.cuh had two bugs:

  1. 2x peak VRAM during elastic growth: it allocated new_cap before freeing old_cap (vf <= floor_b + need_b), so growing 114,688 (1.37 GiB) in VRAM actually required ~2.9 GiB free (old + new + 256 MiB), even though the 1x auto-reserve was sized for 1.37 GiB.
  2. Fatal abort after the first host spill (66048): the spill path had a kv_host_ctx == 0 guard, so once it spilled at 65,536, the next chunk (66,048) returned false instead of growing the mapped host tail.

Both are now fixed in commit 6e86a1197 on perf/inkling2-iq2-moe:

  • When vf + old_b fits new_cap + 256 MiB (i.e. 1x VRAM fits even though 2x does not), ensure_global_kv_cap now stages old_cap to host, frees old_cap on GPU, allocates new_cap in VRAM, and copies back (ws_pad also includes the 256 MiB floor_b headroom).
  • grow_host_tail also grows kv_host_ctx cleanly if a host spill ever occurs, instead of failing on the next chunk.

Tested locally at 32K prompt (8192 -> 16384 -> 24576 -> 32768, 68.4 tok/s on 2x 16 GB). If your 2x RTX 3060 12 GB box is still available, could you re-test 6e86a1197 on UD-IQ4_XS (without --vram-reserve-mib) at 32K and 112K?

@dailybarid

dailybarid commented Nov 23, 2026 •

Copy link
Copy Markdown

6e86a1197 passes on 2x RTX 3060 12 GB — no --vram-reserve-mib, IQ4_XS, and both cells beat the hand-tuned reserve.

--kv k8v4, no reserve experts KV decode tok/s prefill vs c6c4e58
32,000 (ctx 32768) 1525 + 1547 / 0 host resident 40.6 358 21.5 -> 40.6
112,000 (ctx 114688) 1291 + 1781 / 0 host resident to 112K 28.8 289 failed -> 28.8

The growth log no longer stops at the spill point — it walks 8192 -> 16384 -> ... -> 65536 -> 73728 and on to 112,000 with no host tail and no ERR:

[384.2s] [InkCUDA] Elastic global KV grown: 57344 -> 65536 tokens (max_ctx=114688)
[413.3s] [InkCUDA] Elastic global KV grown: 65536 -> 73728 tokens (max_ctx=114688)

That is the exact cell that died at 66,048 last time, so the kv_host_ctx == 0 guard fix is confirmed as the cause and the fix as the cure. The 1x staged growth shows up as ~25 s per step instead of ~10 s, which is the copy cost and looks like the right trade.

For reference on the same box (IQ4_XS, 112K):

build / config experts decode
e68cde9 + --vram-reserve-mib 4096 903 + 1786 / 383 host 26.4
c6c4e58 + --vram-reserve-mib 4096 903 + 1658 / 511 host 25.7
6e86a1197, auto 1291 + 1781 / 0 host 28.8

So this is now the best configuration on 12 GB cards and the one that needs no tuning flag — the auto reserve plus the placement fix together beat every manual reserve we measured, with 3,072 of 3,072 experts in VRAM. Nothing else regressed: 8K was 44.9 on c6c4e58 and the expert split at 32K is unchanged at ~1,536/1,536.

Untested by me: UD-Q4_K_XL on this commit (all cells IQ4_XS), real text / quality, --draft, --kv fp8, and the 114,688 edge itself (I stop at 112,000).

@cobra91

cobra91 commented Nov 24, 2026

Copy link
Copy Markdown
Contributor Author

Thank you for verifying 6e86a1197 — hitting 40.6 tok/s at 32K and 28.8 tok/s at 112K with 0 host experts and no --vram-reserve-mib confirms the 1x-VRAM elastic KV growth fix works as intended on 2x 12 GB cards.

As promised, both KV fixes (df1320e8d + 59db8f275) are now backported onto #6811 (perf/inkling2-zero-p2p-sm75), and #6832 (perf/inkling2-iq2-moe, 81caabf95) has been rebased onto main.

For anyone testing the full Inkling 2 dual-GPU series together (#6811 + #6815 + #6823 + #6832 + #6982), a dedicated integration branch is now available at cobra91/Strata-DualGPU:lab/inkling2-full (0f302f582) so each PR stays cleanly scoped.

@Norhiro

Norhiro commented Nov 24, 2026

Copy link
Copy Markdown
Contributor

Data point for the asymmetric case, and the first one here with real hardware P2P: the same idea (all of the looped core L6..17 on the fast card) also works as a plain layer split, with the existing --layer-split per-card counts and no code change. P2P barely matters for that form.

Setup. RTX 5060 Ti 16 GB (sm_120, PCIe 3.0 x8) + RTX 3060 12 GB (sm_86, PCIe 3.0 x16), i7-7800X (X299, the two cards on different CPU root ports), 93 GB RAM, Linux, driver 615.71.09. Inkling-2-Mini-SQ-15.strata, --max-context 32768 --kv fp8 --draft off, temperature 0. Engine: v0.2.20 built from source for sm_86+120 with #6958, #6960 and the per-device capability cache (#6982). The 5060 Ti's desktop takes about 0.7 GB, so the 5060 Ti alone now spills 132 experts to host RAM and decodes at 25-47 tok/s. With nothing on it, it gives 65 tok/s.

P2P comes from a patched open kernel module (aikitoria's 615.71.09-p2p branch, plus Resizable BAR in the BIOS). nvidia-smi topo -p2p r changes from NS to OK. I checked the copies (256 MiB each way, 0 mismatches): 7.1 GB/s 5060 Ti -> 3060 and 5.1 GB/s back. For the "no P2P" rows I kept the same driver and boot and set STRATA_CUDA_PEER_PINNED=1.

Note on the numbering: the engine log calls the 5060 Ti GPU1 here (CUDA's default fastest-first order), the opposite of nvidia-smi. So --gpus 1,0 puts the 5060 Ti first.

Decode is 7 prompts of 128-400 tokens. Reads are time to first token. Q is 12 short factual questions.

placement P2P decode tok/s read 585 / 5,070 / 27,304 tok (s) Q
--layer-split auto (5060 Ti L0..12, 3060 L13..23) on 52.7-55.8 0.76 / 5.64 / 34.2 12/12
--layer-split auto off 52.1-55.4 0.77 / 5.74 / 34.6 12/12
--gpus 1,0 --layer-split 21,3 (5060 Ti L0..20, 3060 L21..23) on 62.0-63.7 0.45 / 3.16 / 20.7 12/12
--gpus 1,0 --layer-split 21,3 off 61.6-63.5 0.46 / 3.18 / 20.8 12/12
--layer-split ep2 --ep-split 0.25 (main) on 63.1-65.1 0.48 / 3.55 / 22.7 12/12
--layer-split ep2 --ep-split 0.25 off 60.1-62.2 0.51 / 3.83 / 24.2 12/12

For comparison, the 5060 Ti alone with every expert in VRAM gave 65.0-65.2 tok/s and 0.44 / 2.93 / 23.9 s earlier today.

What I see:

  • Placement matters much more than P2P. Moving the looped core onto the fast card takes the layer split from 55 to 63 tok/s. The 27K read drops from 34 s to 21 s, faster than the 5060 Ti alone. With fewer layers on the 3060, decode gets closer to one card: 18,6 gave 60.6-62.3 and 20,4 gave 61.6-63.4. Putting the 3060 first with the prelude (--gpus 0,1 --layer-split 6,18) gave only 55.3-58.3, with the same 768 experts on the 3060. I have not looked into why.
  • P2P is worth about 0.5% for the layer split. A token crosses only twice. For EP2 it is worth 4-5%, with 48 crossings. So 21,3 gets its speed without the patched driver.
  • P2P does not change the answers. For each placement, P2P on and off gave byte-identical text on all 7 prompts and all 12 questions. Different placements give different text, as expected from the different reduction order.
  • The auto split ignores the loop. It weighs layers by VRAM only (ink_runner.cuh, the VRAM-weighted partition), so 7 of the 12 looped layers land on the 3060 here. A loop-aware auto split for unequal cards (core on the faster card, the rest by VRAM) would give this result by default. On equal cards, @EliahHofmann's T10 table above shows the balanced split is better, so this should only kick in when the cards differ.
  • Related: with the server's "layer_split": "N", the engine wants per-card counts ([Engine] strata-inkling: the server's "layer_split": "N" (first layer of the next card) is silently ignored; the engine expects per-card counts and falls back to auto #6809). I passed --layer-split 21,3 in the engine args.

Not run: this PR's EP2 tail-skip itself (I used v0.2.20 EP2 with --ep-split), Windows, other pairs, DSpark on, and contexts above 32K.

@cobra91

cobra91 commented Nov 24, 2026

Copy link
Copy Markdown
Contributor Author

Thank you @Norhiro for these detailed empirical benchmarks on an asymmetric rig (RTX 5060 Ti sm_120 + RTX 3060 sm_86).

Your setup mirrors the exact hardware scenario that motivated this PR: our development rig is also an asymmetric Blackwell + Ada pair (RTX 5080 16 GB sm_120 + RTX 4060 Ti 16 GB sm_89).

Here is why your test case is especially relevant to #6811:

  1. The Asymmetric EP2 Bottleneck: In default cuda-ep2, distributing experts naively across asymmetric cards causes the fast Blackwell card to stall waiting for the slower card at every layer barrier. On our rig, this degraded decode performance down to 48.4 tok/s and triggered an unwanted auto-downgrade to Layer Split (cuda-ls, 45.0 tok/s).
  2. What Tail-Skip Solves: With the tail-skip logic in this PR, the faster card autonomously takes over the straggling expert tail instead of synchronizing and waiting on the slower device. On our RTX 5080 + RTX 4060 Ti setup, this restored decode throughput from 48.4 tok/s to 68.2 tok/s in cuda-ep2.
  3. Invitation to Test: Since you noted that you tested standard v0.2.20 EP2 with --ep-split 0.25, we would love to see how your 5060 Ti + 3060 pair behaves with this PR's tail-skip path. If you would like to test it:
  4. Loop-Aware Layer Split: Your observation regarding --layer-split auto ignoring the looped core (L6..17) in ink_runner.cuh is spot-on. Ensuring the central loop stays anchored on the faster card when cards are unequal would be a valuable heuristic improvement for the pipelined layer-split path (cuda-ls).

@Norhiro

Norhiro commented Nov 24, 2026

Copy link
Copy Markdown
Contributor

Thanks @cobra91, and good to know your rig is the same kind of asymmetric pair.

I can't run the tail-skip test for now, sorry. After my last comment I moved the RTX 3060 to another machine, so this box has only the 5060 Ti. There is no 5060 Ti + 3060 pair to test on at the moment. If I put the two cards together again, I'll run perf/inkling2-zero-p2p-sm75 (or lab/inkling2-full) in the same setup as my table above: decode on the 7 prompts, the 585 / 5,070 / 27,304-token reads, the 12 questions, with P2P on and off. I'll put cuda-ep2 with tail-skip next to --ep-split 0.25 and --layer-split 21,3.

A small correction for the record: #6982 is your PR, not mine. I only built it into my v0.2.20 engine for those runs. With it, the mixed sm_120 + sm_86 split gave 12/12.

On the loop-aware layer split: I agree it should only change the default when the cards differ, since the balanced split wins on equal cards (the T10 table). I'm happy to test a patch for it once the pair is back.

@cobra91

cobra91 commented Nov 24, 2026 •

Copy link
Copy Markdown
Contributor Author

Thanks @Norhiro for the clarification regarding #6982, and completely understood regarding your test rig hardware availability!

To provide clarity for everyone following this thread and testing dual-GPU setups on the latest v0.2.21 release:

1. Status of the Capability Check (#6982 / #6808) in v0.2.21

The reason mixed-architecture splits (such as RTX 5060 Ti sm_120 + RTX 3060 sm_86) now pass 12/12 in official builds is that Niko integrated the per-device capability caching directly into v0.2.21 via commit ec46ef3b1 (referencing issues #6808 and #6796). This resolves the prompt corruption on mixed pairs, rendering the standalone PR #6982 obsolete on main.

2. Status of this PR (#6811) in v0.2.21

This PR (#6811) remains completely unmerged and separate. In v0.2.21:

  • mma_m16n8k16_f16 in engine/src/inkling2/cuda/ink_cuda.cuh (line 456) is still a no-op stub for Turing sm_75 (#else (void)c; (void)a0; ...). Without this PR's WMMA fallback, Turing hardware computes zero on that path.
  • The zero-P2P tail-skip for asymmetric dual-GPU setups has not been integrated upstream.

3. Maintainer Workflow & Community Contributions Notice

Auditing the 292 commits of the v0.2.21 cycle reveals a consistent pattern regarding community contributions:

This workflow imposes an unsustainable burden on external contributors: after dedicating dozens of hours to diagnosing bugs, developing clean fixes, and validating benchmarks on physical hardware, contributors must spend additional hours reverse-engineering hundreds of maintainer commits just to determine what was cherry-picked, adapted, or left unaddressed.

4. Transition to PolyStrata

Given the overhead of tracking uncredited cherry-picks and unmerged PRs, we are stepping back from submitting further engine PRs or dual-GPU fixes to Niko1221/Strata.

image

Moving forward, our active development on asymmetric multi-GPU topologies (zero-P2P tail-skip, multi-GPU CUDA graph capture in EP2, DSpark multi-GPU drafting, and sm_75 Tensor Core support) is consolidating on PolyStrata (https://github.com/simplexai-labs/PolyStrata), where contributor PRs, code reviews, and proper attribution are handled transparently.

Anyone interested in running optimized asymmetric dual-GPU setups or testing the tail-skip path is welcome to follow and test our work there. Thanks again to @EliahHofmann and @Norhiro for the thorough empirical benchmarks and constructive technical discussions in this thread!

@dailybarid

Copy link
Copy Markdown

Re-test on merged main (engine 0.1.69): the 32K cell that read 40.6 on 6e86a1197 now reads 10.3 with auto reserve

Follow-up after v0.2.21 / v0.2.22 landed. I rebuilt Niko1221/Strata main (c23477403, engine 0.1.69) and ran the same cell that produced the earlier receipt, on the same box.

Rig: 2x RTX 3060 12 GB (sm_86, PHB, p2p=0), Ryzen 7 5700X, 31 GB RAM, Linux. File Inkling-2-Mini-UD-IQ4_XS.gguf (15.73 GB), --gpus 2 --kv k8v4 --parallel 1 --cpu-threads 8 --max-context 32768. Prompt 32,000 synthetic ids, 64 greedy tokens, timed from the native line protocol (READY → first T = prefill, then token deltas).

build flag prefill tok/s decode tok/s placement line
6e86a1197 (branch, Nov 23) none 358 40.56 1,525 + 1,547 experts, 0 host, KV in VRAM
main 0.1.69 none 290.8 10.34 global KV = 0 VRAM + 32768 mapped host tokens, 451 host experts, 0.80 GiB free VRAM after load
main 0.1.69 --vram-reserve-mib 4096 216.3 21.83 fewer host experts, KV resident
main 0.1.69, Q4_K_XL none 263.1 10.1 1,341 + 1,024 GPU / 707 host

So on this pair the merged code loads, finds 0.80 GiB free, and moves the whole global KV to mapped host — which is the configuration we measured at ~4 tok/s during the reserve investigation. The --bench path and the --serve line protocol agree (10.2 vs 10.3), so it is not a harness artefact, and it reproduces on a second quant.

The question I cannot answer from here: did the ctx-aware reserve survive the refactor into ink_runner_ws_reserve_bytes(max_slots, has_dspark)? On c6c4e5876 / 6e86a1197 the reserve was computed from --max-context at load time; on 0.1.69 the same flag produces a reserve that is 0.26 GiB short of holding 32K of k8v4 KV beside the experts. It is also possible that --bench, which grows its own context, is meant to be sized differently from --serve — if so, say so and I will re-run with whatever flag is canonical.

I am not claiming the regression extends beyond this pair of 12 GB cards; 0 host experts at 32K was the whole point of the earlier cells, and that is what changed.

@cobra91

cobra91 commented Nov 26, 2026

Copy link
Copy Markdown
Contributor Author

Thanks for the detailed re-test @dailybarid — that 2x RTX 3060 12 GB (p2p=0) 32K cell is a great match for what we moved over to PolyStrata (simplexai-labs/PolyStrata).

To make testing easier in a single build, we put together a combined branch test/dual-gpu-bundle on cobra91/PolyStrata (rebased on v0.2.20-poly.5, combining all three Inkling 2 dual-GPU PRs: #315, #356, and #357):

git clone https://github.com/cobra91/PolyStrata -b test/dual-gpu-bundle

It lets you benchmark both p2p=0 dual-GPU paths side by side on your 2x RTX 3060 12 GB rig at 32K:

# Symmetric layer split + DSpark (#315)
./strata-poly --model Inkling-2-Mini-UD-IQ4_XS.gguf --layer-split auto --kv fp8 --max-context 32768 --tokens <ids> --max-new 64

# Asymmetric / expert-spill GPU-to-GPU doorbell + CUDA graphs (#356 + #357)
./strata-poly --model Inkling-2-Mini-UD-IQ4_XS.gguf --expert-gpu 1 --kv fp8 --max-context 32768 --tokens <ids> --max-new 64

Feel free to share any 2x RTX 3060 (p2p=0) results on #315, #357, or a [Benchmark] issue on simplexai-labs/PolyStrata!

@cobra91
cobra91 force-pushed the perf/inkling2-zero-p2p-sm75 branch from 59db8f2 to d7ee50f Compare November 26, 2026 14:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants