Running 35B Models on a Single GPU: FP4 Quantization and High-Throughput Inference
This article explains how 4-bit floating-point (FP4) quantization, dual-level scaling, paged KV cache, continuous batching, and fused kernels make it practical to run ~35B models on a single consumer GPU, covering memory math, engine design, hardware requirements, and common pitfalls.
Why Single-GPU Inference Used to Be Out of Reach
LLM parameter counts have grown from tens of billions to hundreds of billions, and serving cost has grown with them. A 35B-class model in FP16 needs about 70 GB for weights alone; KV cache on top of that often strains even multi-GPU servers. For individual developers and smaller teams, that was a hard barrier.
Two developments have changed the picture:
- Hardware: Newer GPUs expose native 4-bit floating-point (FP4) tensor cores, so ultra-low-precision inference is hardware-backed rather than software-emulated.
- Software: Community inference engines have matured around quantized formats and scheduling. Quantized models can even outperform some FP8 setups on throughput.
Together, they make a repeatable practice of running a 35B model on one flagship consumer GPU at on the order of hundreds of tokens per second. The rest of this article unpacks the technical core.
4-bit Floating-Point Quantization: Aggressive and Accurate
Why integer quantization often falls short
Classic INT4 maps weights to integers with a zero-point and scale. That can work for CNNs, but LLMs have outliers: a few channels with much larger magnitude than the rest. A shared scale then wastes resolution on most weights, and error shows up as worse generation quality.
FP4 keeps a floating-point layout. A few exponent bits cover a wide dynamic range, which fits weight distributions with large span.
Dual-level scaling: fine blocks plus a global scalar
Modern FP4 formats typically use two-level scaling, which is central to accuracy:
- Fine-grained block scales: Weights are split into small blocks (e.g., 16 elements). Each block gets its own 8-bit float scale (often E4M3). Smaller blocks tighten intra-block range and cut quantization error.
- Global scalar: An FP32 scale on the whole tensor absorbs layer- and channel-level magnitude differences so extreme values do not overflow the block scales.
Dequantization sketch:W_dequant = W_fp4 × block_scale(E4M3) × global_scale(FP32)
Versus 32-element integer blocks, 16-element blocks with float scales track the data better. Memory can drop to about half of FP8 and a quarter of FP16, with loss that is often barely noticeable. That is what lets a 35B model fit in 32 GB.
Memory budget: how large the win is
Rough numbers for a 35B model:
| Precision | Weight footprint | Feasible on 32 GB |
|---|---|---|
| FP16 | ~70 GB | No |
| FP8 | ~35 GB | Needs offload or extra GPUs |
| FP4 | ~18 GB | Yes, with room for KV cache |
Freed VRAM can go to KV cache and longer context—the reason long-context setups can still keep useful generation speed.
High-Throughput Engines: Using the Hardware Fully
Quantization is not enough. Poor scheduling wastes the GPU on fragmented memory and idle waits. High-throughput engines usually combine three mechanisms.
Paged KV cache
Naive designs preallocate a contiguous KV buffer for each request’s max length. Unused tokens waste memory, and fragmentation makes long sequences fail to allocate.
Paging (as in virtual memory) splits KV into fixed-size blocks, allocated on demand and mapped through a block table:
- Higher utilization and more concurrent requests
- Long sequences no longer need one huge contiguous region
- Prefix KV blocks can be shared across requests (multi-turn chat, multi-candidate generation)
Continuous batching
Static batches wait until every request in the batch finishes. Short requests stall the GPU. Continuous batching inserts and retires requests after each decode step so the GPU stays loaded. Measured throughput can be several times higher than static batching.
Fused quantized operators
The engine should fuse FP4 dequant, scale loads, and GEMM so intermediates are not written back to HBM. Decode is bandwidth-bound; fusion cuts the cost of reading full weights every token. FP4 weights are about a quarter of FP16, so less traffic is a main source of speedup.
# Inference service config sketch (pseudocode)engine_config = {"model": "qwen-35b-fp4", # FP4-quantized model"quant_method": "fp4", # 4-bit floating-point quantization"kv_cache_dtype": "fp8", # lower-precision KV cache"max_model_len": 131072, # long context"enable_prefix_caching": True, # prefix KV reuse"gpu_memory_utilization": 0.92,}
Hardware Prerequisites
- Native FP4: Only GPUs with the newer tensor cores run FP4 matmul in hardware; otherwise you fall back to software dequant and lose most of the speed.
- VRAM: 24 GB is a practical minimum; 32 GB is better—about 18 GB for weights plus KV and activations.
- Bandwidth: Decode is memory-bound; TB/s-class bandwidth is needed for hundred-token-per-second class TPS. If bandwidth is tight, raise batch size and trade compute density for per-request latency.
- Power and cooling: Sustained high load needs headroom in PSU and airflow.
Flagship consumer cards in this generation typically offer several times the AI throughput of the previous generation and native 4-bit float acceleration—the point where consumer hardware first matches server-class quantized inference in a meaningful way.
Practical Advice and Common Pitfalls
1. Quantization path. Prefer community-maintained FP4 weights or official offline conversion tools. Calibration data should match production; generic corpora can hurt domain quality.
2. KV cache precision. FP8 KV frees more memory and context, but retrieval-style long-context tasks (e.g., needle-in-a-haystack) need an accuracy check first.
3. Long-context slowdown. Attention still scales with sequence length squared. Set max_model_len to the real business max, not the theoretical maximum.
4. Prefill vs. decode. For production, prefer engines that schedule prefill and decode separately so one long prompt does not stall other users’ decode.
5. Quality checks. Compare quantized vs. original on a fixed eval set, especially factual QA and code. Mixed precision on sensitive layers is an option if needed.
Closing
Running a 35B-class model on one GPU at hundreds of tokens per second used to be a datacenter-only story. FP4 addresses accuracy under compression, new GPUs address speed, and modern engines address scheduling. Combined, local serving of large models is a normal option, not a cluster privilege.
A practical rollout is: reproduce a baseline in a test setup, validate quantization on business data, then size concurrency and context. Once hardware, quantization, and engine limits are clear, local LLM deployment can sit in a typical developer toolchain.
