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

Improve exception when CuPy/PyTorch MPS is not installed #863

Merged

Conversation

danieldk
Copy link
Contributor

Description

require_gpu does not distinguish between different failure scenarios, which makes it harder to debug why GPU support is not working. See e.g.

explosion/spaCy#12410

Rather than raising a generic No GPU devices can be detected when CuPy or PyTorch with MPS isn't installed, this change adds more specific errors.

Types of change

Enhancement

Checklist

  • I confirm that I have the right to submit this contribution under the project's MIT license.
  • I ran the tests, and all new and existing tests passed.
  • My changes don't require a change to the documentation, or if they do, I've added all required information.

Rather than raising a generic `No GPU devices can be detected` when
CuPy or PyTorch with MPS isn't installed, but raise more specific
errors.
@netlify
Copy link

netlify bot commented Mar 14, 2023

👷 Deploy request for thinc-ai pending review.

Visit the deploys page to approve it

Name Link
🔨 Latest commit 0a06c6e

@danieldk danieldk added the enhancement Feature requests and improvements label Mar 14, 2023
thinc/compat.py Outdated Show resolved Hide resolved
It's undocumented.
@svlandeg svlandeg merged commit 7cc8dcf into explosion:master Mar 24, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Feature requests and improvements
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants