Skip to content

Commit

Permalink
Merge pull request #43 from conda-forge-admin/conda_forge_admin_42
Browse files Browse the repository at this point in the history
cuQuantum 23.06.0
  • Loading branch information
leofang authored Jul 13, 2023
2 parents 5f806d4 + 85185bf commit ff2572f
Show file tree
Hide file tree
Showing 2 changed files with 43 additions and 36 deletions.
4 changes: 4 additions & 0 deletions README.md

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

75 changes: 39 additions & 36 deletions recipe/meta.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Make sure the component versions are consistent with the SDK version!
{% set version = "23.03.0.20" %}
{% set cusv_version = "1.3.0" %}
{% set cutn_version = "2.1.0" %}
{% set version = "23.06.0.7" %}
{% set cusv_version = "1.4.0" %}
{% set cutn_version = "2.2.0" %}

{% if cuda_compiler_version in (None, "None", True, False) %}
{% set cuda_major = 0 %}
Expand All @@ -10,7 +10,7 @@
{% endif %}

# prioritize nompi variant via build number
{% set build_num = 3 %}
{% set build_num = 0 %}
{% if mpi == 'nompi' %}
{% set cutn_build = build_num + 100 %}
{% else %}
Expand All @@ -29,21 +29,24 @@ package:
version: {{ version }}

source:
- url: https://developer.download.nvidia.com/compute/cuquantum/redist/cuquantum/linux-x86_64/cuquantum-linux-x86_64-{{ version }}-archive.tar.xz # [linux64]
sha256: 08b31e47adcfbdecad935589e3245a35ee7ee0886f1e8c745aca570213598790 # [linux64]
- url: https://developer.download.nvidia.com/compute/cuquantum/redist/cuquantum/linux-x86_64/cuquantum-linux-x86_64-{{ version }}_cuda{{ cuda_major }}-archive.tar.xz # [linux64]
sha256: 0c5cfcd173bcad8771173951643da7cd976bd7062a5e9453fb7655f5aeb1543a # [linux64 and (cuda_compiler_version or "").startswith("11")]
sha256: 5b3ee6f702651df7def9a93f4593719d53ff6152eb939110897dda943124310a # [linux64 and (cuda_compiler_version or "").startswith("12")]

- url: https://developer.download.nvidia.com/compute/cuquantum/redist/cuquantum/linux-sbsa/cuquantum-linux-sbsa-{{ version }}-archive.tar.xz # [aarch64]
sha256: 11475c96d1b5713ce6646474796ace676c00f1259ba16c2130c7e74a6fb75ea2 # [aarch64]
- url: https://developer.download.nvidia.com/compute/cuquantum/redist/cuquantum/linux-sbsa/cuquantum-linux-sbsa-{{ version }}_cuda{{ cuda_major }}-archive.tar.xz # [aarch64]
sha256: e2518fc55ccf7ca3223445c4ab440fbdf0d2ef56ec587f7756b06b7dab9c1cf4 # [aarch64 and (cuda_compiler_version or "").startswith("11")]
sha256: 7de7c1eb91f31a205c7526d2b5ee992560af0340f1a8a0e12b74f6c7d4259dc0 # [aarch64 and (cuda_compiler_version or "").startswith("12")]

- url: https://developer.download.nvidia.com/compute/cuquantum/redist/cuquantum/linux-ppc64le/cuquantum-linux-ppc64le-{{ version }}-archive.tar.xz # [ppc64le]
sha256: 5b4dc4d8d86332f4e988bcb46214a291f2c4058f9a46e36bfa617dc4026a28e7 # [ppc64le]
- url: https://developer.download.nvidia.com/compute/cuquantum/redist/cuquantum/linux-ppc64le/cuquantum-linux-ppc64le-{{ version }}_cuda{{ cuda_major }}-archive.tar.xz # [ppc64le]
sha256: ff180a0aae5da68ad01f613124849350f24d2713c9460412ce675200cf048b41 # [ppc64le and (cuda_compiler_version or "").startswith("11")]
sha256: 6df174b3a84f54c6bf5cb77a1812f980b42fa238a01ae66b7d4d65137826cdfd # [ppc64le and (cuda_compiler_version or "").startswith("12")]

- url: https://github.com/NVIDIA/cuQuantum/archive/refs/tags/v{{ ".".join(version.split(".")[:3]) }}.tar.gz
sha256: 9ec936b7a730c9ee1651f8df3f5d720c7ab1a951e91aef65f7c81b027e52ec9f
sha256: 0c819a21d0dfc158d19c44f999d2caeb19a9f4567baa0e77d712a83315c039e8

build:
number: {{ build_num }}
skip: true # [not linux or cuda_compiler_version not in ("11.2", "12.0") or ((aarch64 or ppc64le) and cuda_compiler_version == "12.0")]
skip: true # [not linux or cuda_compiler_version not in ("11.2", "12.0") or ((aarch64 or ppc64le) and (cuda_compiler_version or "").startswith("12"))]

outputs:

Expand All @@ -69,7 +72,7 @@ outputs:
- mkdir -p $PREFIX/include # [linux]
- mv include/custatevec.h $PREFIX/include/ # [linux]
- mkdir -p $PREFIX/lib # [linux]
- mv lib/{{ cuda_major }}/libcustatevec.so* $PREFIX/lib/ # [linux]
- mv lib/libcustatevec.so* $PREFIX/lib/ # [linux]

# Patch for conda-forge:
# According to the CUDA support matrix, we require glibc 2.27+ on aarch64-sbsa
Expand All @@ -82,8 +85,8 @@ outputs:
ignore_run_exports_from:
- {{ compiler('cuda') }}
missing_dso_whitelist:
- '*/libcublas.so*' # [cuda_compiler_version == "11.2"]
- '*/libcublasLt.so*' # [cuda_compiler_version == "11.2"]
- '*/libcublas.so*' # [(cuda_compiler_version or "").startswith("11")]
- '*/libcublasLt.so*' # [(cuda_compiler_version or "").startswith("11")]
post-link: post-link # this is supported by conda-build, but undocumented
requirements:
build:
Expand All @@ -94,11 +97,11 @@ outputs:
host:
# https://github.com/NixOS/patchelf/issues/492
- patchelf !=0.18
- libcublas # [cuda_compiler_version == "12.0"]
- libcublas # [(cuda_compiler_version or "").startswith("12")]
- cuda-version {{ cuda_major }}.0
run:
- cudatoolkit # [cuda_compiler_version == "11.2"]
- {{ pin_compatible('libcublas', max_pin='x') }} # [cuda_compiler_version == "12.0"]
- cudatoolkit # [(cuda_compiler_version or "").startswith("11")]
- {{ pin_compatible('libcublas', max_pin='x') }} # [(cuda_compiler_version or "").startswith("12")]
- {{ pin_compatible('cuda-version', max_pin='x') }}
# apparently conda-build supports full test section spec, the document is super outdated
test:
Expand Down Expand Up @@ -142,11 +145,11 @@ outputs:
- mkdir -p $PREFIX/include # [linux]
- mv include/cutensornet* $PREFIX/include/ # [linux]
- mkdir -p $PREFIX/lib # [linux]
- mv lib/{{ cuda_major }}/libcutensornet.so* $PREFIX/lib/ # [linux]
- mv lib/libcutensornet.so* $PREFIX/lib/ # [linux]

# build the wrapper lib
- $GCC -shared -std=c11 -fPIC -I$CUDA_PATH/include -I$PREFIX/include distributed_interfaces/cutensornet_distributed_interface_mpi.c -L$PREFIX/lib -lmpi -o $PREFIX/lib/libcutensornet_distributed_interface_mpi.so # [mpi != 'nompi' and cuda_compiler_version == "11.2"]
- $GCC -shared -std=c11 -fPIC $CFLAGS -I$PREFIX/include distributed_interfaces/cutensornet_distributed_interface_mpi.c -L$PREFIX/lib -lmpi -o $PREFIX/lib/libcutensornet_distributed_interface_mpi.so # [mpi != 'nompi' and cuda_compiler_version == "12.0"]
- $GCC -shared -std=c11 -fPIC -I$CUDA_PATH/include -I$PREFIX/include distributed_interfaces/cutensornet_distributed_interface_mpi.c -L$PREFIX/lib -lmpi -o $PREFIX/lib/libcutensornet_distributed_interface_mpi.so # [mpi != 'nompi' and (cuda_compiler_version or "").startswith("11")]
- $GCC -shared -std=c11 -fPIC $CFLAGS -I$PREFIX/include distributed_interfaces/cutensornet_distributed_interface_mpi.c -L$PREFIX/lib -lmpi -o $PREFIX/lib/libcutensornet_distributed_interface_mpi.so # [mpi != 'nompi' and (cuda_compiler_version or "").startswith("12")]
# copy activate/deactivate scripts
- mkdir -p "${PREFIX}/etc/conda/activate.d" # [mpi != 'nompi']
- cp "${RECIPE_DIR}/cutn-activate.sh" "${PREFIX}/etc/conda/activate.d/cutn-activate.sh" # [mpi != 'nompi']
Expand All @@ -157,10 +160,10 @@ outputs:
ignore_run_exports_from:
- {{ compiler('cuda') }}
missing_dso_whitelist:
- '*/libcutensor.so*' # [cuda_compiler_version == "11.2"]
- '*/libcublas.so*' # [cuda_compiler_version == "11.2"]
- '*/libcublasLt.so*' # [cuda_compiler_version == "11.2"]
- '*/libcusolver.so*' # [cuda_compiler_version == "11.2"]
- '*/libcutensor.so*' # [(cuda_compiler_version or "").startswith("11")]
- '*/libcublas.so*' # [(cuda_compiler_version or "").startswith("11")]
- '*/libcublasLt.so*' # [(cuda_compiler_version or "").startswith("11")]
- '*/libcusolver.so*' # [(cuda_compiler_version or "").startswith("11")]
post-link: post-link # this is supported by conda-build, but undocumented
requirements:
build:
Expand All @@ -173,13 +176,13 @@ outputs:
- patchelf !=0.18
- {{ mpi }} # [mpi != 'nompi']
- cutensor
- libcublas # [cuda_compiler_version == "12.0"]
- libcusolver # [cuda_compiler_version == "12.0"]
- libcublas # [(cuda_compiler_version or "").startswith("12")]
- libcusolver # [(cuda_compiler_version or "").startswith("12")]
- cuda-version {{ cuda_major }}.0
run:
- {{ pin_compatible('cutensor', max_pin='x') }}
- {{ pin_compatible('libcublas', max_pin='x') }} # [cuda_compiler_version == "12.0"]
- {{ pin_compatible('libcusolver', max_pin='x') }} # [cuda_compiler_version == "12.0"]
- {{ pin_compatible('libcublas', max_pin='x') }} # [(cuda_compiler_version or "").startswith("12")]
- {{ pin_compatible('libcusolver', max_pin='x') }} # [(cuda_compiler_version or "").startswith("12")]
- {{ pin_compatible('cuda-version', max_pin='x') }}
# conda-forge mpich does not support CUDA...
- {{ mpi }} * external* # [mpi == 'mpich']
Expand Down Expand Up @@ -232,15 +235,15 @@ outputs:
number: {{ build_num }}
# build cuQuantum Python in a CUDA agnostic way to serve both CUDA 11/12
# (note: this would still use cuda_compiler_version to calculate hash)
skip: true # [not (cuda_compiler_version or "").startswith("11")]
skip: true # [not (cuda_compiler_version or "").startswith("11") or (py < 39)]
script_env:
- CUQUANTUM_ROOT=$PREFIX
- CUTENSOR_ROOT=$PREFIX
script:
# The CUDA 11 docker image sets CUDA_PATH for us
- export CUDA_PATH=$BUILD_PREFIX/targets/x86_64-linux/ # [linux64 and cuda_compiler_version == "12.0"]
- export CUDA_PATH=$BUILD_PREFIX/targets/sbsa-linux/ # [aarch64 and cuda_compiler_version == "12.0"]
- export CUDA_PATH=$BUILD_PREFIX/targets/ppc64le-linux/ # [ppc64le and cuda_compiler_version == "12.0"]
- export CUDA_PATH=$BUILD_PREFIX/targets/x86_64-linux/ # [linux64 and (cuda_compiler_version or "").startswith("12")]
- export CUDA_PATH=$BUILD_PREFIX/targets/sbsa-linux/ # [aarch64 and (cuda_compiler_version or "").startswith("12")]
- export CUDA_PATH=$BUILD_PREFIX/targets/ppc64le-linux/ # [ppc64le and (cuda_compiler_version or "").startswith("12")]
- cd python
# {{ PYTHON }} is not resolved properly in multi-output recipes...
- $PREFIX/bin/python -m pip install --no-deps --no-build-isolation -vv .
Expand All @@ -266,17 +269,17 @@ outputs:
- cupy >=9.5
- {{ pin_subpackage('custatevec', max_pin='x') }}
- {{ pin_subpackage('cutensornet', max_pin='x') }}
- cuda-version >=11.0.*,<13.a0
- cuda-version >=11.0.*,<13.a0 # again, cuQuantum Python is "CUDA agnostic"
run_constrained:
- pytorch >=1.10
- mpi4py >=3.1.0
# we don't have to pin Qiskit or Cirq here because their versions are fairly recent on conda-forge
test:
requires:
- cuda-driver-dev # [linux and cuda_compiler_version == "12.0"]
- cuda-driver-dev # [linux and (cuda_compiler_version or "").startswith("12")]
commands:
# perform the import test via CLI because we need to load the stub for CUDA 12
- export CUDA_STUB="$PREFIX/lib/stubs/libcuda.so" # [cuda_compiler_version == "12.0"]
- export CUDA_STUB="$PREFIX/lib/stubs/libcuda.so" # [(cuda_compiler_version or "").startswith("12")]
- LD_PRELOAD="$CUDA_STUB" python -c "import cuquantum"
- LD_PRELOAD="$CUDA_STUB" python -c "import cuquantum.custatevec"
- LD_PRELOAD="$CUDA_STUB" python -c "import cuquantum.cutensornet"
Expand Down

0 comments on commit ff2572f

Please sign in to comment.