SysArt
Book a briefing
SysArt

On-premises AI

Model Quantization and Pruning for Constrained On-Premises Hardware

How quantisation (GPTQ, AWQ, FP8, GGUF) and pruning fit capable models onto limited on-premises GPUs and edge devices, and how to validate the results.

Last reviewed by SysArt AI Architecture Team9 min readHow we review

In short

Quantisation stores a model's weights, and sometimes its activations, in fewer bits; pruning removes weights or whole structures. Both cut memory needs so capable models fit limited GPUs or edge devices, but both can cost accuracy on particular tasks. Choose a method your serving engine and hardware support, calibrate on representative data, and evaluate the exact compressed model before release.

Key takeaways

  • Weight memory is roughly parameters times bytes per weight: about 140 GB for a 70-billion-parameter model in 16-bit precision and about 35 GB at 4 bits, before the KV cache and runtime overhead.
  • GPTQ and AWQ are post-training methods for low-bit, weight-only quantisation; FP8 quantises weights and activations on recent GPUs; GGUF is a file format for GGML-based runtimes such as llama.cpp.
  • Unstructured sparsity pays off only with sparse kernels, while structured methods such as SliceGPT produce smaller dense matrices that run faster on standard hardware.
  • Compression effects vary by task and calibration data, so evaluate the compressed artefact on your own test set and version each stage separately.
  • Compress only when profiling shows that GPU memory or memory bandwidth is the bottleneck.
Close-up of computer hardware with red LED lighting inside a server case

Why does GPU memory limit on-premises AI?

A model’s weights must fit in accelerator memory together with the key-value (KV) cache and working memory for every request, and in 16-bit precision the weights of large models alone exceed a single GPU. Quantisation and pruning are the two established ways to shrink that footprint, so that capable models fit the hardware you own or serve more users on it.

The arithmetic is simple. Weight memory is roughly the number of parameters multiplied by the bytes per weight. A 70-billion-parameter model in 16-bit precision, at 2 bytes per weight, needs about 140 GB for its weights alone. Stored at 4 bits, or half a byte per weight, the same weights need about 35 GB, plus a small overhead for quantisation scales. The KV cache comes on top and grows with context length and the number of concurrent requests. When a model does not fit on one GPU, it has to be split across several, which consumes capacity that could serve other workloads. The LLM GPU sizing calculator estimates these numbers for your models, context lengths and users.

Smaller weights help speed as well as fit. Generating text token by token is memory-bound: the AWQ authors show that the generation stage is limited by memory traffic rather than computation, which is why weight-only quantisation, which moves fewer bytes for every token, speeds up generation.

Edge devices tighten every constraint. A device with a few gigabytes of memory shares it with the operating system and other applications, and power and heat limits cap sustained throughput. There, compression decides whether a model runs at all.

What are the main quantisation methods and formats?

Quantisation methods differ in what they quantise (weights only, or weights and activations), how they choose the quantised values, and which hardware and runtimes can execute the result. A short notation helps: W4A16 means 4-bit weights with 16-bit activations, and W8A8 means 8-bit weights and 8-bit activations.

Method or formatWhat it is, per its paper or projectTypical precisionWhere it runs
GPTQOne-shot, post-training weight quantisation based on approximate second-order information3 or 4-bit weightsServing engines that load GPTQ checkpoints
AWQActivation-aware, post-training, weight-only quantisation that protects salient weight channelsLow-bit weights, typically 4-bit (W4A16)Serving engines that load AWQ checkpoints
FP8 (W8A8)8-bit floating-point weights and activations, in the E4M3 or E5M2 format8-bitIn vLLM: Ada Lovelace, Hopper and Blackwell GPUs; weight-only FP8 on Turing and Ampere
GGUFA single-file model format for GGML-based runtimes, holding quantisation types such as Q4_K and Q8_0From 16-bit floating point to low-bit types such as Q2_Kllama.cpp and other GGML-based runtimes

GPTQ. Its authors describe a one-shot weight quantisation method based on approximate second-order information. It quantised models with 175 billion parameters in about four GPU hours, to 3 or 4 bits per weight, with negligible accuracy degradation relative to the uncompressed baseline. They report end-to-end inference speed-ups over FP16 of around 3.25 times on NVIDIA A100 GPUs and 4.5 times on A6000 GPUs.

AWQ. Activation-aware Weight Quantization starts from the observation that protecting only 1% of salient weights greatly reduces quantisation error, and that salient channels should be identified from the distribution of activations, not of weights. Because it relies on no backpropagation or reconstruction, its authors say it generalises across domains and does not overfit the calibration set. At 4-bit weights it reduces weight memory four times; the paper uses a group size of 128 unless stated otherwise.

FP8. vLLM’s documentation describes FP8 weight-and-activation quantisation with hardware acceleration, using the E4M3 format (1 sign, 4 exponent and 3 mantissa bits) or E5M2 (1 sign, 5 exponent and 2 mantissa bits). It states that FP8 halves model memory requirements and can improve throughput by up to 1.6 times with minimal impact on accuracy. W8A8 needs Ada Lovelace, Hopper or Blackwell GPUs; on Turing and Ampere GPUs, vLLM supports weight-only FP8 (W8A16) through Marlin kernels.

GGUF. GGUF is a file format, not a quantisation algorithm. Its specification describes a binary format for storing models for inference with GGML and GGML-based executors, designed for fast loading and saving, compatible with memory mapping, and holding all the information needed to load the model in a single file. It succeeds the older GGML, GGMF and GGJT formats. The quantisation types it can store range from legacy types such as Q4_0 and Q8_0 to k-quants such as Q4_K and Q6_K.

Labels such as INT4 and INT8 name a data type rather than a method. A 4-bit integer checkpoint may come from GPTQ, AWQ or another algorithm, so check which method, bit width and group size produced it before comparing results. Our comparison of vLLM, Ollama, llama.cpp and SGLang covers which runtimes suit which deployments.

How should you calibrate and validate a quantised model?

Calibrate with data that resembles production, evaluate the exact quantised artefact through the serving engine you will use, and compare it with the full-precision model on your own test set. Published accuracy figures describe the authors’ benchmarks, not your workload.

GPTQ and AWQ both use a small calibration set to choose quantisation parameters. If that set looks nothing like your traffic, quality gaps can appear on real requests, so use representative, anonymised samples of your own prompts. AWQ’s design reduces the risk of overfitting the calibration set, but representative data still matters.

Then test on your tasks:

  • Run the same domain test set against the full-precision and the quantised model, through the same serving engine, tokenizer and chat template.
  • Pay particular attention to tasks that need exact outputs, such as structured extraction, JSON generation or code, where a small error breaks the result.
  • Compare at the precision you will deploy: the AWQ authors note that post-training quantisation can lose substantial accuracy at low bit widths.
  • Keep monitoring after release, because inputs drift towards topics the calibration set did not cover.

Treat the quantised model as its own release artefact, with its own evaluation report, registry entry and rollback path. Our explainer on LLM inference serving covers how serving engines load and batch these models.

How does pruning differ from quantisation?

Pruning removes weights or whole structures instead of lowering their precision, and whether it makes inference faster depends on the pattern of what is removed. Unstructured sparsity needs sparse kernels and storage formats to pay off; structured pruning produces smaller dense matrices that standard hardware runs efficiently.

Unstructured and semi-structured pruning. SparseGPT showed that GPT-family models can be pruned to at least 50% sparsity in one shot, without retraining, at minimal loss of accuracy. On OPT-175B and BLOOM-176B it reached 60% unstructured sparsity with a negligible increase in perplexity, meaning that more than 100 billion weights could be ignored at inference time. The method also extends to semi-structured patterns (2:4 and 4:8), which constrain where zeros may fall so that hardware and kernels can exploit them. Zeroed weights save memory and time only when your runtime stores and computes them sparsely, so check what your GPUs and serving engine support before choosing this route.

Structured pruning. SliceGPT replaces each weight matrix with a smaller dense matrix, reducing the model’s embedding dimension. Its authors report removing up to 25% of the parameters, including embeddings, of Llama-2 70B, OPT 66B and Phi-2 while keeping 99%, 99% and 90% of the dense models’ zero-shot task performance. The sliced models ran on fewer GPUs and faster without extra code optimisation: total inference compute for Llama-2 70B fell to 64% of the dense model’s on 24 GB consumer GPUs and to 66% on 40 GB A100 GPUs. The smallest model kept noticeably less of its performance, so test carefully before pruning small models.

Treat pruning as an offline model-preparation step rather than a runtime setting. Prune, evaluate on your tasks, run a short recovery fine-tune if the evaluation shows a drop, and register the pruned model as a distinct artefact with its lineage. That keeps the serving stack simple and the rollback path clear.

Which techniques suit edge devices with only a few gigabytes of memory?

On edge devices, the whole model and its runtime must fit the device’s memory, power and heat budget, so choose a small model first, then quantise it, load it efficiently and manage it centrally.

  • Post-training quantisation first. It needs no training run and suits established architectures.
  • Quantisation-aware training for your own small models. Quantisation-aware training simulates low precision during training so that the model learns to compensate. The AWQ authors note that its training cost makes it hard to scale to large language models, but it remains an option for smaller models you train yourself, such as defect-detection or document-classification models.
  • Memory-mapped loading. GGUF files can be loaded with memory mapping, so the operating system reads weights from storage as they are needed instead of copying the whole file into memory up front.
  • Iterative structured pruning for custom models. Score structural units such as channels or attention heads by importance, remove the least important in small steps, fine-tune briefly after each step, and stop at the memory target or the accuracy floor, whichever comes first.
  • Shared backbones. When several task-specific models share a backbone, load the shared layers once and branch at the task-specific heads.
  • Distillation when compression is not enough. Training a smaller student model to imitate a larger teacher is a separate technique, and it can be combined with quantisation.

Edge fleets also need a release process. Regenerate the compressed variant automatically when the upstream model changes, validate it against both the uncompressed model and the version already in the field, and track the cases that matter most, such as sensitivity to rare defect types, rather than only aggregate accuracy. Sites without a network connection need the same controls on their import path, as described in our approach to air-gapped AI.

How do you combine pruning and quantisation safely?

Prune and recover first, quantise last, and version every stage, so that each step is calibrated on the weights it will ship and any regression can be traced to one step. SparseGPT’s authors report that their pruning method is compatible with weight quantisation approaches.

Keep at least three registered artefacts: the original base model, the pruned and recovered model, and the pruned-and-quantised deployment artefact, each with its configuration, a reference to its calibration data, and its evaluation report. When a regression appears, compare adjacent stages instead of treating the pipeline as a black box. Automate the whole pipeline, because every new base model version means running it again; otherwise model upgrades turn into one-off projects.

Do not simply add up the savings. Pruning 25% of a 70-billion-parameter model and storing the rest at 4 bits leaves roughly 52.5 billion parameters at half a byte each, about 26 GB of weights before overhead and KV cache, and the accuracy of the combination has to be measured, not inferred from each step on its own.

When is compression the right investment?

Compression pays off when profiling shows that GPU memory or memory bandwidth limits you and the hardware budget is fixed: it lets you run a larger model than your GPUs hold natively, or serve more concurrent users on the same fleet. It does little when the bottleneck lies elsewhere, such as slow retrieval, network calls to other services or CPU-bound preprocessing; then compression buys GPU headroom that users never notice.

Profile the end-to-end request path first. If the GPU is the constraint, start with quantisation, because post-training methods need only a calibration run, not a training run. Add pruning when you need further reductions and have the MLOps maturity to maintain a pipeline that prunes, recovers and re-evaluates. In both cases, compressed models are first-class artefacts with their own evaluation, versioning and rollback, not shortcuts around release governance.

SysArt sizes hardware, selects and compresses models, and builds these pipelines as part of on-premises AI implementation and private LLM platforms.

Featured image by ELLA DON on Unsplash.

Frequently asked questions

What is the difference between GPTQ and AWQ?

Both are post-training methods that quantise weights to low bit widths using a small calibration set. GPTQ is a one-shot method based on approximate second-order information; its authors report 3- or 4-bit weights with negligible accuracy loss on their benchmarks. AWQ protects the most salient weight channels, identified from activations, and uses no backpropagation or reconstruction, which its authors say avoids overfitting the calibration set. Test both on your own tasks.

What is GGUF, and when should I use it?

GGUF is a binary, single-file format for storing models for inference with GGML and GGML-based runtimes such as llama.cpp. It is designed for fast loading, can be loaded with memory mapping, and holds everything needed to load the model, including quantisation types such as Q4_K or Q8_0. Use it when your runtime is GGML-based, for example on workstations or edge devices; for GPU serving engines, check which formats they support.

Do I need special hardware for FP8?

Usually, yes. FP8 stores numbers in 8-bit floating-point formats, E4M3 or E5M2. In vLLM, FP8 for both weights and activations (W8A8) runs on Ada Lovelace, Hopper and Blackwell GPUs, while Turing and Ampere GPUs get weight-only FP8 through Marlin kernels. vLLM's documentation states that FP8 halves model memory requirements and can raise throughput by up to 1.6 times with minimal impact on accuracy.

Does quantisation reduce accuracy?

It can, and the effect depends on the method, the bit width, the model and the task. Published results, such as GPTQ's negligible degradation at 3 or 4 bits, were measured on the authors' benchmarks, and the AWQ authors note that post-training quantisation can lose substantial accuracy at low bit widths. Tasks that need exact outputs, such as structured extraction or code, deserve particular attention in your own tests.

Should I prune or quantise first?

It is usually simpler to prune first, recover accuracy with a short fine-tune if your evaluation shows a drop, and quantise last, so that quantisation is calibrated on the weights you will actually deploy. SparseGPT's authors report that their pruning method is compatible with weight quantisation. Version each stage separately, so that a regression can be traced to the step that caused it.

Is quantisation-aware training worth it?

Quantisation-aware training simulates low precision during training so that the model learns to compensate. The AWQ authors note that it is inefficient because of its high training cost and does not scale easily to large language models, which is why this article focuses on post-training methods for LLMs. It remains an option for smaller models you train yourself, such as edge vision or classification models.

Related insights

Plan your private AI with people who build it

Book a briefing. We look at your use case, data and constraints, and you leave with the deployment options and governance steps that fit.