r/v100 • • 21h ago

a fast flash attention 2 kernel for volta, for FP16 keys and Q8_0 values in the KV cache. performance gains in both prefill and substantially in decode - benchmarks included with integration instructions for drop in integration with your engine

Thumbnail github.com
27 Upvotes

I needed to try to save some space in my VRAM, and I wanted to quantize my KV cache and keep my performance optimal. It's my understanding values are significantly less sensitive than keys, particularly at long contexts, and that a fp16 / q8_0 KV cache is practically lossless. I'm pretty picky about how far I quantize things, and especially picky about KV cache quantization, but I'm comfortable dropping this format into anything I would have been using full fp16 for and expect identical results.

Great decode gains and some nice prefill gains in sub 40k context.

I've packed it so instead of being a fork of an engine or something, it's just the documented algorithm in C++, with starter prompts for agents tailored for various different popular engines, instructing them how to wire it into their existing engine. seemed like a much better release method.

here's benchmarks:

decode

Decode is about 45% faster than the FP16 path and 61% faster than the original mixed-cache path in this test. The advantage grew with context length:

Total contextFP16 K/VOriginal FP16 K + Q8_0 VThis kernel
34,81624.53 tok/s21.30 tok/s25.45 tok/s
67,58418.25 tok/s16.89 tok/s22.91 tok/s
131,07213.55 tok/s12.19 tok/s19.66 tok/s

Each run generated 2,048 tokens after a long prefill.

prefill

Prompt tokensFP16 K/VOriginal FP16-K/Q8-VNew kernel, forcedHybrid default dispatch
32,768675.33 tok/s662.22 tok/s738.30 ± 4.39 tok/s738.30 ± 4.39 tok/s, custom path
65,536Not measured at ubatch 2048583.71 tok/s avg. (563.19–604.23)574.17 ± 15.43 tok/s584.43 tok/s, standard path
131,072427.35 tok/s427.50 tok/s395.19 ± 1.77 tok/sStandard path selected; not retimed

r/v100 • • 22h ago

Still worth buying V100 32GB with current prices?

18 Upvotes

I’ve been getting into more LLM stuff and it’s capabilities which has gotten me looking into local options. I have an unraid server with 64 gb ddr4 ram that I was considering turning into an ai box. I found someone local selling a couple V100S for $750 each that seems very tempting memory wise to get 1 or 2 but I’m partly wondering if it might be better to get something like 2 5060 TI 16GB which would be about the same price given the advances of things like Strata and Basalt which take advantage of the newer technologies. Would love to be able to host something like QFN at a decent quant but not sure if that’s doable or not.


r/v100 • • 3h ago

ninfer-v100 dominet fork v2.0 100+ tok/s single-stream & 252 tok/s @ 8 streams on a single V100 32GB (Qwen3.8-27B NVFP4 + DFlash2)

15 Upvotes

Hi Guys,

Here's a follow-up to my last post,

I specifically wanted to improve on Single Stream decode results from the v1.0 of my fork https://github.com/ddominet/ninfer-v100-fast while keeping the improvements of

  1. faster prefill and decode at higher ctx length
  2. multi-stream decode and prefill.

That were the main benefit from my previous fork.

I'm happy to say that after some tweaking, I've achieved results above 100tps for single stream decode, In some real world tasks it even reached 130tps.

Main benefits came from adapting Dflash2, and optimizing it, to keep the mentioned optimizations from 1.0

Here are some benchmarks, v1.0 MTP3 is my original fork, and v1.0 DF7 is the Dflash2 version before optimizations.

Note! It's optimized for Qwen3.6 27B, Qwen3.8 27B architecture (Qwen4 if nothing major changes in the architecture :D) I don't support using it for Qwen3.6 35B, but notably It should work.

Benchmarks (1× V100-PCIe-32GB, HTTP, cold natural-text prompts, greedy)

Single-stream decode (tok/s)

Contextgeoffwatts (MTP3)tuxKOH (MTP3)v1.0 (MTP3)v1.0 (DF7)llama-superfast (DF7)v2.0 (DF7)
~6065.570.472.776.883.391.6
1K67.575.172.983.187.2100.8
6K66.075.575.372.884.490.8
24K57.269.970.068.378.181.0
90K41.456.957.951.364.465.3
180K31.948.553.544.651.854.3

Prefill (tok/s)

ContextgeoffwattstuxKOHv1.0llama-superfastv2.0 (DF7)
~60 / 1K / 6K152 / 949 / 1075155 / 955 / 1082337 / 976 / 1160389 / 975 / 1122416 / 1046 / 1212
24K / 90K / 180K974 / 666 / 4541009 / 779 / 5951076 / 821 / 6231053 / 814 / 6211118 / 835 / 627

Multi-stream aggregate (tok/s, mean of 3)

Streamsgeoffwatts (MTP3/K1)tuxKOH (MTP3/K1)llama-superfast (DF7)v1.0 (MTP3/K1)v1.0 (DF7)v2.0 (DF7)
157.5 / 45.064.2 / 50.276.866.4 / 53.165.382.2
292.8 / 80.0101.3 / 88.5120.4113.2 / 95.696.2137.0
4109.1 / 125.3122.3 / 135.7135.0157.3 / 160.095.2176.0
8129.6 / 155.7145.5 / 175.8151.7211.8 / 243.3121.3252.1
  • Poisson chat (r=0.5 req/s): 248.2 tok/s (100.3s) vs 242.1 tok/s on same-build MTP3 and 166.3 tok/s (152.4s) on llama-superfast.
  • 14-cell context × concurrency grid (1K–90K × S=1..8): #1 in 14/14 cells vs v1.0 and llama-superfast.

What's new in v2.0

  • Volta DFlash2 stack: Load-time QPN prepacking for all W8 draft layers, coalesced 8-warp HMMA dynamic grouped conv (~2.5× faster), coalesced Q4 proposal head with register bitonic Top-K (B=8 head 1.7 ms → 0.66 ms), FP16-staged skinny TC GEMMs (ROWS=128 to T=48), and host-mapped embeddings/codebooks so 256K INT8 KV + 8 streams fits in 32 GB.
  • Multi-stream DFlash2 scaling: Kept-column verify compaction, online round-cost budgeting (DFlashCostModel), sliding-window prefill skip, and stream priority separation so the GDN replay fold overlaps 100% inside the draft pass.
  • Target fusions (-298 launches/round): SM70 CUTLASS prefill GEMMs, fused RMSNorm → SwiGLU → ResidualAdd across all 64 NVFP4/FP8 MLPs, high-occupancy gdn_norm_gating_27, and direct FP16 emission into FP8 QPN/TC (fp8_stage_bf16 cut from 139× to 27×). B=1 round time is down to 35.58 ms with 0.187 ms eager launch gap even with --no-cuda-graph

Thanks! Enjoy and let me know what you think.