Skip to content

Commit

Permalink
Merge branch 'main' into update-diffusers-mixins
Browse files Browse the repository at this point in the history
  • Loading branch information
IlyasMoutawwakil committed Sep 16, 2024
2 parents 79cd9ac + ca36fc4 commit 0869f1c
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions optimum/onnxruntime/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
# limitations under the License.
"""Utility functions, classes and constants for ONNX Runtime."""

import importlib
import os
import re
from enum import Enum
Expand All @@ -31,7 +32,6 @@
import onnxruntime as ort

from ..exporters.onnx import OnnxConfig, OnnxConfigWithLoss
from ..utils.import_utils import _is_package_available


if TYPE_CHECKING:
Expand Down Expand Up @@ -91,9 +91,11 @@ def is_onnxruntime_training_available():

def is_cupy_available():
"""
Checks if onnxruntime-training is available.
Checks if CuPy is available.
"""
return _is_package_available("cupy")
# Don't use _is_package_available as it doesn't work with CuPy installed
# with `cupy-cuda*` and `cupy-rocm-*` package name (prebuilt wheels).
return importlib.util.find_spec("cupy") is not None


class ORTConfigManager:
Expand Down

0 comments on commit 0869f1c

Please sign in to comment.