feat: add PolynomialLR scheduler#82769
feat: add PolynomialLR scheduler#82769federicopozzi33 wants to merge 6 commits intopytorch:masterfrom
Conversation
🔗 Helpful links
✅ No Failures (0 Pending)As of commit 20f6c84 (more details on the Dr. CI page): Expand to see more💚 💚 Looks good so far! There are no failures yet. 💚 💚 This comment was automatically generated by Dr. CI (expand for details).Please report bugs/suggestions to the (internal) Dr. CI Users group. |
|
First draft. Documentation should be quite ok, but building documentation phase is missing. Tests can be improved (combined versions are missing, e.g. I tried to generate the stubgen torch/optim/lr_scheduler.pyGenerated file: class PolynomialLR(_LRScheduler):
total_iters: Incomplete
min_lrs: Incomplete
power: Incomplete
def __init__(self, optimizer, total_iters: int = ..., min_lr: float = ..., power: float = ..., last_epoch: int = ..., verbose: bool = ...) -> None: ...
def get_lr(self): ...
class LinearLR(_LRScheduler):
start_factor: Incomplete
end_factor: Incomplete
total_iters: Incomplete
def __init__(self, optimizer, start_factor=..., end_factor: float = ..., total_iters: int = ..., last_epoch: int = ..., verbose: bool = ...) -> None: ...
def get_lr(self): ...Existing class LinearLR(_LRScheduler):
start_factor: float = ...
end_factor: float = ...
total_iters: int = ...
def __init__(self, optimizer: Optimizer, start_factor: float=..., end_factor: float= ..., total_iters: int= ..., last_epoch: int= ..., verbose: bool = ...) -> None: ...Note2: I confused |
There was a problem hiding this comment.
@federicopozzi33 Thanks a lot for the PR. As discussed at pytorch/vision#4438 this is definitely something that TorchVision can use.
I've added a few comments but overall it looks good. Please let me know what you think.
Documentation should be quite ok, but building documentation phase is missing
I had to manually approve running your tests because that was your first PR. It's running the jobs now.
I confused torchvision issue with torch one, so the issue number in the branch name is wrong. Should I delete the branch?
I don't think PyTorch core has such a strict process for the naming conventions on your repo/branch. If renaming is needed we can do after the reviews.
I tried to generate the .pyi for optimizer.py but the result I obtained is quite different from the existing version.
I'm not sure about this one, let's leave it last to fix. Once the PR is ready, I'll ping some Core devs who could clarify these for us. :)
5d44650 to
a769f92
Compare
datumbox
left a comment
There was a problem hiding this comment.
I think overall it looks good. I've added only one minor nit comment below.
The question around the generation of optimizer.pyi remains, but we can ask core devs how to handle it. I've restarted the unit-tests so that we can get a signal from the CI. If all tests pass, from my perspective, we should mark the PR as non draft and ask for the review of Alban/Joel.
Some tests are still failing, but it seems that they are not related to my changes... can you check you too, please? |
|
@federicopozzi33 LGTM! The failing tests are unrelated. I think now we should be good to ask for the feedback of @albanD and @jbschlosser. Please let us know your thoughts and your recommendation for the generation of |
|
The |
datumbox
left a comment
There was a problem hiding this comment.
LGTM, thanks @federicopozzi33.
I'll leave it to @albanD and @jbschlosser to approve and merge. Note that I spoke with them and they told me it's quite hectic for them this week, so we might need to be a bit patient. Don't worry I'll follow up with them regularly to get this over the line.
|
@pytorchbot rebase |
|
@pytorchbot successfully started a rebase job. Check the current status here |
|
Successfully rebased |
5fe337e to
20f6c84
Compare
|
@pytorchbot merge -g |
|
@pytorchbot successfully started a merge job. Check the current status here |
|
Hey @federicopozzi33. |
Summary: ### Description <!-- What did you change and why was it needed? --> Add PolynomialLR scheduler. ### Issue Closes #79511. ### Testing I added tests for PolynomialLR. Pull Request resolved: #82769 Approved by: https://github.com/datumbox Test Plan: contbuild & OSS CI, see https://hud.pytorch.org/commit/pytorch/pytorch/f8a10a7f79b574422dc5477e86284c7539790bde Reviewed By: seemethere Differential Revision: D38600088 Pulled By: seemethere fbshipit-source-id: 6f93f47efda4072284c3049f21df0f70690100fe
Description
Add PolynomialLR scheduler.
Issue
Closes #79511.
Testing
I added tests for PolynomialLR.