KAISA: An Adaptive Second-order Optimizer Framework for Deep Neural Networks

J. Gregory Pauloski, Qi Huang, Lei Huang, Shivaram Venkataraman, Kyle Chard, Ian T. Foster, Zhao Zhang · DOI

Introduction

Training massive deep learning models efficiently remains a significant challenge. While first-order optimizers like Stochastic Gradient Descent (SGD) and Adam are industry standards due to their reliability, they only utilize the gradient (the "slope") of the loss function. This often leads to slow convergence, requiring thousands of iterations. Second-order methods, which leverage curvature information via the Hessian matrix, promise much faster convergence in terms of step count. However, the computational and communication overhead of these methods has historically limited their practical application.

The K-FAC Bottleneck

Kronecker-factored Approximate Curvature (K-FAC) is a leading second-order optimization technique. It approximates the Fisher Information Matrix (FIM) as a block-diagonal matrix, where each block is a Kronecker product of two smaller matrices, making the inverse much easier to compute.

The K-FAC approximation decomposes the inverse Fisher Information Matrix into a block-diagonal structure of Kronecker products.

Despite its theoretical advantages, K-FAC imposes a heavy "tax":

  1. Memory: Storing large Kronecker factors and their inverses requires significant GPU memory.
  2. Computation: Calculating eigen-decompositions is an $O(N^3)$ operation.
  3. Communication: In distributed settings, synchronizing these large matrices across nodes creates a massive bottleneck.

Existing implementations are often rigid, optimizing either for memory (MEM-OPT) or communication (COMM-OPT), but rarely both. KAISA (Kronecker-factored Adaptive In-situ Second-order Approximation) addresses these challenges by providing a flexible framework that adapts to hardware constraints and model architectures.

The KAISA Framework

KAISA introduces several innovations to make second-order optimization practical and scalable.

HYBRID-OPT Distribution

The core of KAISA is HYBRID-OPT, a configurable distribution strategy. It introduces a grad_worker_frac parameter, allowing users to tune the fraction of GPUs that cache eigen-decompositions. This enables a smooth transition between low-memory/high-communication and high-memory/low-communication profiles based on the specific needs of the model (e.g., BERT vs. ResNet).

Efficiency and Stability

  • Greedy Load Balancing: KAISA uses a "longest processing time" algorithm to distribute eigen-decomposition tasks across GPUs, minimizing idle time caused by varying layer sizes.
  • Mixed-Precision Optimization: To save memory without sacrificing stability, KAISA stores factors in FP16 but performs sensitive eigen-decompositions in FP32.
  • Optimized Preconditioning: By moving redundant calculations into the infrequent eigen-decomposition stage, KAISA reduces per-iteration overhead by up to 53%.

Key Results

The authors evaluated KAISA across image classification (ResNet-50), object detection (Mask R-CNN), medical imaging (U-Net), and language modeling (BERT-Large).

Comparison of validation accuracy over epochs for SGD and K-FAC, showing K-FAC's significantly faster convergence to the target accuracy.
  • Faster Convergence: KAISA converged 18.1% to 36.3% faster than baselines like SGD and LAMB across all tested applications.
  • Scalability: The framework demonstrated excellent scaling on up to 128 NVIDIA A100 GPUs. On ResNet-50, KAISA achieved a speedup of ~1.67x over SGD at scale.
  • Resource Efficiency: Under strict memory budgets, KAISA outperformed momentum SGD by 32.5% on ResNet-50 and Fused LAMB by 41.6% on BERT-Large in terms of time-to-convergence.

Conclusion

KAISA makes second-order optimization practical for large-scale deep learning. By treating communication and memory trade-offs as tunable parameters rather than fixed constraints, it allows researchers to harness the convergence speed of K-FAC across diverse hardware environments and model architectures. Future work aims to automate the tuning of these parameters at a per-layer level to further optimize performance.

Summary updated

BibTeX
@inproceedings{pauloski2021kaisa,
  author = {J. Gregory Pauloski and Qi Huang and Lei Huang and Shivaram Venkataraman and Kyle Chard and Ian T. Foster and Zhao Zhang},
  title = {{KAISA: An Adaptive Second-order Optimizer Framework for Deep Neural Networks}},
  booktitle = {SC},
  year = {2021},
  doi = {10.1145/3458817.3476152},
}
Figure