-
Notifications
You must be signed in to change notification settings - Fork 3.5k
add accelerator.is_available()
check
#12104
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
add accelerator.is_available()
check
#12104
Conversation
accelerator.is_available()
checkaccelerator.is_available()
check
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM! Thank you for adding this
for more information, see https://pre-commit.ci
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM !
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. Once others' suggestions are addressed.
for more information, see https://pre-commit.ci
for more information, see https://pre-commit.ci
…s.py Co-authored-by: ananthsub <[email protected]>
Co-authored-by: ananthsub <[email protected]>
Co-authored-by: ananthsub <[email protected]>
Co-authored-by: ananthsub <[email protected]>
Co-authored-by: ananthsub <[email protected]>
Co-authored-by: ananthsub <[email protected]>
@@ -475,6 +474,15 @@ def _set_parallel_devices_and_init_accelerator(self) -> None: | |||
accelerator_class = ACCELERATORS[self._accelerator_flag] | |||
self.accelerator = accelerator_class() # type: ignore[abstract] | |||
|
|||
if not self.accelerator.is_available(): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
depending on the accelerator, we might not be able to instantiate it without it being available. The init should have the freedom to assume it is available or raise additional errors. IMO the check should have been before the instantiation.
What does this PR do?
part of #11449: Enable accelerator.is_available() check
reference: implemented in PR #11797
Does your PR introduce any breaking changes? If yes, please list them.
adds hardware check in Trainer (AcceleratorConnector) init
Before submitting
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:
Did you have fun?
Make sure you had fun coding 🙃