Update TuneCallback for Pytorch-Lightning 1.6+ #27766
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Why are these changes needed?
Getting a ton of warnings from pytorch-lightning about deprecation of certain hooks. The TuneCallback has old hooks such as keyboard_interrupt which have been deprecated. I updated the callback to the new hooks and updated the integration tests.
The deprecated hooks and their new versions (In pl v1.6+) are:
on_keyboard_interrupt
->on_exception
on_init_start
-> just deprecated no new versionon_init_end
-> just deprecated no new versionon_batch_start
->on_train_batch_start
on_batch_end
->on_train_batch_end
on_epoch_end
->on_<train/validation/test>_epoch_end
on_epoch_start
->on_<train/validation/test>_epoch_start
Related issue number
Closes #27487
Checks
git commit -s
) in this PR.scripts/format.sh
to lint the changes in this PR.I spent a few hours trying to wrangle my environment. Unfortunately I'm on windows using WSL and have an old version of Debian for some reason which only supports gcc-6 (not even close to gcc-9 which is required for building the project so I can run the tests). Given this roadblock and the fact that the fixes were minimal and simple I decided to push out the changes.