Skip to content

Conversation

@janeyx99
Copy link
Contributor

@janeyx99 janeyx99 commented Nov 4, 2022

Fixes #61232

@pytorch-bot
Copy link

pytorch-bot bot commented Nov 4, 2022

🔗 Helpful Links

🧪 See artifacts and rendered test results at hud.pytorch.org/pr/88503

Note: Links to docs will display an error until the docs builds have been completed.

✅ No Failures

As of commit 1ea11ec:
💚 Looks good so far! There are no failures yet. 💚

This comment was automatically generated by Dr. CI and updates every 15 minutes.

@janeyx99 janeyx99 added the release notes: nn release notes category label Nov 4, 2022
@janeyx99 janeyx99 marked this pull request as ready for review November 4, 2022 19:05
@janeyx99 janeyx99 requested a review from albanD as a code owner November 4, 2022 19:05
Copy link
Contributor

@soulitzer soulitzer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cool!

@pytorch-bot
Copy link

pytorch-bot bot commented Nov 4, 2022

This PR has been accepted with the accept2ship label. Attempting to merge now.

@pytorchbot merge -l

@pytorch-bot pytorch-bot bot added ciflow/trunk Trigger trunk jobs on your pull request and removed accept2ship labels Nov 4, 2022
@pytorchmergebot
Copy link
Collaborator

Merge started

The -l land checks flag is deprecated and no longer needed. Instead we now automatically add the ciflow\trunk label to your PR once it's approved

Your change will be merged once all checks on your PR pass (ETA 0-4 Hours).

Learn more about merging in the wiki.

Questions? Feedback? Please reach out to the PyTorch DevX Team

Advanced Debugging
Check the merge workflow status
here

@vadimkantorov
Copy link
Contributor

vadimkantorov commented Nov 4, 2022

Related: #23957, #68332, one avenue is a redesign of LRScheduler and introduction of general scheduler interface and functional forms...

@pytorchmergebot
Copy link
Collaborator

Merge failed

Reason: 1 additional jobs have failed, first few of them are: trunk

Details for Dev Infra team Raised by workflow job

@janeyx99
Copy link
Contributor Author

janeyx99 commented Nov 7, 2022

@pytorchbot merge

@pytorchmergebot
Copy link
Collaborator

Merge started

Your change will be merged once all checks pass (ETA 0-4 Hours).

Learn more about merging in the wiki.

Questions? Feedback? Please reach out to the PyTorch DevX Team

Advanced Debugging
Check the merge workflow status
here

@janeyx99
Copy link
Contributor Author

janeyx99 commented Nov 8, 2022

@vadimkantorov Thanks for bringing to attention the relevant LRScheduler issues, unfortunately, we don't have anyone focused + working on them today.

ananthsub added a commit to ananthsub/tnt that referenced this pull request Nov 10, 2022
Summary:
After pytorch/pytorch#88503 , these isinstance checks no longer pass. Example: https://github.com/pytorch/tnt/actions/runs/3434539858/jobs/5725945075

TODO: support older torch versions that don't have `LRScheduler` and need `_LRScheduler`

Differential Revision: D41177335

fbshipit-source-id: 0fc2009fc5fd7289e95a37d7b417476d7c4f2b61
pytorchmergebot pushed a commit that referenced this pull request Nov 11, 2022
Following #88503, we should also update the pyi file

Pull Request resolved: #88818
Approved by: https://github.com/soulitzer
ananthsub added a commit to ananthsub/tnt that referenced this pull request Nov 15, 2022
Summary:
Pull Request resolved: meta-pytorch#271

After pytorch/pytorch#88503 , these isinstance checks no longer pass. Example: https://github.com/pytorch/tnt/actions/runs/3434539858/jobs/5725945075

Reviewed By: janeyx99

Differential Revision: D41177335

fbshipit-source-id: 243b2fb4cdb06561588b56a9a9f08a7144c6ae9b
ananthsub added a commit to ananthsub/tnt that referenced this pull request Nov 15, 2022
Summary:
Pull Request resolved: meta-pytorch#271

After pytorch/pytorch#88503 , these isinstance checks no longer pass. Example: https://github.com/pytorch/tnt/actions/runs/3434539858/jobs/5725945075

Reviewed By: janeyx99

Differential Revision: D41177335

fbshipit-source-id: c09398e06bebc2e9362f369143d4d8dd7c21e6e6
facebook-github-bot pushed a commit to meta-pytorch/tnt that referenced this pull request Nov 15, 2022
Summary:
Pull Request resolved: #271

After pytorch/pytorch#88503 , these isinstance checks no longer pass. Example: https://github.com/pytorch/tnt/actions/runs/3434539858/jobs/5725945075

Reviewed By: daniellepintz, janeyx99

Differential Revision: D41177335

fbshipit-source-id: a06cf2f1c34eb0e697df716d8ac6e393359e0c4c
kulinseth pushed a commit to kulinseth/pytorch that referenced this pull request Dec 10, 2022
kulinseth pushed a commit to kulinseth/pytorch that referenced this pull request Dec 10, 2022
Following pytorch#88503, we should also update the pyi file

Pull Request resolved: pytorch#88818
Approved by: https://github.com/soulitzer
wat3rBro pushed a commit to wat3rBro/detectron2-1 that referenced this pull request Dec 16, 2022
Summary:
pytorch/pytorch#88503 introduces the public version `LRScheduler`, however `isinstance(self.scheduler, torch.optim.lr_scheduler._LRScheduler)` doesn't work anymore because of https://github.com/pytorch/pytorch/blob/1ea11ecb2eea99eb552603b7cf5fbfc59659832d/torch/optim/lr_scheduler.py#L166-L169.

It's a bit tricky to make it BC compatible for torch version <= 1.13. V1 of this diff uses try catch block to import the `LRScheduler` and make it available in `detectron2.solver`, then the whole D2 (facebookresearch@11528ce) uses this version of `LRScheduler`. There're two drawbacks though:
- it adds a little mental burden to figure out what's D2 (facebookresearch@11528ce083dc9ff83ee3a8f9086a1ef54d2a402f)'s `LRScheduler`, previously it's clear that the `LRScheduler`/`_LRScheduler` is from `torch`.
- it has a name collision with `hooks.LRScheduler`, eg. in the `hooks.py` I have to do `LRScheduler as _LRScheduler`.

But I couldn't found a better solution, maybe use try catch block in every file?

Differential Revision: D42111273

fbshipit-source-id: 613cd35a1e0bdb9b8edd852042df047aba021d87
facebook-github-bot pushed a commit to facebookresearch/detectron2 that referenced this pull request Dec 21, 2022
Summary:
Pull Request resolved: #4709

pytorch/pytorch#88503 introduces the public version `LRScheduler`, however `isinstance(self.scheduler, torch.optim.lr_scheduler._LRScheduler)` doesn't work anymore because of https://github.com/pytorch/pytorch/blob/1ea11ecb2eea99eb552603b7cf5fbfc59659832d/torch/optim/lr_scheduler.py#L166-L169.

It's a bit tricky to make it BC compatible for torch version <= 1.13. V1 of this diff uses try catch block to import the `LRScheduler` and make it available in `detectron2.solver`, then the whole D2 (11528ce) uses this version of `LRScheduler`. There're two drawbacks though:
- it adds a little mental burden to figure out what's D2 (11528ce083dc9ff83ee3a8f9086a1ef54d2a402f)'s `LRScheduler`, previously it's clear that the `LRScheduler`/`_LRScheduler` is from `torch`.
- it has a name collision with `hooks.LRScheduler`, eg. in the `hooks.py` I have to do `LRScheduler as _LRScheduler`.

But I couldn't found a better solution, maybe use try catch block in every file?

Reviewed By: sstsai-adl

Differential Revision: D42111273

fbshipit-source-id: 0269127de1ba3ef90225c5dfe085bb209f6cf4d1
facebook-github-bot pushed a commit to meta-pytorch/tnt that referenced this pull request Jan 3, 2023
Summary:
Introduce `torchtnt.utils.lr_scheduler.TLRScheduler` to manage compatibility of torch with expose of `LRScheduler` pytorch/pytorch#88503

It seems that issue persist still with `1.13.1` (see #285). Replace the get_version logic with try/except. `_LRscheduler`.

Fixes #285 `https://github.com/pytorch/tnt/issues/285`

Pull Request resolved: #286

Reviewed By: hudeven

Differential Revision: D42220767

Pulled By: ananthsub

fbshipit-source-id: 3b434ba4e0c8efa1a81ab5a88ae58765bb23020e
@github-actions github-actions bot deleted the lrscheduler_public branch May 6, 2024 01:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ciflow/trunk Trigger trunk jobs on your pull request Merged release notes: nn release notes category topic: improvements topic category

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[FR] rename LR scheduler base class _LRScheduler to be non-private

5 participants