---
topic: ai-infrastructure
author: Crashtech Editorial
published: Sep 21, 2026 · read: 5 min
---

Running Big Models on Modest Hardware: Quantization, Offloading, and Bandwidth Limits

A concrete engineering breakdown of running 70B parameter models on desktop hardware using INT4 quantization, layer-wise CPU offload, and KV cache pruning.

– –

Every engineer experimenting with local language models eventually hits the hard wall of physical memory. You download an open-weights 70-billion-parameter foundation model, attempt to load it into an available workstation with 16GB of video RAM, and immediately trigger an out-of-memory kernel panic. Merely pulling down weights from Hugging Face does not mean an inference engine can run them, and fitting the raw weights into RAM does not guarantee acceptable generation speeds.

Running a modern transformer on modest hardware is a memory bandwidth problem disguised as a compute problem. Once weights leave high-bandwidth GPU memory, inference speed drops by two orders of magnitude. Understanding where hardware boundaries bite dictates whether an application achieves interactive token generation or grinds to a halt.

The Memory Math: Why Big Models Do Not Fit

During the decoding phase of autoregressive inference, an engine generates tokens sequentially, one by one. For each generated token, the processor must read every single model weight from memory into the arithmetic logic units.

The baseline memory footprint of raw weights is determined strictly by parameter count and precision:

Memory Footprint (Weights) = Parameter Count * Bytes per Parameter
  • FP16 / BF16 (16-bit float): 2 bytes per parameter. A 70B model requires 140 GB of RAM purely to load the static weights.
  • FP8 (8-bit float): 1 byte per parameter. A 70B model requires 70 GB.
  • INT4 (4-bit integer quantization): 0.5 bytes per parameter. A 70B model requires approximately 35 GB.
+------------------------------------------------------------------------+
|                      GPU MEMORY ALLOCATION (VRAM)                      |
+-----------------------------------+------------------------------------+
| Static Model Weights (e.g. 35 GB) | Dynamic KV Cache (Sequence * Batch)|
+-----------------------------------+------------------------------------+
                                      |
                                      +--> Activations & CUDA Overhead

Static weights are only half the battle. To generate responses, the engine must allocate working memory for:

  1. Model Activations: Intermediate tensor states created during the forward pass.
  2. The KV Cache: Stored Key and Value tensors for all previous tokens in the sequence, allowing attention calculation without recomputing past context.
  3. Engine Runtimes and Scratchpads: Memory buffers allocated by CUDA kernels and PyTorch memory managers.

For a 70B model processing an 8,192-token context window with batch size 1, the unoptimized FP16 KV cache alone consumes 10.5 GB of additional memory. If your hardware only possesses 32 GB of unified memory or 16 GB of discrete VRAM, the model will crash long before finishing its response.

Compute Bound vs Memory Bandwidth Bound

Inference operates in two fundamentally distinct regimes:

[Phase 1: Prefill (Prompt Ingestion)]
  - Tokens: All prompt tokens processed concurrently in parallel.
  - Regime: Compute Bound (Arithmetic operations saturate Tensor Cores).
  - Limiting Factor: FLOPS of the accelerator.

[Phase 2: Decoding (Autoregressive Generation)]
  - Tokens: One token generated per forward pass.
  - Regime: Memory Bandwidth Bound (Reading weights dominates execution).
  - Limiting Factor: GB/s throughput between memory and compute cores.

In the decoding phase, generating a single token from a 70B INT4 model requires reading all 35 GB of weights across the bus.

Consider three different hardware architectures:

Hardware ConfigurationMemory BusBandwidthTheoretical Max Token Speed (70B INT4)
NVIDIA H100 (80GB HBM3)HBM33,350 GB/s~95 tokens/sec
NVIDIA RTX 4090 (24GB GDDR6X)384-bit GDDR6X1,008 GB/sModel does not fit entirely in VRAM
Apple M3 Max (Unified Memory)512-bit LPDDR5400 GB/s~11.4 tokens/sec
Standard PCIe 4.0 x16 BusSystem to GPU31.5 GB/s~0.9 tokens/sec (CPU offload bottleneck)
DDR5 Dual-Channel System RAMHost Memory80 GB/s~2.2 tokens/sec

This table exposes the brutal reality of CPU offloading: when model layers spill over the PCIe bus into host DDR5 RAM, execution speed is strictly throttled by the 31.5 GB/s PCIe bus or 80 GB/s RAM throughput, capping throughput at 1 to 2 tokens per second regardless of CPU core count.

Quantization: Compressing the Weight Matrix

Quantization maps continuous 16-bit floating-point weights into low-bit discrete integers (INT8, INT4, INT3, or INT2), drastically reducing memory size and bus transfer volume:

+------------------------------------------------------------------------+
| FP16 Weight Matrix (16-bit) -> 140 GB -> Massive Bandwidth Requirement |
+------------------------------------------------------------------------+
                                  |
            [Post-Training Quantization (AWQ / GPTQ / GGUF)]
                                  v
+------------------------------------------------------------------------+
| INT4 Block Quantized (4-bit) -> 35 GB  -> Fits on Consumer Hardware   |
+------------------------------------------------------------------------+

Modern quantization strategies avoid catastrophic quality degradation through block-level scaling and outlier protection:

  • AWQ (Activation-aware Weight Quantization): Observes which 1% of weights correspond to the largest activation spikes and keeps those critical channels in full 16-bit precision, while compressing the remaining 99% into 4-bit bins.
  • GPTQ (Second-Order Quantization): Uses Hessian matrix error minimization to adjust remaining weights as each row is rounded down.
  • GGUF / K-Quants: Employs variable bit-depth blocks (e.g., Q4_K_M), applying 5-bit or 6-bit precision to critical attention projection matrices and 4-bit precision to feed-forward blocks.

The Quantization Tradeoff Curve

Compacting weights from 16 bits down to 4 bits saves 75% of memory with negligible degradation in perplexity (often under 0.2 perplexity points on standard benchmarks like Wikitext-2). However, pushing quantization down to 3-bit or 2-bit triggers exponential quality collapse, manifesting as syntax errors in generated code, circular reasoning, and hallucinated factual details.

Layer-Wise Offloading and Hybrid Split Architecture

When a quantized model still exceeds available GPU VRAM, inference runtimes like llama.cpp and vLLM split the neural network across devices using Layer-Wise Offloading.

A 70-billion parameter transformer consists of 80 identical decoder layers stacked sequentially:

+------------------------------------------------------------------------+
|                        LAYER OFFLOAD TOPOLOGY                          |
+------------------------------------------------------------------------+

 [Prompt Input]
       |
       v
 +---------------------------------------------------+
 | GPU VRAM (High Speed: 1,008 GB/s)                 |
 | - Layers 0 through 45                             |
 | - Fast matrix multiplies on CUDA cores            |
 +---------------------------------------------------+
       |
       | Intermediate Tensor Activations (Small: ~4 KB)
       v
 +---------------------------------------------------+
 | Host System RAM (DDR5: 80 GB/s)                   |
 | - Layers 46 through 79                            |
 | - Computed by CPU AVX-512 / AMX vector units      |
 +---------------------------------------------------+
       |
       v
 [Next Token Probability Output]

Instead of copying 35 GB of weights back and forth across the PCIe bus on every single token, the system pins the first 46 layers inside GPU VRAM and pins the final 34 layers inside system RAM.

During the forward pass:

  1. Layers 0 through 45 execute on the GPU at maximum memory speed.
  2. Only the intermediate activation vector (a compact tensor of just a few kilobytes) is transferred over the PCIe bus to host RAM.
  3. The CPU executes Layers 46 through 79 using multi-threaded AVX-512 vector instructions.
  4. The final token logit distribution is produced.

This hybrid approach allows models that exceed VRAM to run without PCIe thrashing, though generation speed remains limited by the CPU portion of the pipeline.

Controlling KV Cache Bloat

Even with INT4 quantized weights, long context windows can rapidly exhaust remaining memory. Standard attention mechanisms store uncompressed Key and Value states for every token across all attention heads.

Three architectural innovations have tamed KV cache footprint:

1. Multi-Query Attention (MQA) & Grouped-Query Attention (GQA)
   - Llama-2 (MHA): 64 Query heads, 64 Key heads, 64 Value heads.
   - Llama-3 (GQA): 64 Query heads share only 8 Key/Value heads.
   - Reduction: Shrinks KV cache size by 8x with zero quality loss.

2. PagedAttention (vLLM)
   - Eliminates physical memory fragmentation by allocating KV cache 
     in virtual non-contiguous memory blocks (pages) similar to modern OS kernels.
   - Eliminates 60% of wasted headroom padding.

3. KV Cache Quantization (FP8 / INT4 Cache)
   - Compresses stored attention keys and values from 16-bit to 8-bit or 4-bit,
     halving context memory requirements during massive multi-turn chats.

Architectural Takeaway

Do not attempt to brute-force large language models by swapping weights across a PCIe bus. When designing edge or local AI systems:

  • Select models trained natively with Grouped-Query Attention (GQA).
  • Utilize 4-bit block quantization (GGUF Q4_K_M or AWQ) to preserve reasoning fidelity while cutting memory footprint by 75%.
  • Pin the working KV cache to GPU VRAM using PagedAttention and enforce strict context window limits.
  • Benchmark token generation speed against the physical memory bandwidth of your memory bus before committing to an offline deployment architecture.
Advertisement

/* Comments */