-
Notifications
You must be signed in to change notification settings - Fork 3.6k
Add name to accelerator interface #21325
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
Conversation
⚡ Required checks status: All passing 🟢Groups summary🟢 pytorch_lightning: Tests workflow
These checks are required after the changes to 🟢 pytorch_lightning: lit GPU
These checks are required after the changes to 🟢 Benchmarks
These checks are required after the changes to 🟢 fabric: Docs
These checks are required after the changes to 🟢 pytorch_lightning: Docs
These checks are required after the changes to 🟢 lightning_fabric: CPU workflow
These checks are required after the changes to 🟢 lightning_fabric: lit GPU
These checks are required after the changes to 🟢 mypy
These checks are required after the changes to 🟢 install
These checks are required after the changes to Thank you for your contribution! 💜
|
for more information, see https://pre-commit.ci
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #21325 +/- ##
=========================================
+ Coverage 80% 87% +7%
=========================================
Files 270 270
Lines 23764 23799 +35
=========================================
+ Hits 19040 20629 +1589
+ Misses 4724 3170 -1554 |
What does this PR do?
Adds a name function to
Acceleratorinterface.Allows accelerator type checks that are agnostic to the package.
E.g.
isinstance(accelerator, lightning.fabric.CUDAAccelerator)doesn't work forlightning_fabric.CUDAAccelerator.And in the future we can check for
accelerator.name() == "cuda".All of those checks we have inside the package are converted properly, but external code cannot properly rely on package-agnostic type-checks.
Before submitting
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:
Reviewer checklist