r/ROCm • • 13h ago

Pushed Inkling 2 Mini on a 7900xtx. 180tps single stream. 250tps prose. 326.6 tok/s on coding with 507.9 tok/s 1s bursts. 7900xtx fork for nib

19 Upvotes

Hello, human here.

huge shoutout to Chromadera for his nib project! This is a fork from that one!

I wanted to get inkling 2 Mini really fast for some lighter multi-stream work and Gemini did just that. The secret was using multiple Dflash2 modules loaded in a very clever way to get more tps.
This should work on any rdna3 card and probably rdna4, but it's untested. The numbers right now are made for exactly the 7900xtx. Smaller quants and different context sizes should allow 20gb or 16gb cards as well.

Have fun with it!

nib-7900xtx — Multi-Slot Fused DFlash 2 Speculative Decoding for RX 7900 XTX

Branch: https://github.com/BesnikDev/nib/tree/nib-7900xtx


Copy-Paste Post (Reddit / Discord / GitHub / X)

nib-7900xtx: Multi-slot fused DFlash 2 speculative decoding across 2–8 parallel slots on RX 7900 XTX (268.5 tok/s steady on 1 card, up to 326.6 tok/s steady / 507.9 tok/s burst on code; >1,000 tok/s peak across 2× XTX)

Upstream nib (v0.4.1) runs DFlash 2 / DSpark speculative decoding only when a single slot (B = 1) is active — as soon as 2+ parallel requests decode together, it falls back to standard 1 tok/slot batched decode.

We built an RX 7900 XTX (gfx1100) optimization branch — BesnikDev/nib (nib-7900xtx) — that keeps DFlash 2 speculative decoding active across all 2..8 parallel slots simultaneously in a single 1× weight-stream pass per step, with zero SGPR/VGPR/private-segment register spills across all 22 kernel objects (spill_audit.sh clean) and bit-identical (md == 0.0) greedy verification parity.

What's Inside

  • Per-slot SWA-2048 BF16 DFlash 2 KV rings (41.1 MiB/slot) synchronized continuously across prefill, B >= 2 decode, and solo decode via a slot tap hook — zero cache invalidation when streams join or finish early.
  • WMMA 16×16×16 draft_nslot(1..8): Fuses all active slots' 8-token DFlash 2 block drafts into a single weight-stream pass (0.46 ms/slot at 8 slots) + block-isolated conv/RoPE/SWA-attention/Top-16/selector kernels.
  • 32-row verify_step_nslot(1..8) + verify_rollback_nslot(1..8): Verifies heterogeneous per-slot draft lengths (m_s in [1..8], up to MAX_VERIFY_TOKENS = 32 total rows) in one MoE + DeltaNet + GQA pass, with T_CHUNK = 16 MoE tiling, K-tiled lm_head GEMV (m = 1..32), and 2-level {m_lo, m_hi} HIP graph-key quantization so 8-slot heterogeneous batches never thrash the HIP graph cache.
  • Hardware-calibrated m_tot = 16 default: Keeping total verify rows <= 16 stays inside a single T_CHUNK = 16 MoE pass and 2-row-per-lane lm_head fast path — beating wider verify budgets on diverse reasoning workloads, while NIB_VERIFY_MAX_ROWS=32 unlocks 8×4 verification for ultra-predictable HTML/JS generation.

Benchmarks (Inkling-2-Mini-NVFP4-Mixed + DFlash 2 + mmproj Q8_0, --kv-type q8_0 --sparse-pages 224 --ubatch 1024 --cpu-embd, ROCm 10.2)

SetupContext Pool (-c)1× RX 7900 XTX Wall / SteadyPer-Stream2× RX 7900 XTX (Independent Instances)
2× slots/card (diverse code/vision)262,848 (131k min/slot)156.3 / 164.3 tok/s~80 tok/s300.3 wall / 301.8 tok/s peak (4 streams)
4× slots/card (sweet-spot context)262,848 (65.7k min/slot)213.3 / 241.2 tok/s~60 tok/s~426 wall / ~482 tok/s steady (8 streams)
6× slots/card (throughput/ctx balance)212,992 (35.5k min/slot)241.9 / 268.2 tok/s~45 tok/s486.5 wall / 531.5 tok/s steady (12 streams)
8× slots/card (diverse prompts)196,608 (24.6k min/slot)254.5 / 268.5 tok/s~34 tok/s508.7 wall / 537.7 tok/s steady (16 streams)
8× slots/card (HTML5 Snake, m_tot=32)196,608 (24.6k min/slot)318.1 wall / 326.6 steady / 507.9 1s burst40.8 steady (68.0 peak)631.0 wall / 651.2 steady / 921.5 1s burst (1,031.6 tok/s sum of stream peaks)

Build & Run

git clone -b nib-7900xtx https://github.com/BesnikDev/nib.git
cd nib
cmake -B build -DCMAKE_BUILD_TYPE=Release -DGPU_TARGETS=gfx1100
cmake --build build -j
./scripts/spill_audit.sh build

# Recommended 4-slot 262k setup (all 4 slots get fused DFlash 2; solo requests still expand up to 262k):
./build/nib serve \
  -m /path/to/Inkling-2-Mini-NVFP4-Mixed.gguf \
  --mtp /path/to/Inkling-2-Mini-DFlash2 \
  --mmproj /path/to/mmproj-Inkling-2-Mini-Q8_0.gguf \
  --slots 4 -c 262848 \
  --kv-type q8_0 --sparse-pages 224 --ubatch 1024 --cpu-embd

Optional tuning env vars for 6–8 slots on high-acceptance code: NIB_VERIFY_MAX_ROWS=32 NIB_NSLOT_HI_M=4 with --spec-threshold 0.55.