GPTQ does not define a container. A published checkpoint is safetensors or a torch state dict whose linear layers are stored as qweight, qzeros, scales, and g_idx, plus quantize_config.json (or quantization_config). This spec specifies the pack written by AutoGPTQ qlinear_cuda.QuantLinear (QUANT_TYPE "cuda") at 9f7d37072917. Marlin and the ExLlama kernels in the same tree have their own pack methods and are not this layout. The container bytes are the safetensors spec or the pytorch spec.
.safetensors .pt .bin
What it is
weight pack
Byte order
little
Dimension order
row major
Compression
none
Metadata
json
Loading
Loading it into a library can execute code, depending on the loader and the file.
How to read it
Where the values live
name
module prefix; the logical weight is prefix + '.qweight' plus the sibling tensors
dtype
none as a canonical element type; the packed words are int32. Logical values are unsigned bits-wide integers.
shape
[out_features, in_features] after unpack. qweight's on-disk shape is [in_features // 32 * bits, out_features].
GPTQ-004. g_idx length == in_features and each index selects a scale/zero row
GPTQ-005. Reject checkpoint_format marlin rather than unpacking it with this routine
GPTQ-006. Add 1 to each unpacked zero before dequant. The writer subtracts 1 before packing.
Example
Example file. AutoGPTQ QuantLinear.pack wrote this safetensors file. The CUDA extension was not installed, so pack() is numpy. Names, dtypes, shapes, and stored bytes match the recorded hashes. This page does not unpack the weights. The header below is spaced for reading; the file pads that JSON with spaces out to a multiple of 8.