Abstract
Training neural networks with many processors can reduce time-to-solution; however, it is challenging to maintain convergence and efficiency at large scales. The Kronecker-factored Approximate Curvature (K-FAC) was recently proposed as an approximation of the Fisher Information Matrix that can be used in natural gradient optimizers. We investigate here a scalable K-FAC design and its applicability in convolutional neural network (CNN) training at scale. We study optimization techniques such as layer-wise distribution strategies, inverse-free second-order gradient evaluation, and dynamic K-FAC update decoupling to reduce training time while preserving convergence. We use residual neural networks (ResNet) applied to the CIFAR-10 and ImageNet-1k datasets to evaluate the correctness and scalability of our K-FAC gradient preconditioner. With ResNet-50 on the ImageNet-1k dataset, our distributed K-FAC implementation converges to the 75.9% MLPerf baseline in 18-25% less time than does the classic stochastic gradient descent (SGD) optimizer across scales on a GPU cluster.
The Scalability Challenge in Second-Order Optimization
Training deep neural networks at scale usually relies on first-order optimizers like Stochastic Gradient Descent (SGD). While SGD is easy to parallelize, it often requires a massive number of iterations to converge. Second-order methods, which use information about the "curvature" of the loss landscape (the Fisher Information Matrix or FIM), can converge in far fewer steps.
However, second-order methods are notoriously difficult to scale. The FIM is massive and computationally expensive to invert. K-FAC was proposed to approximate the FIM using Kronecker products, making it more manageable. Despite this, previous distributed K-FAC implementations either failed to reach competitive accuracy (like the MLPerf baseline) or were actually slower than optimized SGD due to the high overhead of computing and communicating curvature information.
Distributed K-FAC Design
Kronecker-Factored Approximation
The core idea of K-FAC is to approximate the Fisher Information Matrix as a block-diagonal matrix, where each block corresponds to a layer. Each block $\hat{F}_i$ is further approximated as the Kronecker product of two smaller matrices, $A$ and $G$, derived from the layer's activations and gradient backpropagation.
To make this approach robust at scale, the authors propose several key innovations:
- Inverse-Free Gradient Evaluation: Instead of explicitly inverting the Kronecker factors (which can be numerically unstable), they use eigen-decomposition. This approach is more robust, especially as batch sizes increase, and helps maintain model convergence.
- Distributed Factor Computation: They distribute the heavy lifting of computing eigen-decompositions across the GPU cluster. Using a round-robin assignment, each worker handles the decomposition for a subset of layers. The results are then shared via an
allgatheroperation.
Dynamic Update Decoupling and Overlap
Curvature doesn't change instantly. The authors decouple the curvature approximation from the weight updates. By updating the preconditioner (the "inverse" FIM) every tens or hundreds of iterations rather than every step, they significantly reduce communication and computation overhead without sacrificing accuracy.
By splitting communication into three distinct phases—averaging gradients, averaging Kronecker factors, and gathering decompositions—the system can overlap computation with communication more effectively. As training progresses, the Fisher Information Matrix becomes more stable, allowing for increasingly infrequent updates to the preconditioner.
Key Results and Performance
- Speedup: On a GPU cluster (Nvidia V100s), the distributed K-FAC implementation trained ResNet-50 on ImageNet 18–25% faster than the classic SGD optimizer.
- Accuracy: It successfully hit the 75.9% validation accuracy required by the MLPerf baseline, a milestone that previous distributed K-FAC implementations struggled to reach.
- Iteration Efficiency: K-FAC reached the target accuracy in significantly fewer epochs (e.g., 43 epochs for K-FAC vs. 76 epochs for SGD on ResNet-50).
- Scalability: The system demonstrated strong scaling up to 256 GPUs, maintaining a sustained scaling efficiency of over 70% in many configurations.
Limitations and Future Work
The researchers identified a specific scaling bottleneck: Factor Computation. While the eigen-decomposition is distributed across workers, the initial computation of the Kronecker factors ($A$ and $G$) happens locally on each worker for every layer. As models get deeper (like ResNet-152) and the number of parameters grows, this stage becomes a serial bottleneck. Future work will explore more scalable K-FAC approximation strategies that can parallelize the factor computation itself and apply this design to other architectures like Transformers.
Summary updated