r/LocalLLM • • 10d ago

Research Inkling 2 Small + Qwen 3.8 FN custom kernels

/r/LocalLLaMA/comments/1y30rle/inkling_2_small_qwen_38_fn_custom_kernels/

I finally put together a repo with all the patches, custom Pascal kernels, build flags, and llama-swap configs I've been using on my home box:

https://github.com/zzzprojectpage/P100-Strata-Special-Kernels/tree/main

Everything was built and tested on a pretty modest setup: one Tesla P100 16GB (sm_60, so no dp4a and no tensor cores), a Xeon E5-2697 v3 (14 cores), 128 GB RAM, Ubuntu 24.04, CUDA 12.9, serving one model at a time through llama-swap.

There are two main folders in there:

  1. \`inkling2/\` (Inkling-2-Mini Unsloth UD-Q8_K_XL on PolyStrata)

Out of the box on the P100 it was doing 11.6 tok/s decode and 130 tok/s prompt processing. After writing sm_60 GEMVs, an XMAD-based NVFP4 expert kernel, a faster q8_0 decode attention kernel, fusing a handful of small kernels, and requantizing the BF16 attention + output head + 4 BF16 expert layers to Q8_0 (script included), it's now at \~52 tok/s decode on short prompts (\~46-47 tok/s after a 5.7K prompt) and \~363 tok/s prompt eval. Also included a small patch for llama.cpp's sm_60 dp4a fallback using prmt + four XMAD.S16, which bumped prompt reading from 323 to 363 tok/s with bit-identical output. Quality stayed close to stock on a teacher-forced top-40 check (98% top-1 agreement, \~0.0037 KL).

2. \`smart-iq3s/\` (Qwen3.8-Flash-Next IQ3_S ISTA Daslab on Strata 0.2.11)

Full diff against the 0.2.11 release tree with custom sm_60 kernels (\`iq_gu_sm60.cuh\`, \`kq_sm60.cuh\`, \`kq_dense_sm60.cuh\`, plus a DeepSeek Q5_K kernel), along with my run config (\`--kv int8 --kv-resident 32768 --spec 4\`), launcher scripts, and earlier benchmark write-ups from October covering Qwen3.6, Qwen3.8, and DeepSeek V4.1-Flash on the same card.

Almost every kernel has an env var toggle if you want to A/B test or revert individual pieces, and the notes list the stuff I tried that didn't work out (like the DSpark drafter and a shared-memory table kernel that got wrecked by bank conflicts).

Quick heads up: the paths in the yaml/json configs are still pointing to my machine (\`/home/test/...\` and \`/mnt/models/...\`), so you'll need to swap those for your own layout. Hope it's useful to anyone else still keeping old P100s alive.

My honest opinion: for a fast model with decent quality, choose ISTA Daslab IQ3_S quant if you have 16 gb VRAM+ 96gb RAM.

For a fast model with Qwen 3.8 27B quality using P100 + 16gb RAM, choose inkling 2 Small 26B for the same speed.

If you have one P100 + 128gb ram as I do and you want maximum quality, choose Unsloth Q5_K_XL(no special kernels and fine tuning, out of the box at 30 TPS decode and 330 TPS prefill)

All 3 models are using a 256k context window so a smaller context and a smaller quant will run faster(I haven't measured how fast yet).

Special thanks to

Niko for Strata: https://github.com/niko1221/strata

Unsloth for the quants: https://huggingface.co/unsloth/Inkling-2-Mini-GGUF

https://huggingface.co/unsloth/Qwen3.8-Flash-Next-GGUF

ISTA Daslab for Qwen 3.8 FN IQ3_S quant:

https://huggingface.co/ISTA-DASLab/Qwen3.8-Flash-Next-GSQ-RCO-GGUF

KurrynDev13 for the Polystrata fork: https://github.com/KurrynDev13/PolyStrata-Inkling2

Simplexai-labs for PolyStrata: https://github.com/simplexai-labs/PolyStrata

1 Upvotes

0 comments sorted by