コード例 #1
0
 def __init__(self):
     super(NcclResource, self).__init__()
     self.nccl_comm = None
     from cupy.cuda import nccl
     print("NCCL Version:", nccl.get_version())
     if nccl.get_version() < 2400:
         raise ValueError("NCCL must be later than 2.4")
コード例 #2
0
ファイル: _runtime.py プロジェクト: wphicks/cupy
    def __init__(self):
        self.cupy_version = cupy.__version__

        if not is_hip:
            self.cuda_path = cupy.cuda.get_cuda_path()
        else:
            self.cuda_path = cupy._environment.get_rocm_path()

        self.cuda_build_version = cupy.cuda.driver.get_build_version()
        self.cuda_driver_version = _eval_or_error(
            cupy.cuda.runtime.driverGetVersion,
            cupy.cuda.runtime.CUDARuntimeError)

        self.cuda_runtime_version = _eval_or_error(
            cupy.cuda.runtime.runtimeGetVersion,
            cupy.cuda.runtime.CUDARuntimeError)

        self.cublas_version = _eval_or_error(
            lambda: cupy.cuda.cublas.getVersion(cupy.cuda.device.
                                                get_cublas_handle()),
            cupy.cuda.cublas.CUBLASError)
        self.cufft_version = _eval_or_error(cupy.cuda.cufft.getVersion,
                                            cupy.cuda.cufft.CuFFTError)
        self.curand_version = _eval_or_error(cupy.cuda.curand.getVersion,
                                             cupy.cuda.curand.CURANDError)
        self.cusolver_version = _eval_or_error(
            cupy.cuda.cusolver._getVersion, cupy.cuda.cusolver.CUSOLVERError)
        self.cusparse_version = _eval_or_error(
            lambda: cupy.cuda.cusparse.getVersion(cupy.cuda.device.
                                                  get_cusparse_handle()),
            cupy.cuda.cusparse.CuSparseError)
        self.nvrtc_version = _eval_or_error(cupy.cuda.nvrtc.getVersion,
                                            cupy.cuda.nvrtc.NVRTCError)

        if thrust is not None:
            self.thrust_version = thrust.get_build_version()

        if cudnn is not None:
            self.cudnn_build_version = cudnn.get_build_version()
            self.cudnn_version = _eval_or_error(cudnn.getVersion,
                                                cudnn.CuDNNError)

        if nccl is not None:
            self.nccl_build_version = nccl.get_build_version()
            nccl_runtime_version = nccl.get_version()
            if nccl_runtime_version == 0:
                nccl_runtime_version = '(unknown)'
            self.nccl_runtime_version = nccl_runtime_version

        if cub is not None:
            self.cub_build_version = cub.get_build_version()

        if cutensor is not None:
            self.cutensor_version = cutensor.get_version()

        self.numpy_version = numpy.version.full_version
        if scipy is not None:
            self.scipy_version = scipy.version.full_version
コード例 #3
0
    def __init__(self):
        self.cupy_version = cupy.__version__

        self.cuda_path = cupy.cuda.get_cuda_path()

        self.cuda_build_version = cupy.cuda.driver.get_build_version()
        self.cuda_driver_version = _eval_or_error(
            cupy.cuda.runtime.driverGetVersion,
            cupy.cuda.runtime.CUDARuntimeError)

        self.cuda_runtime_version = _eval_or_error(
            cupy.cuda.runtime.runtimeGetVersion,
            cupy.cuda.runtime.CUDARuntimeError)

        self.cublas_version = _eval_or_error(
            lambda: cupy.cuda.cublas.getVersion(
                cupy.cuda.device.get_cublas_handle()),
            cupy.cuda.cublas.CUBLASError)
        self.cufft_version = _eval_or_error(
            cupy.cuda.cufft.getVersion,
            cupy.cuda.cufft.CuFFTError)
        self.curand_version = _eval_or_error(
            cupy.cuda.curand.getVersion,
            cupy.cuda.curand.CURANDError)
        self.cusolver_version = _eval_or_error(
            cupy.cuda.cusolver._getVersion,
            cupy.cuda.cusolver.CUSOLVERError)
        self.cusparse_version = _eval_or_error(
            lambda: cupy.cuda.cusparse.getVersion(
                cupy.cuda.device.get_cusparse_handle()),
            cupy.cuda.cusparse.CuSparseError)
        self.nvrtc_version = _eval_or_error(
            cupy.cuda.nvrtc.getVersion,
            cupy.cuda.nvrtc.NVRTCError)

        if cudnn is not None:
            self.cudnn_build_version = cudnn.get_build_version()
            self.cudnn_version = _eval_or_error(
                cudnn.getVersion, cudnn.CuDNNError)

        if nccl is not None:
            self.nccl_build_version = nccl.get_build_version()
            nccl_runtime_version = nccl.get_version()
            if nccl_runtime_version == 0:
                nccl_runtime_version = '(unknown)'
            self.nccl_runtime_version = nccl_runtime_version

        if cub is not None:
            # There is no API in CUB to retrieve the current version
            # We show if its enabled or disabled
            self.cub_version = 'Enabled'

        if cutensor is not None:
            self.cutensor_version = cutensor.get_version()
コード例 #4
0
ファイル: runtime.py プロジェクト: liygcheng/cupy
    def __init__(self):
        self.cupy_version = cupy.__version__

        self.cuda_path = cupy.cuda.get_cuda_path()
        self.cuda_build_version = cupy.cuda.driver.get_build_version()
        self.cuda_driver_version = cupy.cuda.runtime.driverGetVersion()
        self.cuda_runtime_version = cupy.cuda.runtime.runtimeGetVersion()

        if cudnn is not None:
            self.cudnn_build_version = cudnn.get_build_version()
            self.cudnn_version = cudnn.getVersion()

        if nccl is not None:
            self.nccl_build_version = nccl.get_version()
コード例 #5
0
 def test_nccl(self):
     if sys.platform == 'win32':
         # NCCL is not available on Windows.
         return
     preload_version = self._get_config()['nccl']['version']
     major, minor, patchlevel = (int(x) for x in preload_version.split('.'))
     major_mult = 1000
     if (2, 9) <= (major, minor):
         # NCCL 2.9 shows version as 20908 instead of 2908
         major_mult = 10000
     expected_version = major * major_mult + minor * 100 + patchlevel
     assert libnccl.available
     assert libnccl.get_build_version() == expected_version
     assert libnccl.get_version() == expected_version
コード例 #6
0
ファイル: runtime.py プロジェクト: zhengfangwu/cupy
    def __init__(self):
        self.cupy_version = cupy.__version__

        self.cuda_path = cupy.cuda.get_cuda_path()
        self.cuda_build_version = cupy.cuda.driver.get_build_version()
        self.cuda_driver_version = _eval_or_error(
            cupy.cuda.runtime.driverGetVersion,
            cupy.cuda.runtime.CUDARuntimeError)
        self.cuda_runtime_version = _eval_or_error(
            cupy.cuda.runtime.runtimeGetVersion,
            cupy.cuda.runtime.CUDARuntimeError)

        if cudnn is not None:
            self.cudnn_build_version = cudnn.get_build_version()
            self.cudnn_version = _eval_or_error(cudnn.getVersion,
                                                cudnn.CuDNNError)

        if nccl is not None:
            self.nccl_build_version = nccl.get_version()
コード例 #7
0
ファイル: runtime.py プロジェクト: zivzone/cupy
    def __init__(self):
        self.cupy_version = cupy.__version__

        self.cuda_path = cupy.cuda.get_cuda_path()

        self.cuda_build_version = cupy.cuda.driver.get_build_version()
        self.cuda_driver_version = _eval_or_error(
            cupy.cuda.runtime.driverGetVersion,
            cupy.cuda.runtime.CUDARuntimeError)

        self.cuda_runtime_version = _eval_or_error(
            cupy.cuda.runtime.runtimeGetVersion,
            cupy.cuda.runtime.CUDARuntimeError)

        self.cublas_version = _eval_or_error(
            lambda: cupy.cuda.cublas.getVersion(cupy.cuda.device.
                                                get_cublas_handle()),
            cupy.cuda.cublas.CUBLASError)
        self.cufft_version = _eval_or_error(cupy.cuda.cufft.getVersion,
                                            cupy.cuda.cufft.CuFFTError)
        self.curand_version = _eval_or_error(cupy.cuda.curand.getVersion,
                                             cupy.cuda.curand.CURANDError)
        self.cusolver_version = _eval_or_error(
            cupy.cuda.cusolver._getVersion, cupy.cuda.cusolver.CUSOLVERError)
        self.cusparse_version = _eval_or_error(
            lambda: cupy.cuda.cusparse.getVersion(cupy.cuda.device.
                                                  get_cusparse_handle()),
            cupy.cuda.cusparse.CuSparseError)
        self.nvrtc_version = _eval_or_error(cupy.cuda.nvrtc.getVersion,
                                            cupy.cuda.nvrtc.NVRTCError)

        if cudnn is not None:
            self.cudnn_build_version = cudnn.get_build_version()
            self.cudnn_version = _eval_or_error(cudnn.getVersion,
                                                cudnn.CuDNNError)

        if nccl is not None:
            self.nccl_build_version = nccl.get_build_version()
            nccl_runtime_version = nccl.get_version()
            if nccl_runtime_version == 0:
                nccl_runtime_version = '(unknown)'
            self.nccl_runtime_version = nccl_runtime_version
コード例 #8
0
ファイル: nccl_util.py プロジェクト: zivzone/ray
def get_nccl_runtime_version():
    return get_version()
コード例 #9
0
import pickle
import unittest

import cupy
from cupy import cuda
from cupy.cuda import nccl
from cupy import testing

nccl_available = nccl.available

if nccl_available:
    nccl_version = nccl.get_version()
else:
    nccl_version = -1


@unittest.skipUnless(nccl_available, 'nccl is not installed')
class TestNCCL(unittest.TestCase):
    @testing.gpu
    def test_single_proc_ring(self):
        id = nccl.get_unique_id()
        comm = nccl.NcclCommunicator(1, id, 0)
        assert 0 == comm.rank_id()
        comm.destroy()

    @testing.gpu
    @unittest.skipUnless(nccl_version >= 2400, 'Using old NCCL')
    def test_abort(self):
        id = nccl.get_unique_id()
        comm = nccl.NcclCommunicator(1, id, 0)
        comm.abort()