Skip to content

Conversation

@carmocca
Copy link
Contributor

@carmocca carmocca commented May 25, 2021

What does this PR do?

See title. Same idea as:

https://github.com/PyTorchLightning/pytorch-lightning/blob/3e5d6e906a0165c59fc898e4c3da44a39771dbd0/pytorch_lightning/callbacks/early_stopping.py#L63-L64

Also, use regexes so we are not testing the seeding.

Last piece before #7357

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

  • 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

@carmocca carmocca added feature Is an improvement or enhancement callback labels May 25, 2021
@carmocca carmocca added this to the v1.4 milestone May 25, 2021
@carmocca carmocca self-assigned this May 25, 2021
assert hasattr(pl_module.layer.mlp_3, "weight_orig")
if not on_train_epoch_end:
# these checks only work if pruning on `validation_epoch_end`
# because `on_save_checkpoint` is called before `on_train_epoch_end`
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is not true in current master, but will be after #7357

@codecov
Copy link

codecov bot commented May 25, 2021

Codecov Report

Merging #7704 (b0c630f) into master (3e5d6e9) will decrease coverage by 5%.
The diff coverage is 100%.

@@           Coverage Diff           @@
##           master   #7704    +/-   ##
=======================================
- Coverage      93%     88%    -5%     
=======================================
  Files         199     199            
  Lines       12960   12968     +8     
=======================================
- Hits        11990   11379   -611     
- Misses        970    1589   +619     

Copy link
Contributor

@tchaton tchaton left a comment

Choose a reason for hiding this comment

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

LGTM !

Co-authored-by: Adrian Wälchli <[email protected]>

def on_train_end(self, trainer: 'pl.Trainer', pl_module: LightningModule) -> None:
if self._make_pruning_permanent:
rank_zero_debug("`ModelPruning.on_train_end`. Pruning is made permanent for this checkpoint.")
Copy link
Contributor

@awaelchli awaelchli May 25, 2021

Choose a reason for hiding this comment

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

btw now you have a string here that has a period where there is no sentence and also a sentence but with a missing period. xD

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I guess I should've used : to separate haha

Not going to change it, not worth re-running CI just for it

@carmocca carmocca merged commit d26953c into master May 25, 2021
@carmocca carmocca deleted the feature/pruning-flag branch May 25, 2021 22:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

callback feature Is an improvement or enhancement

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants