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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pytorch SequentialLR cannot be used #10278

Closed
blefaudeux opened this issue Oct 31, 2021 · 2 comments
Closed

Pytorch SequentialLR cannot be used #10278

blefaudeux opened this issue Oct 31, 2021 · 2 comments
Assignees
Labels
3rd party Related to a 3rd-party

Comments

@blefaudeux
Copy link

blefaudeux commented Oct 31, 2021

馃悰 Bug

Using Pytorch's SequentialLR with Lightning leads to AttributeError: 'SequentialLR' object has no attribute 'optimizer' in _validate_scheduler_optimizer (pytorch_lightning/trainer/optimizers.py), which makes sense since SequentialLR does not have a self.optimizer attribute indeed (though on the user side this should not be visible and things should work)

cc @SeanNaren @tchaton, this would be a nice way to repro MinGPTs schedule (warmup then exp down)

To Reproduce

Instantiate torch.optim.lr_scheduler.SequentialLRas your scheduler in Lightning

Expected behavior

Works flawlessly

Environment

Pytorch 1.10

@blefaudeux blefaudeux added bug Something isn't working help wanted Open to be worked on labels Oct 31, 2021
@rohitgr7
Copy link
Contributor

rohitgr7 commented Oct 31, 2021

hey @blefaudeux thanks for raising this. seems like we need to support SequentialLR and ChainedScheduler explictly :)

@rohitgr7 rohitgr7 self-assigned this Oct 31, 2021
@rohitgr7
Copy link
Contributor

rohitgr7 commented Oct 31, 2021

ok seems like it's fixed on PyTorch master for SequentialLR here: pytorch/pytorch#67406
for ChainedScheduler added an issue here: pytorch/pytorch#67601

closing this. feel free to reopen if required :)

@rohitgr7 rohitgr7 added 3rd party Related to a 3rd-party and removed bug Something isn't working help wanted Open to be worked on labels Oct 31, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
3rd party Related to a 3rd-party
Projects
None yet
Development

No branches or pull requests

2 participants