Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Feature] Improve overall performance of the optimizers #51

Merged
merged 34 commits into from
Feb 19, 2022

Conversation

kozistr
Copy link
Owner

@kozistr kozistr commented Feb 19, 2022

Problem (Why?)

There're some inefficiencies

Solution (What/How?)

  • remove .data
  • torch.no_grad() to all step() function
  • support bfloat16 dtype (XLA compatibility)

Other changes (bug fixes, small refactors)

version up to 0.4.0

Notes

nope

@kozistr kozistr added enhancement New feature or request cleanup Cleanup codes labels Feb 19, 2022
@kozistr kozistr self-assigned this Feb 19, 2022
@kozistr kozistr added the feature New features label Feb 19, 2022
@codecov-commenter
Copy link

codecov-commenter commented Feb 19, 2022

Codecov Report

Merging #51 (658d3a9) into main (3cd5158) will increase coverage by 0.74%.
The diff coverage is 87.93%.

Impacted file tree graph

@@            Coverage Diff             @@
##             main      #51      +/-   ##
==========================================
+ Coverage   87.16%   87.91%   +0.74%     
==========================================
  Files          26       26              
  Lines        1792     1812      +20     
==========================================
+ Hits         1562     1593      +31     
+ Misses        230      219      -11     
Impacted Files Coverage Δ
pytorch_optimizer/version.py 0.00% <0.00%> (ø)
pytorch_optimizer/adahessian.py 62.36% <10.00%> (-0.28%) ⬇️
pytorch_optimizer/lookahead.py 87.32% <77.77%> (+0.55%) ⬆️
pytorch_optimizer/adabelief.py 86.55% <78.57%> (+3.62%) ⬆️
pytorch_optimizer/radam.py 91.01% <82.14%> (ø)
pytorch_optimizer/madgrad.py 96.38% <85.71%> (+1.32%) ⬆️
pytorch_optimizer/diffrgrad.py 94.62% <88.88%> (-1.08%) ⬇️
pytorch_optimizer/adabound.py 91.25% <89.47%> (+1.25%) ⬆️
pytorch_optimizer/ralamb.py 87.61% <90.32%> (-0.58%) ⬇️
pytorch_optimizer/ranger.py 95.91% <93.54%> (-1.86%) ⬇️
... and 9 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 3cd5158...658d3a9. Read the comment docs.

@kozistr kozistr merged commit 8439f15 into main Feb 19, 2022
@kozistr kozistr deleted the feature/improve-perf branch February 19, 2022 08:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cleanup Cleanup codes enhancement New feature or request feature New features
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants