Table of Contents
Fetching ...

DASH: Faster Shampoo via Batched Block Preconditioning and Efficient Inverse-Root Solvers

Ionut-Vlad Modoranu, Philip Zmushko, Erik Schultheis, Mher Safaryan, Dan Alistarh

TL;DR

DASH addresses the computational bottleneck of Shampoo by redesigning preconditioner handling and inverse-root computations for GPUs. It stacks preconditioner blocks into 3D tensors to boost throughput and introduces fast inverse-root solvers (CN, NDB) and Chebyshev-based approaches, guided by matrix-scaling analyses and a multi-Power-Iteration strategy. Empirical results on large-scale models show DASH can achieve up to ~$4$–$5\times$ faster optimizer steps while matching or improving validation perplexity, with NDB often delivering the best accuracy. The approach paves the way for practical deployment of advanced second-order optimizers in large-scale training and provides a foundation for dynamic solver selection and further hardware-aware optimizations.

Abstract

Shampoo is one of the leading approximate second-order optimizers: a variant of it has won the MLCommons AlgoPerf competition, and it has been shown to produce models with lower activation outliers that are easier to compress. Yet, applying Shampoo currently comes at the cost of significant computational slowdown, due to its expensive internal operations. In this paper, we take a significant step to address this shortcoming by proposing \method (for \textbf{D}istributed \textbf{A}ccelerated \textbf{SH}ampoo), a faster implementation of Distributed Shampoo based on two main new techniques: First, we show that preconditioner blocks can be stacked into 3D tensors to significantly improve GPU utilization; second, we introduce the Newton-DB iteration and the Chebyshev polynomial approximations as novel and faster approaches for computing the inverse matrix roots required by Shampoo. Along with these algorithmic contributions, we provide a first in-depth analysis of how matrix scaling critically affects Shampoo convergence. On the practical side, our GPU-aware implementation achieves up to $4.83\times$ faster optimizer steps compared to the well-optimized Distributed Shampoo, while Newton-DB attains the lowest validation perplexity per iteration among all tested methods. Our code is available at https://github.com/IST-DASLab/DASH.

DASH: Faster Shampoo via Batched Block Preconditioning and Efficient Inverse-Root Solvers

TL;DR

DASH addresses the computational bottleneck of Shampoo by redesigning preconditioner handling and inverse-root computations for GPUs. It stacks preconditioner blocks into 3D tensors to boost throughput and introduces fast inverse-root solvers (CN, NDB) and Chebyshev-based approaches, guided by matrix-scaling analyses and a multi-Power-Iteration strategy. Empirical results on large-scale models show DASH can achieve up to ~ faster optimizer steps while matching or improving validation perplexity, with NDB often delivering the best accuracy. The approach paves the way for practical deployment of advanced second-order optimizers in large-scale training and provides a foundation for dynamic solver selection and further hardware-aware optimizations.

Abstract

Shampoo is one of the leading approximate second-order optimizers: a variant of it has won the MLCommons AlgoPerf competition, and it has been shown to produce models with lower activation outliers that are easier to compress. Yet, applying Shampoo currently comes at the cost of significant computational slowdown, due to its expensive internal operations. In this paper, we take a significant step to address this shortcoming by proposing \method (for \textbf{D}istributed \textbf{A}ccelerated \textbf{SH}ampoo), a faster implementation of Distributed Shampoo based on two main new techniques: First, we show that preconditioner blocks can be stacked into 3D tensors to significantly improve GPU utilization; second, we introduce the Newton-DB iteration and the Chebyshev polynomial approximations as novel and faster approaches for computing the inverse matrix roots required by Shampoo. Along with these algorithmic contributions, we provide a first in-depth analysis of how matrix scaling critically affects Shampoo convergence. On the practical side, our GPU-aware implementation achieves up to faster optimizer steps compared to the well-optimized Distributed Shampoo, while Newton-DB attains the lowest validation perplexity per iteration among all tested methods. Our code is available at https://github.com/IST-DASLab/DASH.
Paper Structure (23 sections, 6 equations, 2 figures, 3 tables, 5 algorithms)

This paper contains 23 sections, 6 equations, 2 figures, 3 tables, 5 algorithms.

Figures (2)

  • Figure 1: Number of steps required for NDB and CN to compute the square and inverse square roots of scalar numbers between 0 and 1 (in log-scale) up to precision $10^{-10}$ to emphasize the behavior for small eigenvalues.
  • Figure 2: Number of steps required for NDB and CN to compute the square and inverse square roots of scalars between 0 and 1 (in linear scale) up to precision $10^{-10}$. We added a shift for NDB iterations to improve visibility on the y-axis.