-
Notifications
You must be signed in to change notification settings - Fork 28k
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
Just import torch AdamW instead #36177
base: main
Are you sure you want to change the base?
Conversation
4da47cc
to
6338b0c
Compare
The docs for this PR live here. All of your documentation changes will be reflected on that endpoint. The docs are available until 30 days after the last update. |
Ready for core maintainer review @ArthurZucker @Cyrilvallez |
@@ -604,119 +604,14 @@ def scheduler_hook(param): | |||
) | |||
|
|||
|
|||
class AdamW(Optimizer): | |||
class AdamW(TorchAdamW): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
as long as you are sure all paramrs are the same for init, let'sgo! 🤗
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we can also deprecate this one?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good point, actually - the old one was already deprecated! Maybe we should just remove it entirely, since we've been showing a deprecation warning for a long time now?
Transformers added an
AdamW
implementation before Torch supported it. However, Torch supports it now so there's not really much point in maintaining our own version!This PR deletes our
AdamW
class, but importstorch.optim.AdamW
in the same file, to ensure that imports that depended on it still work.Fixes #35504