Skip to content
nonconvexcard

When activations dominate

NumericalBeginner⏱ 30 minFine-Tuningactivationssequence lengthmemory

Problem

For a model with L=32L=32, d=4096d=4096, using 20 bytes of activation per layer per token per unit width divided by dd — that is, 20Ld20Ld bytes per token:

  1. Compute activation memory for batch 8 at sequence lengths 512, 4096 and 32768.
  2. Compare each with the 13.4 GB of BF16 weights.
  3. At which sequence length do activations exceed LoRA's entire persistent state?

Compute the requested quantities and say what they mean. A number without an interpretation is not an answer.

Solution

Opening this before you have a real attempt on paper is the fastest way to feel like you understand something you cannot reproduce.

Related problems

All problems
SolvedProblemFieldTypeDifficultyTime
KV cache sizing with MHA and GQALLM OpsNumericalBeginner30 min
Product quantisation budget arithmeticRAGNumericalBeginner30 min
When does attention dominate the MLP?Deep LearningNumericalBeginner30 min
Will this fine-tune fit?Fine-TuningNumericalBeginner30 min
How many users fit on one GPULLM OpsNumericalIntermediate30 min