Skip to content

Commit

Permalink
Merge pull request #221 from kozistr/feature/aida-optimizer
Browse files Browse the repository at this point in the history
[Feature] Implement Aida optimizer
  • Loading branch information
kozistr authored Mar 2, 2024
2 parents c583666 + f921dfb commit fd717fc
Show file tree
Hide file tree
Showing 14 changed files with 549 additions and 1,036 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,9 @@ jobs:
python-version: ['3.11']

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
cache: 'pip'
Expand All @@ -33,7 +33,7 @@ jobs:
PYTHONDONTWRITEBYTECODE: 1
run: make test
- name: Check codecov
uses: codecov/codecov-action@v3
uses: codecov/codecov-action@v4
with:
token: ${{ secrets.CODECOV_TOKEN }}
directory: ./
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
uses: actions/checkout@v4
- name: Get the version
id: get_version
run: echo ::set-output name=VERSION::${GITHUB_REF/refs\/tags\//}
Expand All @@ -31,9 +31,9 @@ jobs:
needs: release
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Setup Python 3.11
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version: 3.11
cache: 'pip'
Expand Down
9 changes: 6 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

**pytorch-optimizer** is optimizer & lr scheduler collections in PyTorch.
I just re-implemented (speed & memory tweaks, plug-ins) the algorithm while based on the original paper. Also, It includes useful and practical optimization ideas.
Currently, **61 optimizers (+ `bitsandbytes`)**, **10 lr schedulers**, and **13 loss functions** are supported!
Currently, **62 optimizers (+ `bitsandbytes`)**, **10 lr schedulers**, and **13 loss functions** are supported!

Highly inspired by [pytorch-optimizer](https://github.com/jettify/pytorch-optimizer).

Expand All @@ -27,9 +27,11 @@ So, please double-check the license before using it at your work.
$ pip3 install pytorch-optimizer
```

From `pytorch-optimizer v2.12.0`, you can install and import `bitsandbytes` optimizers.
From `v2.12.0`, you can install and import `bitsandbytes` optimizers.
please check [the requirements](https://github.com/TimDettmers/bitsandbytes?tab=readme-ov-file#tldr) before installing it.

From `v3.0.0`, drop `Python 3.7` support. However, you can still use this package with `Python 3.7` by installing with `--ignore-requires-python` option.

```bash
$ pip install "pytorch-optimizer[bitsandbytes]"
```
Expand Down Expand Up @@ -156,7 +158,8 @@ supported_optimizers = get_supported_optimizers()
| LOMO | *Full Parameter Fine-tuning for Large Language Models with Limited Resources* | [github](https://github.com/OpenLMLab/LOMO) | <https://arxiv.org/abs/2306.09782> | [cite](https://github.com/OpenLMLab/LOMO#citation) |
| Tiger | *A Tight-fisted Optimizer, an optimizer that is extremely budget-conscious* | [github](https://github.com/bojone/tiger) | | [cite](https://github.com/bojone/tiger/blob/main/README_en.md#citation) |
| CAME | *Confidence-guided Adaptive Memory Efficient Optimization* | [github](https://github.com/huawei-noah/Pretrained-Language-Model/tree/master/CAME) | <https://aclanthology.org/2023.acl-long.243/> | [cite](https://github.com/huawei-noah/Pretrained-Language-Model/tree/master/CAME#citation) |
| WSAM | *Sharpness-Aware Minimization Revisited: Weighted Sharpness as a Regularization Term* | [github](https://github.com/intelligent-machine-learning/dlrover/blob/master/atorch/atorch/optimizers/wsam.py) | <https://arxiv.org/abs/2305.15817> | [cite](https://github.com/intelligent-machine-learning/dlrover) |
| WSAM | *Sharpness-Aware Minimization Revisited: Weighted Sharpness as a Regularization Term* | [github](https://github.com/intelligent-machine-learning/dlrover/blob/master/atorch/atorch/optimizers/wsam.py) | <https://arxiv.org/abs/2305.15817> | [cite](https://github.com/intelligent-machine-learning/dlrover) |
| Aida | *A DNN Optimizer that Improves over AdaBelief by Suppression of the Adaptive Stepsize Range* | [github](https://github.com/guoqiang-zhang-x/Aida-Optimizer) | <https://arxiv.org/abs/2203.13273> | [cite](https://github.com/guoqiang-zhang-x/Aida-Optimizer?tab=readme-ov-file#1-brief-description-of-aida) |

## Supported LR Scheduler

Expand Down
28 changes: 28 additions & 0 deletions docs/changelogs/v3.0.0.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
## Change Log

Major version is updated! (`v2.12.0` -> `v3.0.0`) (#164)

### Feature

* Implement `Aida` optimizer. (#220, #221)
* [A DNN Optimizer that Improves over AdaBelief by Suppression of the Adaptive Stepsize Range](https://arxiv.org/abs/2203.13273)
* Implement `WSAM` optimizer. (#213, #216)
* [Sharpness-Aware Minimization Revisited: Weighted Sharpness as a Regularization Term](https://arxiv.org/abs/2305.15817)

## Dependency

* Drop `Python 3.7` support officially. (#221)
* Please check the [README](https://github.com/kozistr/pytorch_optimizer?tab=readme-ov-file#getting-started).

## Docs

* Add missing parameters in `Ranger21 optimizer` document. (#214, #215)
* Fix `WSAM` optimizer paper link. (#219)

### Contributions

thanks to @sdbds

### Diff

[2.12.0...3.0.0](https://github.com/kozistr/pytorch_optimizer/compare/v2.12.0...v3.0.0)
4 changes: 4 additions & 0 deletions docs/optimizer.md
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,10 @@
:docstring:
:members:

::: pytorch_optimizer.Aida
:docstring:
:members:

::: pytorch_optimizer.AliG
:docstring:
:members:
Expand Down
Loading

0 comments on commit fd717fc

Please sign in to comment.