Skip to content

Merge different gpu backends with accelerator='gpu' #13642

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

Merged
merged 38 commits into from
Jul 25, 2022

Conversation

justusschock
Copy link
Member

@justusschock justusschock commented Jul 13, 2022

What does this PR do?

Setting accelerator='gpu' does no longer select the GPUAccelerator (see #13636 ), but will dynamically choose an available GPU backend (currently cuda or mps)

Fixes #13102

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

Yes, together with #13636 this changes accelerator='gpu' to dynamically select gpu backends

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 minor internal changes/refactors)

PR review

Anyone in the community is welcome to review the PR.
Before you start reviewing, make sure you have read the 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 🙃

cc @Borda @justusschock @kaushikb11 @awaelchli @akihironitta @rohitgr7

@justusschock justusschock changed the base branch from master to reroute_gpu_accelerator July 19, 2022 09:15
@rohitgr7 rohitgr7 force-pushed the reroute_gpu_accelerator branch from 8124087 to 9f19717 Compare July 19, 2022 10:20
@justusschock justusschock force-pushed the reroute_gpu_accelerator branch from 9f19717 to d630a2c Compare July 19, 2022 11:34
@rohitgr7 rohitgr7 force-pushed the reroute_gpu_accelerator branch from d630a2c to 3247b1f Compare July 19, 2022 11:45
@justusschock justusschock force-pushed the merge_different_gpus branch 2 times, most recently from d5d1b7a to d630a2c Compare July 19, 2022 12:51
Base automatically changed from reroute_gpu_accelerator to master July 19, 2022 17:06
@github-actions github-actions bot added the pl Generic label for PyTorch Lightning package label Jul 20, 2022
@carmocca carmocca added this to the pl:1.7 milestone Jul 20, 2022
@justusschock justusschock marked this pull request as ready for review July 21, 2022 17:34
@github-actions github-actions bot removed the pl Generic label for PyTorch Lightning package label Jul 21, 2022
@github-actions github-actions bot added the pl Generic label for PyTorch Lightning package label Jul 21, 2022
@mergify mergify bot added the ready PRs ready to be merged label Jul 21, 2022
@codecov
Copy link

codecov bot commented Jul 22, 2022

Codecov Report

Merging #13642 (a0c76b9) into master (8d14554) will increase coverage by 27%.
The diff coverage is 100%.

❗ Current head a0c76b9 differs from pull request most recent head 92de866. Consider uploading reports for the commit 92de866 to get more accurate results

@@            Coverage Diff            @@
##           master   #13642     +/-   ##
=========================================
+ Coverage      49%      76%    +27%     
=========================================
  Files         328      327      -1     
  Lines       25552    25679    +127     
=========================================
+ Hits        12470    19538   +7068     
+ Misses      13082     6141   -6941     

@mergify mergify bot added has conflicts and removed ready PRs ready to be merged labels Jul 22, 2022
@mergify mergify bot added ready PRs ready to be merged and removed has conflicts ready PRs ready to be merged labels Jul 25, 2022
@justusschock justusschock enabled auto-merge (squash) July 25, 2022 09:33
@carmocca
Copy link
Contributor

@justusschock CI failures look real

@awaelchli
Copy link
Contributor

Fixed it. After the changes we did for ddp fork #13405, we should mock the device parser functions instead of torch.cuda.device_count directly.

@justusschock justusschock merged commit 2278719 into master Jul 25, 2022
@justusschock justusschock deleted the merge_different_gpus branch July 25, 2022 14:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
accelerator: cuda Compute Unified Device Architecture GPU accelerator: mps Apple Silicon GPU pl Generic label for PyTorch Lightning package ready PRs ready to be merged
Projects
None yet
Development

Successfully merging this pull request may close these issues.

MPS (Mac M1) device support