A Distributed Data-Parallel PyTorch Implementation of the Distributed Shampoo Optimizer for Training Neural Networks At-Scale

Hao-Jun Michael Shi, Tsung-Hsien Lee, Shintaro Iwasaki, Jose Gallego-Posada, Zhijing Li, Kaushik Rangadurai, Dheevatsa Mudigere, Michael Rabbat
{"title":"A Distributed Data-Parallel PyTorch Implementation of the Distributed Shampoo Optimizer for Training Neural Networks At-Scale","authors":"Hao-Jun Michael Shi, Tsung-Hsien Lee, Shintaro Iwasaki, Jose Gallego-Posada, Zhijing Li, Kaushik Rangadurai, Dheevatsa Mudigere, Michael Rabbat","doi":"arxiv-2309.06497","DOIUrl":null,"url":null,"abstract":"Shampoo is an online and stochastic optimization algorithm belonging to the\nAdaGrad family of methods for training neural networks. It constructs a\nblock-diagonal preconditioner where each block consists of a coarse Kronecker\nproduct approximation to full-matrix AdaGrad for each parameter of the neural\nnetwork. In this work, we provide a complete description of the algorithm as\nwell as the performance optimizations that our implementation leverages to\ntrain deep networks at-scale in PyTorch. Our implementation enables fast\nmulti-GPU distributed data-parallel training by distributing the memory and\ncomputation associated with blocks of each parameter via PyTorch's DTensor data\nstructure and performing an AllGather primitive on the computed search\ndirections at each iteration. This major performance enhancement enables us to\nachieve at most a 10% performance reduction in per-step wall-clock time\ncompared against standard diagonal-scaling-based adaptive gradient methods. We\nvalidate our implementation by performing an ablation study on training\nImageNet ResNet50, demonstrating Shampoo's superiority over standard training\nrecipes with minimal hyperparameter tuning.","PeriodicalId":501256,"journal":{"name":"arXiv - CS - Mathematical Software","volume":"12 1","pages":""},"PeriodicalIF":0.0000,"publicationDate":"2023-09-12","publicationTypes":"Journal Article","fieldsOfStudy":null,"isOpenAccess":false,"openAccessPdf":"","citationCount":"0","resultStr":null,"platform":"Semanticscholar","paperid":null,"PeriodicalName":"arXiv - CS - Mathematical Software","FirstCategoryId":"1085","ListUrlMain":"https://doi.org/arxiv-2309.06497","RegionNum":0,"RegionCategory":null,"ArticlePicture":[],"TitleCN":null,"AbstractTextCN":null,"PMCID":null,"EPubDate":"","PubModel":"","JCR":"","JCRName":"","Score":null,"Total":0}
引用次数: 0

Abstract

Shampoo is an online and stochastic optimization algorithm belonging to the AdaGrad family of methods for training neural networks. It constructs a block-diagonal preconditioner where each block consists of a coarse Kronecker product approximation to full-matrix AdaGrad for each parameter of the neural network. In this work, we provide a complete description of the algorithm as well as the performance optimizations that our implementation leverages to train deep networks at-scale in PyTorch. Our implementation enables fast multi-GPU distributed data-parallel training by distributing the memory and computation associated with blocks of each parameter via PyTorch's DTensor data structure and performing an AllGather primitive on the computed search directions at each iteration. This major performance enhancement enables us to achieve at most a 10% performance reduction in per-step wall-clock time compared against standard diagonal-scaling-based adaptive gradient methods. We validate our implementation by performing an ablation study on training ImageNet ResNet50, demonstrating Shampoo's superiority over standard training recipes with minimal hyperparameter tuning.
用于大规模训练神经网络的分布式洗发水优化器的分布式数据并行PyTorch实现
Shampoo是一种在线随机优化算法,属于adagrad系列训练神经网络的方法。它构造了块对角预调节器,其中每个块由对神经网络的每个参数的全矩阵AdaGrad的粗Kroneckerproduct近似组成。在这项工作中,我们提供了算法的完整描述,以及我们的实现在PyTorch中大规模训练深度网络所利用的性能优化。我们的实现通过PyTorch的DTensor数据结构分配与每个参数块相关的内存和计算,并在每次迭代时对计算的搜索方向执行AllGather原语,从而实现快速的多gpu分布式数据并行训练。与标准的基于对角线缩放的自适应梯度方法相比,这种主要的性能增强使我们能够实现每步时钟时间最多10%的性能降低。我们通过对trainingImageNet ResNet50进行消融研究来验证我们的实现,通过最小的超参数调优证明了Shampoo优于标准训练配方。
本文章由计算机程序翻译,如有差异,请以英文原文为准。
求助全文
约1分钟内获得全文 求助全文
来源期刊
自引率
0.00%
发文量
0
×
引用
GB/T 7714-2015
复制
MLA
复制
APA
复制
导出至
BibTeX EndNote RefMan NoteFirst NoteExpress
×
提示
您的信息不完整,为了账户安全,请先补充。
现在去补充
×
提示
您因"违规操作"
具体请查看互助需知
我知道了
×
提示
确定
请完成安全验证×
copy
已复制链接
快去分享给好友吧!
我知道了
右上角分享
点击右上角分享
0
联系我们:info@booksci.cn Book学术提供免费学术资源搜索服务,方便国内外学者检索中英文文献。致力于提供最便捷和优质的服务体验。 Copyright © 2023 布克学术 All rights reserved.
京ICP备2023020795号-1
ghs 京公网安备 11010802042870号
Book学术文献互助
Book学术文献互助群
群 号:481959085
Book学术官方微信