Grouped Quantization Memory and Overhead Calculator – Free

This grouped quantization memory calculator estimates how much storage quantized weights need when every group of weights also carries its own metadata, such as a scale and a zero point.

How to use the Grouped quantization memory Calculator tool

  1. Enter the total weight count in Number of values, digits only.
  2. Enter the quantized width in Bits per value, a whole number from 1 to 64.
  3. Enter the group size in Weights per group and the size of each group's parameters in Metadata bytes per group, from 0 to 1024.
  4. Select Calculate. Example fills in 1048576 values, 4 bits, groups of 128 and 4 metadata bytes.
  5. Read the total in bytes and MiB, then the Packed weights and Metadata lines. Select Copy to save them.

How grouped quantization stores weights

Group-wise quantization splits a weight tensor into fixed-size groups, often 32, 64 or 128 weights. Each group gets its own scale, and sometimes a zero point or minimum, so the low-bit integers can follow the local range of the weights. Methods such as GPTQ and AWQ work this way.

The storage therefore has two parts: the integers, packed at a few bits each, and the per-group parameters, which stay at higher precision. The second part is easy to forget. With 4-bit weights and 4 metadata bytes per 128 weights, the real cost is 4.25 bits per weight, not 4.

Worked example: 1,048,576 weights at 4 bits

Packed weights take 1,048,576 x 4 / 8 = 524,288 bytes. Dividing the count by 128 gives 8,192 groups, and at 4 bytes each the metadata adds 32,768 bytes. The total is 557,056 bytes, or 0.53125 MiB. That is 6.25% more than the packed integers alone.

557,056 bytes
0.53125 MiB
Packed weights: 524288 bytes
Metadata: 32768 bytes across 8192 groups

The formula and its assumptions

The estimate is the sum of two rounded-up terms. It is arithmetic on your four inputs, not a measurement of a real file.

  • Packed bytes = count x bits / 8, rounded up. Weights are treated as one continuous bitstream, not padded per group.
  • Groups = count / group size, rounded up. A partial last group is charged full metadata.
  • Metadata bytes = groups x metadata bytes per group.
  • File headers, alignment, tokenizer data and layers left unquantized are not included.
  • Counts and group sizes accept up to 24 digits and must be greater than zero. An error message names the field as Count, Bits, Group size or Metadata bytes.

Choosing a group size

Smaller groups fit the weights more closely and usually lower quantization error, but they multiply the metadata. For the example tensor with 4 metadata bytes, groups of 128 cost 557,056 bytes, groups of 64 cost 589,824 bytes, and groups of 32 cost 655,360 bytes.

A quick rule is effective bits per weight = bits + 8 x metadata bytes / group size. The three cases above work out to 4.25, 4.5 and 5 bits per weight. Run the calculator with your real parameter sizes before comparing formats by their nominal bit width.

Frequently asked questions

What should I enter for metadata bytes per group?

Add up the per-group parameters your format stores. One float16 scale is 2 bytes. A float16 scale plus a float16 zero point is 4. Two float32 values are 8. Enter 0 to see the packed weights alone. The field accepts 0 to 1024.

How do I calculate effective bits per weight?

Multiply the total bytes by 8 and divide by the weight count. For the default example, 557,056 x 8 / 1,048,576 = 4.25 bits per weight, although the weights themselves are stored with 4 bits.

Will the result match my model file size?

Not exactly. It is an estimate of quantized weight storage only. Real files add headers, vocabulary, alignment padding and tensors kept in 16 or 32 bits, such as embeddings or normalization layers, so expect the file to be somewhat larger.

What happens when the weight count is not a multiple of the group size?

The group count is rounded up. With 1000 weights and groups of 64, there are 15 full groups and one group of 40, so 16 groups are charged. At 3 bits and 2 metadata bytes the result is 375 + 32 = 407 bytes.

Can it handle a model with billions of parameters?

Yes. Counts up to 24 digits are processed with exact integer arithmetic. For 7,000,000,000 weights at 4 bits in groups of 128 with 4 metadata bytes, the tool reports 3,718,750,000 bytes, or 3,546.476364 MiB.

Related tools