Skip to content

Commit

Permalink
sync with internal repo (commit 457dd8eb)
Browse files Browse the repository at this point in the history
  • Loading branch information
leofang committed May 20, 2022
1 parent 0f00494 commit e7b79d1
Show file tree
Hide file tree
Showing 6 changed files with 33 additions and 13 deletions.
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Copyright (c) 2021-2022 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
Copyright (c) 2022 NVIDIA CORPORATION & AFFILIATES. All rights reserved.

BSD-3-Clause

Expand Down
4 changes: 2 additions & 2 deletions python/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ Build-time dependencies of the cuQuantum Python package and some versions that
are known to work are as follows:

* CUDA Toolkit 11.x
* cuQuantum 22.03
* cuQuantum 22.03+
* cuTENSOR 1.5.0+
* Cython - e.g. 0.29.21
* [packaging](https://packaging.pypa.io/en/latest/)
Expand Down Expand Up @@ -62,7 +62,7 @@ Runtime dependencies of the cuQuantum Python package include:
* An NVIDIA GPU with compute capability 7.0+
* Driver: Linux (450.80.02+)
* CUDA Toolkit 11.x
* cuQuantum 22.03
* cuQuantum 22.03+
* cuTENSOR 1.5.0+
* NumPy v1.17+
* CuPy v9.5.0+ (see [installation guide](https://docs.cupy.dev/en/stable/install.html))
Expand Down
2 changes: 1 addition & 1 deletion python/cuquantum/_version.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@
# Note: cuQuantum Python follows the cuQuantum SDK version, which is now
# switched to YY.MM and is different from individual libraries' (semantic)
# versioning scheme.
__version__ = '22.03.0' # the last digit is for cuQuantum Python only
__version__ = '22.05.0' # the last digit is for cuQuantum Python only
22 changes: 14 additions & 8 deletions python/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,10 @@
# 22.3 by setuptools, so we must follow the same practice in the constraints;
# also, we don't need the Python patch number here
cuqnt_py_ver = Version(__version__)
cuqnt_ver_major_minor = f"{cuqnt_py_ver.major}.{cuqnt_py_ver.minor}"
# WAR: restore this line when releasing 22.06, for now we pin at 22.03 to
# enable binary compatibility
#cuqnt_ver_major_minor = f"{cuqnt_py_ver.major}.{cuqnt_py_ver.minor}"
cuqnt_ver_major_minor = '22.3'


# search order:
Expand Down Expand Up @@ -94,17 +97,20 @@
]
install_requires = [
'numpy',
# 'cupy', # <-- can't be listed here as on PyPI this is the name for source build, not for wheel
# 'torch', # <-- PyTorch is optional; also, it does not live on PyPI...
# 'cupy', # TODO: use "cupy-wheel" once it's stablized, see https://github.com/cupy/cupy/issues/6688
# 'torch', # <-- PyTorch is optional; also, the PyPI version does not support GPU...
'typing_extensions',
]
ignore_cuquantum_dep = bool(os.environ.get('CUQUANTUM_IGNORE_SOLVER', False))
if not ignore_cuquantum_dep:
assert using_cuquantum_wheel # if this raises, the env is corrupted
# cuTENSOR version is constrained in the cuquantum package, so we don't
# need to list it
setup_requires.append(f'cuquantum=={cuqnt_ver_major_minor}.*')
install_requires.append(f'cuquantum=={cuqnt_ver_major_minor}.*')
# - cuTENSOR version is constrained in the cuquantum package, so we don't
# need to list it
# - here we assume no API breaking across releases, if there's any we must
# bump the lowest supported version; we can't cap the highest supported
# version as we don't use semantic versioning, unfortunately...
setup_requires.append(f'cuquantum>={cuqnt_ver_major_minor}.*')
install_requires.append(f'cuquantum>={cuqnt_ver_major_minor}.*')


def check_cuda_version():
Expand Down Expand Up @@ -225,7 +231,7 @@ def prepare_libs_and_rpaths():
"Environment :: GPU :: NVIDIA CUDA :: 11.3",
"Environment :: GPU :: NVIDIA CUDA :: 11.4",
"Environment :: GPU :: NVIDIA CUDA :: 11.5",
#"Environment :: GPU :: NVIDIA CUDA :: 11.6", # PyPI has not added it yet
"Environment :: GPU :: NVIDIA CUDA :: 11.6",
],
ext_modules=cythonize([
custatevec,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

import copy
import os
import sys
import tempfile

try:
Expand All @@ -29,6 +30,11 @@
#
###################################################################

if cffi:
# if the Python binding is not installed in the editable mode (pip install
# -e .), the cffi tests would fail as the modules cannot be imported
sys.path.append(os.getcwd())

dtype_to_data_type = {
numpy.dtype(numpy.complex64): cudaDataType.CUDA_C_32F,
numpy.dtype(numpy.complex128): cudaDataType.CUDA_C_64F,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
from collections import abc
import functools
import os
import sys
import tempfile

try:
Expand All @@ -31,6 +32,11 @@
#
###################################################################

if cffi:
# if the Python binding is not installed in the editable mode (pip install
# -e .), the cffi tests would fail as the modules cannot be imported
sys.path.append(os.getcwd())

dtype_to_data_type = {
numpy.float16: cudaDataType.CUDA_R_16F,
numpy.float32: cudaDataType.CUDA_R_32F,
Expand Down Expand Up @@ -269,8 +275,10 @@ def test_get_version(self):
assert ver == cutn.VERSION

def test_get_cudart_version(self):
# CUDA runtime is statically linked, so we can't compare
# with the "runtime" version
ver = cutn.get_cudart_version()
assert ver == cupy.cuda.runtime.runtimeGetVersion()
assert isinstance(ver, int)


class TestHandle:
Expand Down

0 comments on commit e7b79d1

Please sign in to comment.