The Serving Memory Bill

Deep Learning in the Real WorldEasy+10 XP+10

The Serving Memory Bill

A 2.52.52.5-billion-parameter model has just finished training. Throughout the run, the GPU had to hold all of the following at once, with every number stored at 32 bits (4 bytes):

what the training run keepshow much
weightsone number per parameter
gradientsone number per parameter
optimizer statetwo numbers per parameter
stored activations121212 GB in total

For serving, the weights are quantized to 8 bits, and the GPU holds only what inference itself needs. Ignore the small scratch space a single forward pass needs while it runs.

Take 1 GB=1091 \text{ GB} = 10^91 GB=109 bytes.

By what factor is the serving memory smaller than the training memory?

Round your answer to 1 decimal place.

Stored activations
Backprop needed every intermediate value. Inference does not, so memory falls sharply.

A model that needed a large GPU to train often runs comfortably on far less, once none of this is required.

Hints

Solve it to unlock the solution

Once you get it right, the reasoning behind the answer shows up here.