Skip to main content

SOLO

Project description

Paper | PyTorch >= 2.2 | torchao >= 0.7.0

Installation

pip install solo

Usage

from solo.adamw import AdamWQ

optimizer = AdamWQ(
    model.parameters(),
    lr = 0.001,
    weight_decay = 0.,
    betas = (0.8, 0.999),
    bits = (4, 2),
    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: The low-bit Adafactor and AdaBelief optimiers are based on this code.

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.0.tar.gz (16.1 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.0-py3-none-any.whl (56.6 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: solow-0.1.0.tar.gz
  • Upload date:
  • Size: 16.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.9.19

File hashes

Hashes for solow-0.1.0.tar.gz
Algorithm Hash digest
SHA256 f934768911f09fa1332d201d98ae86be17d23fe495a5ae7ca3a4b3eaba73ab86
MD5 11cc209219441ff5653331e72ed2ed0c
BLAKE2b-256 9c0be4db45a9fd9f2383784183b0966ad101dbbdff1b75063b16eeb66e75a4b2

See more details on using hashes here.

File details

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

File metadata

  • Download URL: solow-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 56.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.9.19

File hashes

Hashes for solow-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 8f2e17188c633b408c2632ebe9e14f5cccfd54826a1032a5383ed42af110a636
MD5 bae5e921d3f48ad53b54775aa51540fd
BLAKE2b-256 fd72099319f68734e1d2d5f03e66b06a469344c3b7c553d2f816565e6dcac475

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