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

LiteDataLoader code improvements and docs #10625

Merged
merged 8 commits into from
Nov 21, 2021
Merged

Conversation

awaelchli
Copy link
Contributor

@awaelchli awaelchli commented Nov 19, 2021

What does this PR do?

Part of #10297 (follow-up to #10279)
Related: #10329

Updates docs, fixes typing (a DataLoader is not an iterator).

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?

I made sure I had fun coding 🙃

Part of #1 (it's a lie, this is just here to avoid noisy GitHub bot)

cc @Borda @justusschock @awaelchli @akihironitta @ninginthecloud @carmocca

@awaelchli awaelchli changed the title dataloader code improvements and docs LiteDataLoader code improvements and docs Nov 19, 2021
@awaelchli awaelchli marked this pull request as ready for review November 19, 2021 12:32
@awaelchli awaelchli added data handling Generic data-related topic docs Documentation related fabric lightning.fabric.Fabric refactor labels Nov 19, 2021
@awaelchli awaelchli added this to the 1.6 milestone Nov 19, 2021
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 ! This code was added for people not using a DataLoader

@awaelchli
Copy link
Contributor Author

LGTM ! This code was added for people not using a DataLoader

In order to provide a seamless experience with all accelerators and strategies, we currently assume in both Lightning and Lite only DataLoaders.
If there is a desire to support non-DataLoader iterables, we will have to rethink a few components to make this work.

pytorch_lightning/lite/wrappers.py Show resolved Hide resolved
pytorch_lightning/lite/wrappers.py Show resolved Hide resolved
pytorch_lightning/lite/wrappers.py Show resolved Hide resolved
pytorch_lightning/lite/wrappers.py Outdated Show resolved Hide resolved
@mergify mergify bot added the ready PRs ready to be merged label Nov 19, 2021
@mergify mergify bot requested a review from a team November 19, 2021 13:40
@justusschock
Copy link
Member

@awaelchli

In order to provide a seamless experience with all accelerators and strategies, we currently assume in both Lightning and Lite only DataLoaders.

AFAIK this is not true for Lightning, where we explicitly have type checks against the data loader when replacing samplers etc. to make sure it also works with raw iterables (just not all features then)

@awaelchli
Copy link
Contributor Author

AFAIK this is not true for Lightning, where we explicitly have type checks against the data loader when replacing samplers etc. to make sure it also works with raw iterables (just not all features then)

This claim has been made in the past but where do we see that in our tests, docs and examples? I am failing to create an example based on our boring model, as it will just throw an error.

Copy link
Contributor

@carmocca carmocca left a comment

Choose a reason for hiding this comment

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

Thanks Adrian!

Would you mind also addressing the open reviews in #10279 ?

pytorch_lightning/lite/wrappers.py Outdated Show resolved Hide resolved
@awaelchli awaelchli force-pushed the refactor/lite-dataloader-1 branch from 7fb2747 to b9bb5c3 Compare November 19, 2021 21:43
@awaelchli awaelchli merged commit 8ea39d2 into master Nov 21, 2021
@awaelchli awaelchli deleted the refactor/lite-dataloader-1 branch November 21, 2021 01:33
Raalsky pushed a commit to neptune-ai/pytorch-lightning that referenced this pull request Nov 23, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
data handling Generic data-related topic docs Documentation related fabric lightning.fabric.Fabric ready PRs ready to be merged refactor
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants