Catalog PyPI
PACKAGE EXPLORERView in registry

adv-lion

PyPI

Pytorch Lion optimizer with updated and advanced features.

fine-tuninglionllmoptimizerpytorch
Versions collected1
Direct dependencies1From release 0.1.1
Last observed20 Oct, 20:04 UTC

README

Version 0.1.1 documentation

Advanced Lion Optimizer

This repository provides an enhanced implementation of the Lion optimizer, incorporating several state-of-the-art techniques to improve performance, stability, and memory efficiency. It includes two base variants: the original Lion and D-Adapt-Lion.


Features

1. Fused Backward Pass

Reduces memory overhead by hooking gradients as they become available during the backward pass, eliminating the need to store them explicitly via the step_parameter method.


2. Stochastic Rounding for BF16 Training

Achieves FP32-level performance in BF16 training by implementing stochastic rounding for the final update. This allows for faster training with lower-precision data types without sacrificing accuracy.


3. Gradient Orthogonalization

Improves model generalization and enhances numerical stability by modifying gradients to be orthogonal to the parameters.


4. Variance Reduction

Theoretically accelerates the convergence speed of Lion by 33.33% while making training more stable in noisy, small-batch environments. The main trade-off is the requirement of an additional state to store gradients from the previous step.


5. Cautious Lion Variant

Includes the "Cautious" variant of Lion, an approach introduced to refine the optimization process and improve training outcomes.


6. Per-Parameter Gradient Norm Clipping

Enhances training stability by applying gradient norm clipping on a per-parameter basis, preventing erratic updates from large gradients.

Downloads & popularity

Awaiting observations

No metric observations yet

Download counts and popularity will appear here as the collector receives them.

Versions 1

Collected releases
VersionPublishedDirect dependenciesOpen version
0.1.11 Sept 20251

Package advisories

0
No matching advisories collected

This describes our collected data; it is not a security assessment.

Repository

PENDING
koratahiu/adv_lion

Shared repository data · GitHub

License detected in repository
Not collected

Metadata history

Meaningful changes
Current collected state Current

Observed since 20 Oct, 20:04 UTC

No superseded metadata states collected. Unchanged observations do not create new revisions.

Record identity

package:0dc411a0570566a95b723f0dc1cb851be095e87eea283a70291b093d749d5f2c