From 7c6a97559d070f161131853dc03e600c6a0ca82d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Danie=CC=88l=20de=20Kok?= Date: Wed, 25 May 2022 14:06:45 +0200 Subject: [PATCH] Simplify GPU check This change removes `thinc.util.has_cupy` from the GPU presence check. Currently `gpu_is_available` already implies `has_cupy`. We also want to show this warning in the future when a machine has a non-CuPy GPU. --- spacy/cli/_util.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/spacy/cli/_util.py b/spacy/cli/_util.py index df98e711f..bb7f2d352 100644 --- a/spacy/cli/_util.py +++ b/spacy/cli/_util.py @@ -12,7 +12,7 @@ from click.parser import split_arg_string from typer.main import get_command from contextlib import contextmanager from thinc.api import Config, ConfigValidationError, require_gpu -from thinc.util import has_cupy, gpu_is_available +from thinc.util import gpu_is_available from configparser import InterpolationError import os @@ -554,5 +554,5 @@ def setup_gpu(use_gpu: int, silent=None) -> None: require_gpu(use_gpu) else: local_msg.info("Using CPU") - if has_cupy and gpu_is_available(): + if gpu_is_available(): local_msg.info("To switch to GPU 0, use the option: --gpu-id 0")