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

3/n inter batch parallelism #9052

Merged
merged 96 commits into from
Aug 24, 2021
Merged

3/n inter batch parallelism #9052

merged 96 commits into from
Aug 24, 2021

Conversation

tchaton
Copy link
Contributor

@tchaton tchaton commented Aug 23, 2021

What does this PR do?

Blocked by #9047

This PR adds remove entirely InterBatchProcessor and rely on DataFetcher.

fixes #8867
fixes #8316

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

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 🙃

@tchaton tchaton enabled auto-merge (squash) August 24, 2021 16:45
pytorch_lightning/loops/batch/training_batch_loop.py Outdated Show resolved Hide resolved
pytorch_lightning/core/lightning.py Outdated Show resolved Hide resolved
pytorch_lightning/core/lightning.py Outdated Show resolved Hide resolved
pytorch_lightning/loops/epoch/evaluation_epoch_loop.py Outdated Show resolved Hide resolved
pytorch_lightning/core/lightning.py Outdated Show resolved Hide resolved
tests/utilities/test_fetching.py Outdated Show resolved Hide resolved
@carmocca carmocca disabled auto-merge August 24, 2021 17:43
@carmocca carmocca enabled auto-merge (squash) August 24, 2021 17:44
@carmocca carmocca added this to the v1.5 milestone Aug 24, 2021
@carmocca carmocca added design Includes a design discussion feature Is an improvement or enhancement labels Aug 24, 2021
@carmocca carmocca merged commit f959b13 into master Aug 24, 2021
@carmocca carmocca deleted the 3/n_inter_batch_parallelism branch August 24, 2021 18:45
def training_step(self, dataloader_iter: Iterator, *args) -> STEP_OUTPUT:
output = super().training_step(dataloader_iter)
if self.trigger_stop_iteration and args[0] == EXPECT_NUM_BATCHES_PROCESSED:
raise StopIteration
Copy link
Contributor

Choose a reason for hiding this comment

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

@tchaton @awaelchli Is using a StopIteration here international or was it just meant as a DummyException?

This has the problem that it's the exception checked by the loops to stop, so after it is raised, the loops will try to run on_run_end but any further state done at the end of advance or on_advance_end will not have happened so things can be out of sync.

Blocking #9349

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, this is intentional, but it should work as expected.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
design Includes a design discussion feature Is an improvement or enhancement ready PRs ready to be merged
Projects
None yet
7 participants