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.0
0.6.0
0.5.1
0.5.0
0.4.0
0.3.1
0.3.0
0.25.1
0.25.0
0.24.4
0.24.3
0.24.2
0.24.1
0.24.0
0.23.4
0.23.3
0.23.1
0.23.0
0.22.0
0.21.8
0.21.7
0.21.6
0.21.5
0.21.4
0.21.3
0.21.2
0.21.1
0.21.0
0.20.1
0.2.1
0.2.0
0.19.0
0.18.8
0.18.7
0.18.6
0.18.5
0.18.4
0.18.3
0.18.2
0.18.1
0.18.0
0.17.3
0.17.2
0.17.1
0.17.0
0.16.0
0.15.1
0.15.0
0.14.7
0.14.6
0.14.5
0.14.4
0.14.3
0.14.2
0.14.1
0.14.0
0.13.1
0.13.0
0.12.7
0.12.6
0.12.5
0.12.4
0.12.3
0.12.2
0.12.1
0.12.0
0.11.2
0.11.1
0.11.0
0.10.2
0.10.1
0.10.0
0.1.2
0.1.1
0.1.0
0.0.5
0.0.4
0.0.3
0.0.2
0.0.1
توضیحات
Efficient Optimizers
| ویژگی | مقدار |
|---|---|
| سیستم عامل | OS Independent |
| نام فایل | heavyball-2.2.3 |
| نام | heavyball |
| نسخه کتابخانه | 2.2.3 |
| نگهدارنده | [] |
| ایمیل نگهدارنده | [] |
| نویسنده | - |
| ایمیل نویسنده | HeavyBall Authors <github.heavyball@nestler.sh> |
| آدرس صفحه اصلی | - |
| آدرس اینترنتی | https://pypi.org/project/heavyball/ |
| مجوز | - |
# heavyball
[][pypi]
[][license]
_High-performance, extensible, chainable optimizers for PyTorch._
## Why heavyball
- **Lightning-Fast Training**: Batched `foreach` operations deliver significant speedups on large models.
- **Adaptive & Extensible**: Built-in AdamW, RMSprop, Schedule-Free algorithms, and PaLM-inspired schedules.
- **Plug-and-Play**: Drop-in replacements for `torch.optim` with seamless integration.
- **Customizable**: Chainable API lets you compose optimizers and transforms (MARS correction, cautious updates, orthogonal updates).
- **Battle-Tested**: Extensive benchmarks and real-world examples included.
## Key Features
- Foreach-based optimizers: `ForeachAdamW`, `ForeachRMSprop`, `ForeachSFAdamW`, `Muon`, `ADOPT`, `MSAM` (Momentum SAM), …
- Schedule-Free optimizers with dynamic learning rate adaptation.
- Advanced update rules: MARS correction, cautious updates, PaLM beta2 scheduling.
- Chainable transforms for custom optimization recipes.
- Comprehensive benchmark suite packaged separately as LightBench (`../LightBench`).
- Detailed documentation and example-driven tutorials.
## Quickstart
**Install:**
```bash
pip install heavyball
```
**Basic usage:**
```python
import torch
from torch import nn
from heavyball import ForeachAdamW
model = nn.Sequential(
nn.Linear(128, 64), nn.ReLU(), nn.Linear(64, 10)
)
optimizer = ForeachAdamW(model.parameters(), lr=1e-3)
for data, target in dataloader:
optimizer.zero_grad()
output = model(data)
loss = torch.nn.functional.cross_entropy(output, target)
loss.backward()
optimizer.step()
```
## Benchmarks
> Reproduce benchmarks with LightBench (install it via `pip install -e ../LightBench` from the repo root):
> ```bash
> python3 -m lightbench.run_all_benchmarks --opt ForeachSOAP --opt LaProp --opt AdamW --opt Muon --opt ForeachCachedNewtonPSGD --opt RMSprop --opt OrthoLaProp --opt ForeachSFAdamW --opt ForeachADOPT --opt LaPropOrtho --opt CachedPSGDKron --opt SignLaProp --opt ForeachSOLP --opt PSGDLRA --opt NewtonPSGDLRA --opt NewtonHybrid2PSGDKron --opt NewtonHybrid2PSGDLRA --opt mars-NewtonHybrid2PSGDLRA --opt MSAMLaProp --opt mars-adaptive-NewtonHybrid2PSGDKron --opt mars-ortho-NewtonHybrid2PSGDKron --opt MuonLaProp --opt mars-unscaled-NewtonHybrid2PSGDKron --opt mars-NewtonHybrid2PSGDKron --opt cautious-AdamW --opt unscaled_cautious-AdamW --opt mars-AdamW --dtype float32 --steps 1000000 --trials 1000 --parallelism 256 --seeds 1 --difficulties trivial --difficulties easy --difficulties medium --difficulties hard --difficulties extreme --difficulties nightmare --timeout 2880
> ```
## Migrating from HeavyBall 1.x
- Read the detailed [2.0.0 migration notes](docs/heavyball2.md) for an end-to-end checklist, including guidance for restoring legacy behaviour when needed.
- Use `scripts/migrate_optimizer_state.py` to rewrite pre-2.0 optimizer checkpoints:
```bash
python scripts/migrate_optimizer_state.py path/to/checkpoint.pt heavyball.ForeachAdamW --state-key optimizer
```
The utility renames legacy state entries, fans them out per parameter view, and injects the HeavyBall metadata block expected by 2.0.0.
## Contributing
We welcome contributions! Please check the [issue tracker][tracker] and follow these steps:
1. Fork the repo and create a feature branch.
2. Install dev dependencies: `pip install -e .[dev]`.
3. Run tests: `pytest`.
4. Submit a pull request.
## License
BSD 3-Clause — see the [LICENSE](LICENSE) file.
---
<p align="center">
Made by the HeavyBall team.
</p>
[pypi]: https://pypi.org/project/heavyball/
[license]: LICENSE
[tracker]: https://github.com/HomebrewML/HeavyBall/issues
نیازمندی
| مقدار | نام |
|---|---|
| - | opt-einsum>=3.4.0 |
| - | torch<3.0,>=2.2 |
| - | numpy>=2.3.4 |
| xtr | pre-commit; |
| xtr | pytest; |
| xtr | hypothesis; |
| xtr | ruff; |
| xtr | matplotlib; |
| xtr | seaborn; |
| xtr | pandas; |
| xtr | typer; |
| xtr | optuna; |
| xtr | optunahub; |
| xtr | hebo; |
| xtr | lightbench; |
زبان مورد نیاز
| مقدار | نام |
|---|---|
| >=3.9 | Python |
نحوه نصب
نصب پکیج whl heavyball-2.2.3:
pip install heavyball-2.2.3.whl
نصب پکیج tar.gz heavyball-2.2.3:
pip install heavyball-2.2.3.tar.gz