OhMyCalc

Model Size Calculator

Calculate the memory footprint of a machine learning model based on number of parameters and numeric precision. Plan GPU memory requirements for inference.

How to Use the Model Size Calculator

  1. Enter the number of model parameters in millions.
  2. Select the numeric precision (FP32, FP16, or INT8).
  3. Click Calculate to get model size and inference memory.

使用场景

公式

Model size (MB) = Parameters × bytes_per_param / 1,048,576. Inference memory ≈ model size × 1.5 (activations overhead).

常见问题

What is FP16 vs INT8?
FP16 uses 2 bytes per parameter (half precision); INT8 uses 1 byte (quantized). Both reduce memory vs FP32's 4 bytes.
Why is inference memory larger than model size?
Activation tensors during forward pass require additional memory, typically 30–50% overhead.
How many parameters does GPT-2 have?
GPT-2 large has 774 million parameters, requiring about 1.5 GB in FP16.