Skip to content

Commit

Permalink
Revert "Update merlin.core.compat to use HAS_GPU and add add'l li…
Browse files Browse the repository at this point in the history
…braries (NVIDIA-Merlin#262)"

This reverts commit e365820.
  • Loading branch information
karlhigley committed Mar 29, 2023
1 parent 099f8fd commit 05f9274
Showing 1 changed file with 13 additions and 29 deletions.
42 changes: 13 additions & 29 deletions merlin/core/compat.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#
# Copyright (c) 2023, NVIDIA CORPORATION.
# Copyright (c) 2022, NVIDIA CORPORATION.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
Expand All @@ -17,6 +17,11 @@
# pylint: disable=unused-import
import os

try:
from numba import cuda
except ImportError:
cuda = None

from dask.distributed.diagnostics import nvml


Expand Down Expand Up @@ -45,42 +50,21 @@ def _get_gpu_count():

HAS_GPU = _get_gpu_count() > 0

if HAS_GPU:
try:
from numba import cuda
except ImportError:
cuda = None

try:
import cudf
except ImportError:
cudf = None

try:
import cupy
except ImportError:
cupy = None

try:
import dask_cudf
except ImportError:
dask_cudf = None

else:
cuda = None
cudf = None
cupy = None
dask_cudf = None

try:
import numpy
except ImportError:
numpy = None

try:
import pandas
import cupy
except ImportError:
pandas = None
cupy = None

try:
import cudf
except ImportError:
cudf = None

try:
import tensorflow
Expand Down

0 comments on commit 05f9274

Please sign in to comment.