GPU Memory Bottlenecks in Large-Scale Model Training: A Practical Guide to the Muon Optimizer

    As models scale into the trillions of parameters, GPU memory often becomes a bottleneck before compute does. This article breaks down what actually consumes that memory—especially optimizer state, which can exceed the size of the model weights themselves—and explains how matrix-level orthogonalization, as used by the Muon optimizer, reduces state overhead. It covers why orthogonalization balances update scales, where it applies and where it does not, the engineering work required to run it at industrial scale, and practical advice for budgeting memory and choosing an optimizer.

    1. Where the Problem Starts: What Is Actually Consuming GPU Memory

    In trillion-parameter model training, GPU memory tends to become a bottleneck before compute does. Many teams respond by adding more accelerators, but the first thing worth calculating is who is actually occupying that memory.

    An often-overlooked fact is that optimizer state can cost more than the model weights themselves. Take a mainstream adaptive optimizer: to provide an adaptive step size for each parameter, it stores two extra statistics per parameter—a first moment and a second moment. Under mixed-precision training, weights, gradients, and the two moment estimates add up, and optimizer state alone can account for memory in the range of tens of terabytes.

    A rough estimation formula helps build intuition:

    1. Optimizer state memory ≈ parameter count × bytes per parameter × number of state copies
    2. Example: 1.6e12 parameters × 2 bytes × 2 copies ≈ 6.4 TB (a single state combination is already substantial)
    3. Add weight copies, gradients, and activations, and the total quickly approaches tens of TB

    The conclusion is straightforward: once state variables squeeze the available memory, the room left for batch size and context length shrinks sharply. Those two factors determine training throughput and long-context capability, so training costs rise, and engineering is forced to rely on more parallelism and recomputation, which further reduces efficiency.

    2. An Overlooked Optimization Path: From Element-Wise to Whole-Matrix

    An optimizer is essentially a way of optimizing how weights are updated. The element-wise approach treats a weight matrix as a collection of individual scalars, maintaining separate statistics and deciding a separate step size for each one. Its strength is adaptivity; its weakness is the state overhead described above.

    The matrix-level approach takes a different view: a 1000×1000 weight matrix is not a set of ten thousand independent scalars but an indivisible high-dimensional geometric object. Under this assumption, updates are no longer computed element by element. Instead, the matrix formed by fusing the gradient and momentum is first orthogonalized, then added to the weights as a whole. Because there is no longer a need to store two moment estimates per parameter over the long term, memory usage drops significantly.

    An intuitive analogy: element-wise optimization is like a group of soldiers each fighting on their own, where every individual must be commanded separately; matrix-level optimization first forms the troops into a square formation and then advances them in step. The difference in command overhead is obvious.

    Illustrative update logic (pseudocode, expressing the idea only):

    1. # Element-wise adaptive: maintain two states per parameter
    2. m = beta1 * m + (1 - beta1) * grad
    3. v = beta2 * v + (1 - beta2) * grad * grad
    4. param -= lr * m / (sqrt(v) + eps)
    5. # Matrix-level orthogonalization: fewer states, update applied to the whole matrix
    6. buf = momentum * buf + grad # only one momentum buffer
    7. update = orthogonalize(buf) # orthogonalize the matrix
    8. param -= lr * update # add as a whole

    3. Why It Works: Step-Size Balancing Through Orthogonalization

    The core effect of orthogonalization is to give the directions of the update matrix comparable scales, preventing a few directions from dominating absolutely. This brings two benefits:

    • Fewer training steps. In small- and mid-scale racing experiments, orthogonalizing only the gradients of hidden-layer parameters produced a cliff-like drop in the steps needed to reach a target loss; such results once set the speed record for small-scale training at the time.
    • Better numerical stability. Once update directions are “straightened out,” sensitivity to the learning rate decreases and hyperparameter transfer becomes more predictable.

    It is worth stressing that orthogonalization does not apply to all parameters. The common industry practice is that two-dimensional weight matrices in hidden layers are suited to matrix-level updates, while embedding layers, output heads, normalization parameters, and biases usually keep the original adaptive update method.

    4. From Toy Scale to Industrial Scale: Doubts and the Engineering Gaps to Fill

    When this class of optimization first appeared, it had only been validated on small models around 100 million parameters, so it quickly drew skepticism: does the neat “square formation” seen at small scale still hold when scaled to hundreds of billions of parameters?

    To hold up in industrial-grade training, the following usually needs to be in place:

    1. Distributed sharding compatibility. Tensor parallelism, pipeline parallelism, and sequence parallelism cut weight matrices into pieces; orthogonalization requires correct communication and aggregation along the sharded dimensions, otherwise the geometric properties are broken.
    2. Amortizing computation overhead. Orthogonalization itself requires extra matrix operations; in engineering, the extra cost is generally diluted through low-precision iterations and reduced synchronization frequency.
    3. Mixed update strategy. Using different optimizers for different layers requires consistency in parameter grouping, state management, and checkpoint format.
    4. Numerical and stability fallbacks. Orthogonalization iterations under low precision may fail to converge, so orthogonality residuals need to be monitored and a fallback strategy put in place.
    5. Observability. Bringing gradient norms, update norms, and orthogonality residuals into logging services and monitoring alerts is what makes anomalies detectable during long training runs.

    5. Practical Advice: Do the Math First, Then Choose

    • Build a memory budget first: estimate weights, gradients, optimizer state, and activations separately, and identify the bottleneck item.
    • Run small-scale alignment experiments: verify convergence and throughput in the 100 million to 1 billion parameter range, then scale up gradually.
    • Keep a fallback switch: any new optimizer should be able to revert to the baseline without changing the data pipeline.
    • Work with platform capabilities: a container platform handles elastic resource orchestration, object storage holds checkpoints and datasets, and the logging and monitoring system provides long-run observability; these general capabilities together determine whether large-scale training runs stably.

    Overall, the real value of matrix-level orthogonalized optimization is not just saving memory, but reframing the “optimizer” from an element-wise tuning problem into a matrix geometry problem. It returns the saved memory to batch size and context length, changing the cost-performance structure of large-scale training—and that is the key reason it has moved from experiment to industrial application.