$ show lixilinx/psgd_torch
This repository provides a PyTorch implementation of Preconditioned Stochastic Gradient Descent (PSGD), a general-purpose second-order optimizer. It implements various preconditioner structures including Kronecker product, low-rank approximation, dense matrix, affine group, and X-matrix preconditioners. The code offers both Newton-type and whitening preconditioners with multiple update rules for the preconditioner matrices. Key features include support for different geometries (Q0.5EQ1.5, EQ, QEP, etc.), momentum handling, gradient clipping, and numerical stability mechanisms. The library includes optimizers suitable for various deep learning applications as demonstrated in the provided examples (vision transformers, GPT2, LSTMs, CNNs, etc.).
The LLM identified 1 files worth highlighting for reuse:
Contains the KronWhiten and KronNewton classes implementing sophisticated Kronecker product preconditioners with multiple update rules (Q0.5EQ1.5, EQ, QEQ, QUAD, etc.). These components are highly reusable as they depend only on torch and opt_einsum, demonstrate non-obvious mathematical skill in implementing advanced optimization techniques, and provide state-of-the-art preconditioning for deep learning models.