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

Prune deprecated utils modules #7503

Merged
merged 14 commits into from
May 13, 2021
Merged

Prune deprecated utils modules #7503

merged 14 commits into from
May 13, 2021

Conversation

Borda
Copy link
Member

@Borda Borda commented May 12, 2021

What does this PR do?

remove deprecated modules, they were renames in past

Before submitting

  • Was this discussed/approved via a GitHub issue? (not for typos and docs)
  • Did you read the contributor guideline, Pull Request section?
  • Did you make sure your PR does only one thing, instead of bundling different changes together?
  • Did you make sure to update the documentation with your changes? (if necessary)
  • Did you write any new necessary tests? (not for typos and docs)
  • Did you verify new and existing tests pass locally with your changes?
  • Did you update the CHANGELOG? (not for typos, docs, test updates, or internal minor changes/refactorings)

PR review

Anyone in the community is free to review the PR once the tests have passed.
Before you start reviewing make sure you have read Review guidelines. In short, see the following bullet-list:

  • Is this pull request ready for review? (if not, please submit in draft mode)
  • Check that all items from Before submitting are resolved
  • Make sure the title is self-explanatory and the description concisely explains the PR
  • Add labels and milestones (and optionally projects) to the PR so it can be classified

Did you have fun?

Make sure you had fun coding 🙃

@Borda Borda added the refactor label May 12, 2021
@Borda Borda added this to the v1.4 milestone May 12, 2021
@codecov
Copy link

codecov bot commented May 12, 2021

Codecov Report

Merging #7503 (4869eb9) into master (d4ec751) will decrease coverage by 4%.
The diff coverage is n/a.

@@           Coverage Diff           @@
##           master   #7503    +/-   ##
=======================================
- Coverage      92%     88%    -4%     
=======================================
  Files         198     196     -2     
  Lines       12843   12834     -9     
=======================================
- Hits        11839   11270   -569     
- Misses       1004    1564   +560     

@Borda Borda marked this pull request as ready for review May 12, 2021 12:44
@Borda Borda enabled auto-merge (squash) May 12, 2021 14:52
@Borda Borda added the ready PRs ready to be merged label May 12, 2021
@carmocca
Copy link
Contributor

carmocca commented May 12, 2021

I think we should address this in this PR cc: @awaelchli

#7402 (comment)

Comment on lines -5 to 7
from pytorch_lightning.utilities.argparse import * # noqa: F403 E402 F401

# for backward compatibility with old checkpoints (versions < 1.2.0)
# that need to be able to unpickle the function from the checkpoint
from pytorch_lightning.utilities.argparse import _gpus_arg_default # noqa: E402 F401 # isort: skip
Copy link
Contributor

Choose a reason for hiding this comment

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

@carmocca In theory this should be fine because we still have the import below here for BC.
Unless we remove the file argparse_utils.py we don't need to worry (yet)

Copy link
Contributor

Choose a reason for hiding this comment

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

The problem here is that the deprecation tests have been removed but not the deprecation message

And if we do, this will be forgotten for eternity haha

Is that okay?

Copy link
Member Author

Choose a reason for hiding this comment

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

I think that the best way would be to add a test for legacy checkpoint which covers this use-case
at this moment we have really very simple legacy model to test with...
so I would merge this as it is and raise a priority issue to update legacy checkpoint tests 🐰

Copy link
Contributor

@awaelchli awaelchli May 12, 2021

Choose a reason for hiding this comment

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

And if we do, this will be forgotten for eternity haha

Is that okay?

No, I will never forget the pain it has caused me. 🤣

If you want, I can generate one of these checkpoints and we make a tests that loads it? If someone removes the line, we make sure the test breaks?

Copy link
Contributor

Choose a reason for hiding this comment

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

Nah, no need for that. If spending time on it, it should be on how to figure out the monkey patching

Copy link
Member Author

Choose a reason for hiding this comment

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

yes, can you prepare a model which would cover those issue
https://github.com/PyTorchLightning/pytorch-lightning/blob/master/legacy/zero_training.py
then we can regenerate all legacy checkpoints

Copy link
Contributor

@awaelchli awaelchli May 12, 2021

Choose a reason for hiding this comment

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

all we need to do is add self.save_hyperparameters() to the zero_training model and generate the default hparams form Trainer.parse_argparse_args. The problem is that save_hyperparameters() doesn't exist that long and changed over time so I fear we won't be able to get this working for too old versions of Lightning. So we may need multiple versions of scripts as the Lightning feature set evolves over time

Copy link
Member Author

Choose a reason for hiding this comment

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

we can regenerate just some "recent" checkpoints...
cc: @kaushikb11

@mergify mergify bot removed the has conflicts label May 12, 2021
@Borda Borda requested a review from carmocca May 12, 2021 19:33
@mergify mergify bot removed the has conflicts label May 12, 2021
@Borda Borda merged commit 298f9e5 into master May 13, 2021
@Borda Borda deleted the prune/imports branch May 13, 2021 07:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ready PRs ready to be merged refactor
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants