arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2606.13894cs.LGcs.AIcs.CLcs.CV
收藏

Gefen: 优化随机优化器

Gefen: Optimized Stochastic Optimizer

Reichman University(赖希曼大学);Tel Aviv University(特拉维夫大学);Google Research(谷歌研究院)

Nadav Benedek, Tomer Koren, Ohad Fried

AI总结:

提出Gefen优化器,通过共享二阶矩估计和量化一阶矩,将AdamW内存占用减少约8倍,同时保持相同性能,支持更大批量和吞吐量。

摘要:

AdamW是现代深度学习的默认优化器,但其一阶和二阶矩状态会额外占用约两倍参数大小的训练内存。我们提出Gefen,一种内存高效的优化器,它自动在参数块之间共享二阶矩估计,并使用学习到的码本量化一阶矩,从而将AdamW的内存占用减少约8倍,同时保持相同性能,相当于每十亿参数减少6.5 GiB。该方法受理论结果启发,该结果表明大的混合Hessian项将平方梯度的比率约束为接近1,表明Hessian对齐的参数是共享二阶矩统计量的自然候选。由于大规模计算Hessian不切实际,Gefen从初始平方梯度推断块结构,除了AdamW默认超参数外,不需要任何架构特定的元数据或超参数。Gefen学习基于精确直方图的动态规划量化码本,并重用相同的块进行一阶矩缩放。在多种实验中,Gefen在比较的类似AdamW的方法中实现了最低的峰值优化器内存,同时保持AdamW级别的性能。在FSDP和DDP训练中,减少的内存占用支持更大的微批次,并显著提高相对于AdamW的吞吐量,提供了一种实用的即插即用替代方案,具有更低的内存使用,可以增加吞吐量并支持训练更大的模型或使用更大的批量大小。我们提供了完整的Python实现,包括融合CUDA内核,网址为https://this https URL。

英文摘要:

AdamW is a default optimizer for deep learning, but its moment states add two parameter-sized buffers to training memory, increasing the cost of large-scale pretraining. We propose Gefen, a memory-efficient optimizer that automatically shares second-moment estimates across parameter blocks and quantizes the first moment using a learned codebook. Gefen reduces AdamW's optimizer memory footprint by up to 8x while maintaining performance, saving 6.5 GiB per billion parameters. Prior work shares second moments across parameters grouped along the Hessian's block-diagonal structure, but relies on hand-specified architectural rules and leaves unexplained why such grouping works. We prove that large mixed Hessian entries constrain the ratio of squared gradients toward one, explaining why shared second moments are accurate when the squared gradients they pool are similar. The Hessian need not be computed: its block structure is inherited by squared gradients, allowing blocks to be found directly. Gefen therefore infers block structure from initial squared gradients, requiring no architecture-specific metadata or user-tuned hyperparameters beyond AdamW defaults. Gefen learns an exact histogram-based dynamic-programming quantization codebook and reuses the blocks for first-moment scaling. Across diverse pretraining experiments, Gefen achieves the lowest peak optimizer memory among compared methods that maintain AdamW-level performance. In single-machine and distributed training, the reduced footprint enables larger microbatches and substantially improves throughput over AdamW, making Gefen a drop-in replacement that can train larger models or use larger global batch sizes. We provide the complete Python implementation, including fused CUDA kernels at https://github.com/ndvbd/Gefen

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑