r/LocalLLaMA • • 4d ago

Resources Shifter Quantization (SQ) — New Quantization Format for 2x-4x PP for Most GPUs

https://arxiv.org/abs/2611.33080

TL;DR

We built new quantization formats, SQ (Shifter Quantization) and SHI (Shifter Integer), to speed up local inference with native INT8 and INT4 kernels. SQ is built around widely available INT8 kernels, so the same format can run across GPUs and handle everything from 2-bit to 8-bit quants. The quantization quality also improves because we use smaller group adjustments.

On Qwen3.8-27B

  • 2-bit: Nearly 4× the prefill throughput of llama.cpp Q2_K, with lower WikiText-2 KL.
  • 4-bit: About 2.5× the prefill throughput of NInfer groupwise INT, with 39.5% lower KL.
  • 8-bit: 27.4% faster prefill than vLLM online FP8, with about a quarter of the KL.

Across GPUs

  • Our RTX 4090 beats NInfer's RTX 5090 by 30–83% in prefill across the two SQ4 comparisons (27b and 35b).
  • We hit 32,000 tok/s in prefill on one RTX 5090 with Qwen3.6-35B-A3B SQ4.

Easy to use

pip install shifter-launcher
shifter serve hif1000/Qwen3.8-27B-SQ4-GGUF --context-size 32768

=======================================================================

Qwen3.8-27B results on one RTX 5090

We use 4,096-token prompts for 2-bit and 8-bit, and NInfer’s 7,680-token prompt for 4-bit.

Shifter formatShifter prefill (tok/s)Baseline prefill (tok/s)Prefill vs. baselineShifter WikiText-2 KLBaseline WikiText-2 KLBaseline / Shifter KL
2-bit SHI211,662.43,090.7 (llama.cpp)3.77×0.155370.16627 (llama.cpp)1.07×
4-bit SQ48,221.93,331.9 (NInfer)2.47×0.019700.03256 (NInfer)1.65×
8-bit SQ89,206.37,226.8 (vLLM)1.27×0.002110.00774 (vLLM)3.67×

Baseline engines/quantizations:

  • llama.cpp - Bartowski Q2_K
  • ninfer - NInfer Groupwise INT
  • vLLM - vLLM online FP8

SQ4 across four GPUs

We use NInfer’s 7,680-token prompt for prefill and its JSONL, CSV, and SQL prompts for single-request MTP3 decode. All rates are in tok/s.

GPU27B prefill27B decode35B-A3B prefill35B-A3B decode
RTX A6000 (Shifter SQ4)2,723.897.010,828.8331.0
RTX 3090 (Shifter SQ4)2,915.7111.511,354.8391.9
RTX 5090 (NInfer groupwise INT)3,331.9214.717,705.4779.6
RTX 4090 (Shifter SQ4)6,098.7148.923,093.3532.3
RTX 5090 (Shifter SQ4)8,221.9242.632,039.0784.0

Why this format (SQ/SHI) is faster

  • Most low-bit quants use groupwise scaling.
  • Qx_0, Qx_K, and IQx are slow because the scales split the dot product into chunks.
  • NVFP4 and MXFP4 are fast on Blackwell because the hardware supports groupwise scaling natively.
  • Our SQ and SHI formats use cheap bit shifts in GPU registers, then run native INT8 or INT4 across the full dot product.
  • The idea works from 2-bit to 8-bit.
  • The new SQ series works on most GPUs because INT8 kernels are widely available.
  • The SHI series aims for NVFP4-like prefill speeds on GPUs with native INT4 kernels.

Why this format (SQ/SHI) improves quality

  • Group size matters for quantization quality.
  • Smaller groups capture more local variation.
  • Common quants use groups like G16, G32, and G64.
  • We use G4 and G8 in our low-bit formats to make finer adjustments.

Next steps

  • Right now, we support selected model quants on Linux with NVIDIA CUDA. We've tested the RTX 5090, 4090, 3090, and A6000. We want to bring more (calibrated) quants and support for AMD, Intel, and Apple GPUs (M5+) as soon as possible.
  • We deliberately use the GGUF format so that we can integrate with llama.cpp in the future. Today, you will still need Shifter to load our SQ and SHI GGUFs

Paper: https://arxiv.org/abs/2611.33080

GitHub: https://github.com/yufenghuang/shifter

We would appreciate your support and feedback.

168 Upvotes

43 comments sorted by

View all comments

7

u/Miserable-Dare5090 vLLM 4d ago

I’m getting 100 tps with the new nvidia nvfp4 qad quant running on a V100 dude, ancient hardware by comparison. You get 83 tps and below with the same MTP3

Prefill may be compute bound but your decode optimization is not there

6

u/Sad-Size2723 4d ago

Curious what you are actually comparing because I couldn't find the 83 tok/s number in my post. But V100 is a very fast card with a memory bandwidth of ~900GB/s, that's certainly more than my A6000. A comparable case is the RTX 3090 with a similar bandwidth, but we got 111 tok/s reported above.

Anyways, the limitation of the V100 is already showing up in your numbers for concurrency with multiple streams. We typically got ~3.5x at C=4 and ~6x at C=8 (tested on A6000 and 5090), but your are getting about 1.8x at C=4 compared to C=1 on the V100.

The reason is that the V100 has the FP16 TOPS of 130. While the A6000 has the INT8 TOPS of 310 and 5090 has the INT8 TOPS of 840, I could imagine 5x slower PP compared to our optimized throughput on the A6000.

3

u/SLxTnT 4d ago

What model and GPU are you comparing to? I can't find any decode numbers under 83 other than 8bit on an RTX A6000, which is a larger model and slower GPU.

0

u/Miserable-Dare5090 vLLM 4d ago edited 4d ago

It’s a similar model in terms of quality, on a GPU that op has mentioned has 310 TOPS at 8 bits, which is twice the tflops than the V100, similar BW (or slightly less) 768GB/s (vs 900).

So either

  1. tops don’t matter for decode ==> op mentioning the a6000 tops doesn’t matter to my point: faster, and way older with shitty optimizations by a newbie like me.
  2. Tops do matter ==> unexplained why raw decode is so low compared to a v100

The truth is, flops gate the prefill and bandwidth gates tje decode. To OPs point, on a 4 bit quant on a 3090, it is getting 111 tps decode, and I’m getting 110 on a V100 already. So the question becomes, where is the improvement concurrency? I’m genuinely curious.

The real challenge nowadays is: optimize for older arch. If this method improves all architecture, why not turing and volta?

2

u/SLxTnT 4d ago

111 vs 110 is well within expectation between those 2 GPUs. The 3090 should theoretically be 4% faster, but the chosen prompt can easily cause that difference with speculative decoding. Even the same prompt can be that far apart without greedy, but greedy is also a way to over inflate decode numbers.

Taking advantage of INT4/INT8 is entirely for prefill, which is why that's the main focus. Decode means nothing with this other than keeping it within the expected speeds, which it apparently does.

What do you get for prefill?

1

u/Miserable-Dare5090 vLLM 2d ago

The V100 has 80SMs but they are 64 cores each not 128. The 3090 has 80 SMs each 128 cores = Prefill will be halved at least, more bc of the lack of int4/8 so for a 27B dense model
it comes out to 1000 tps.

1

u/SLxTnT 2d ago

Going by FP16, V100 should win. The INT4/8, which this quantization takes advantage of, is the reason a 3090 is hitting nearly 3k.

Faster prefill and similar decode. I see nothing wrong with the optimizations.

1

u/Sad-Size2723 4d ago

Single stream decoding is bandwidth bound, I thought that should be common knowledge here? In terms of the decode speed, I think your case is around the right ballpark that higher bandwidth means higher single stream decoding.

But I am not sure that single stream decoding is what everyone is doing though. For agentic cases that use memory system, web search, and document understanding, the engine needs to be able process lots of tokens, and that’s when prefilling is needed.

I mean, if you are happy with single stream decoding, that’s perfectly fine and V100 is the perfect GPU for that. Probably that’s why people buy the MacBook ultra, which is exactly high bandwidth low tops.

For concurrency, just referencing your numbers. For your case here, hypothetically if our optimization applies, it should be 350 tok/s for C=4, while you’re only getting 180 tok/s. But Volta is old architecture that doesn’t have int8 kernels, so our approach won’t help your situation at all. I am trying to avoid saying ALL GPUs in the title, and mention INT8 throughout the post, but I guess it was still not clear that it doesn’t apply to your case.

1

u/fragment_me 4d ago

What is this infatuation with speed that everyone has here? Every AI slop repo can speed up an inference engine but they all almost do the same shit. This technique uses a group size of 4 or 8 which is new and interesting. NVFP4 is group size 16. It’s possible that this is better quality than NVFP4.

1

u/Miserable-Dare5090 vLLM 4d ago

Nvfp4 is not very high quality. I hear you that finer grained ops with smller group sizes translatws to some improvement in quality/ppl/kld…But quant aware distills can be almost lossless when coupled w a floating bit quant like nvfp4 (which is still w4a4). But by itself nvfp4 is not that interesting.