NVIDIA / cuda-quantum

C++ and Python support for the CUDA Quantum programming model for heterogeneous quantum-classical workflows
https://nvidia.github.io/cuda-quantum/
Other
568 stars 192 forks source link

Including cupy in the latest-hpc image #690

Open poojarao8 opened 1 year ago

poojarao8 commented 1 year ago

A lot of applications require using a linear system solve (using cupy) to create the initial quantum state. On systems like NERSC, it's hard to install anything new in the container as you are creating a new instance for every run. Since cupy is a scalable gpu enabled library, it would be great to have it latest-hpc image.

zohimchandani commented 10 months ago

I would also like to see this please

1tnguyen commented 4 months ago

cupy can be installed in user-mode (--user) inside the container. On systems like NERSC, the installed package is mounted to user's directory, thus will be persisted between container launches.

Note: always install the prebuilt cupy wheel for a particular CUDA version (cupy-cuda11x) since the CUDA-Q docker image doesn't have all the dependencies to build cupy from source.

Reproduce steps for NERSC:

shifter --image=docker:nvcr.io/nvidia/nightly/cuda-quantum:latest --module=cuda-mpich /bin/bash
python3 -m pip install cupy-cuda11x --user
import cupy
print(cupy.cuda.runtime.getDeviceCount())