Skip to content

Conversation

@niberger
Copy link
Contributor

@niberger niberger commented Mar 24, 2022

What does this PR do?

Make the KFoldLoop example class serializable via pickling.
It allow the use of this example with the ddp_spawn strategy.
Without this fix, the deserialization of KFoldLoop crash by entering an endless recursive call of __getattr__("fitloop").

No test written as this only improve an example.

Fixes #12439

Does your PR introduce any breaking changes? If yes, please list them.

None

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 list all the breaking changes introduced by this pull request?
  • Did you update the CHANGELOG? (not for typos, docs, test updates, or internal minor changes/refactorings)

PR review

Anyone in the community is welcome to review the PR.
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 🙃

@niberger niberger changed the title Allow pickling of KFoldLoop Fix pickling of KFoldLoop Mar 24, 2022
@akihironitta akihironitta added the loops Related to the Loop API label Mar 25, 2022
@stale
Copy link

stale bot commented Apr 16, 2022

This pull request has been automatically marked as stale because it has not had recent activity. It will be closed in 7 days if no further activity occurs. If you need further help see our docs: https://pytorch-lightning.readthedocs.io/en/latest/generated/CONTRIBUTING.html#pull-request or ask the assistance of a core contributor here or on Slack. Thank you for your contributions.

@stale stale bot added the won't fix This will not be worked on label Apr 16, 2022
@stale
Copy link

stale bot commented Apr 24, 2022

This pull request is going to be closed. Please feel free to reopen it create a new from the actual master.

@stale stale bot closed this Apr 24, 2022
@Borda Borda reopened this Apr 24, 2022
@stale stale bot removed the won't fix This will not be worked on label Apr 24, 2022
@codecov
Copy link

codecov bot commented Apr 24, 2022

Codecov Report

Merging #12441 (5a768c1) into master (d418cf2) will decrease coverage by 3%.
The diff coverage is n/a.

❗ Current head 5a768c1 differs from pull request most recent head 23809c9. Consider uploading reports for the commit 23809c9 to get more accurate results

@@            Coverage Diff            @@
##           master   #12441     +/-   ##
=========================================
- Coverage      92%      89%     -3%     
=========================================
  Files         207      218     +11     
  Lines       17702    22549   +4847     
=========================================
+ Hits        16235    20081   +3846     
- Misses       1467     2468   +1001     

Co-authored-by: Adrian Wälchli <aedu.waelchli@gmail.com>
Copy link
Contributor

@krshrimali krshrimali left a comment

Choose a reason for hiding this comment

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

Thanks, @niberger for the contribution! 🚀 LGTM!

@mergify mergify bot added the ready PRs ready to be merged label Apr 25, 2022
@akihironitta akihironitta enabled auto-merge (squash) April 26, 2022 02:26
@akihironitta akihironitta added this to the 1.6.x milestone Apr 26, 2022
Copy link
Contributor

@akihironitta akihironitta left a comment

Choose a reason for hiding this comment

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

LGTM!

@carmocca carmocca added the community This PR is from the community label Apr 28, 2022
@akihironitta akihironitta merged commit 61e4410 into Lightning-AI:master Apr 29, 2022
carmocca pushed a commit that referenced this pull request May 2, 2022
* allow pickling of KFoldLoop

* Update pl_examples/loop_examples/kfold.py

Co-authored-by: Adrian Wälchli <aedu.waelchli@gmail.com>
Co-authored-by: Nicolas Berger <nicolas.berger@inait.ai>
Co-authored-by: Kushashwa Ravi Shrimali <kushashwaravishrimali@gmail.com>
carmocca pushed a commit that referenced this pull request May 3, 2022
* allow pickling of KFoldLoop

* Update pl_examples/loop_examples/kfold.py

Co-authored-by: Adrian Wälchli <aedu.waelchli@gmail.com>
Co-authored-by: Nicolas Berger <nicolas.berger@inait.ai>
Co-authored-by: Kushashwa Ravi Shrimali <kushashwaravishrimali@gmail.com>
lexierule pushed a commit that referenced this pull request May 3, 2022
* allow pickling of KFoldLoop

* Update pl_examples/loop_examples/kfold.py

Co-authored-by: Adrian Wälchli <aedu.waelchli@gmail.com>
Co-authored-by: Nicolas Berger <nicolas.berger@inait.ai>
Co-authored-by: Kushashwa Ravi Shrimali <kushashwaravishrimali@gmail.com>
@rohitgr7 rohitgr7 mentioned this pull request Jul 1, 2022
12 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

community This PR is from the community example loops Related to the Loop API ready PRs ready to be merged

Projects

None yet

Development

Successfully merging this pull request may close these issues.

KFold example with ddp_spawn crash

6 participants