How would you optimize the training loop of a large language model to minimize memory bottlenecks across a multi-GPU cluster?