Skip to main content

SOLO

Project description

Logo

Paper | PyTorch >= 2.3 | torchao >= 0.7.0

Installation

pip install solow

or

pip install git+https://github.com/MTandHJ/SOLO.git

Usage

from solo.adamw import AdamWQ

optimizer = AdamWQ(
    model.parameters(),
    lr = 0.001,
    weight_decay = 0.,
    betas = (0.8, 0.999),
    bits = (4, 2), # (4 bits for signed, 2 bits for unsigned)
    quantile = 0.1,
    block_sizes = (128, 128),
    quantizers = ('de', 'qema'),
    # A tensor whose size is less than `min_quantizable_tensor_size`
    # will be excluded from quantization.
    # For rigorous probing, this value is set to 0 in paper.
    # Assigning a larger value (such as the default of 4096 in torchao) 
    # may yield more stable results.
    min_quantizable_tensor_size = 0
)
  • quantizers:
    • none: The orginal 32-bit state.
    • bf16: The BF16 format.
    • de: The dynamic exponent mapping without a stochastic rounding.
    • de-sr: The dynamic exponent mapping with a stochastic rounding.
    • linear: The linear mapping without a stochastic rounding.
    • linear-sr: The linear mapping with a stochastic rounding.
    • qema: The proposed logarithmic quantization.

Reference Code

  • pytorch-optimizer: We implemented the low-bit Adafactor and AdaBelief optimiers based on this code.

Citation

@article{xu2025solo,
  title={Pushing the Limits of Low-Bit Optimizers: A Focus on EMA Dynamics},
  author={Xu, Cong and Liang, Wenbin and Yu, Mo and Liu, Anan and Zhang, Ke-Yue and Ma, Lizhuang and Wang, Jianyong and Wang, Jun and Zhang, Wei},
  journal={arXiv preprint arXiv:2505.00347},
  year={2025}
}

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

solow-0.1.2.tar.gz (16.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

solow-0.1.2-py3-none-any.whl (57.3 kB view details)

Uploaded Python 3

File details

Details for the file solow-0.1.2.tar.gz.

File metadata

  • Download URL: solow-0.1.2.tar.gz
  • Upload date:
  • Size: 16.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.9.21

File hashes

Hashes for solow-0.1.2.tar.gz
Algorithm Hash digest
SHA256 1b4966d9e42d0412e3d81df3d720bb2c545e33889264aabac3a610cd25467a24
MD5 cbd672b1355d493541f7bd9ec4f01be7
BLAKE2b-256 30c02e73c47cc311a451793b000cea281b3c6114407284c0b062c465ee8ddb0b

See more details on using hashes here.

File details

Details for the file solow-0.1.2-py3-none-any.whl.

File metadata

  • Download URL: solow-0.1.2-py3-none-any.whl
  • Upload date:
  • Size: 57.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.9.21

File hashes

Hashes for solow-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 1bede6a51507e1fa8f0c1ad333c0e49041482735324edf3cbfcb901b7da69bbd
MD5 1a76119531ad191c451b6ba321b91e8e
BLAKE2b-256 9439e6e87bfe7d28561753868dd68b27a7b7cd66b95d2b94dff0179965120c3d

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page