Catalog PyPI
PACKAGE EXPLORERView in registry

adamw-bf16

PyPI

AdamW Optimizer for bfloat16

Versions collected1
Direct dependencies1From release 0.0.3
Last observed20 Oct, 19:03 UTC

README

Version 0.0.3 documentation

AdamW optimizer for bfloat16 in PyTorch

This is a version of the AdamW optimizer for use in torch that achieves the same results in ViT training tests as training with the weights in float32 with operations in float32 or bfloat16 (autocast). By keeping your weights in bfloat16, you can save approximately half the weights they would normally take up in memory. It uses stochastic rounding and a correction term to achieve this.

There is a small (~10-20%) performance hit depending on your hardware.

To install:

pip install adamw-bf16

To use:

from adamw_bf16 import AdamWBF16

model = model.to(dtype=torch.bfloat16)
optimizer = AdamWBF16(model.parameters(), ...)

# Train your model

This repository was created using code from the following two projects. It was found that insights from both could be combined to match the performance with the model weights stored in float32.

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.0.34 Apr 20241

Package advisories

0
No matching advisories collected

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

Repository

PENDING
americanpresidentjimmycarter/adamw-bf16

Shared repository data · GitHub

License detected in repository
Not collected

Metadata history

Meaningful changes
Current collected state Current

Observed since 20 Oct, 19:03 UTC

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

Record identity

package:d8f6acec3691a0fe9fb3b8a7abb30c6135ee8989f0e4ce0f61c3eb5c247add6e