Including cupy in the latest-hpc image
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.
I would also like to see this please
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:
- One time installation
shifter --image=docker:nvcr.io/nvidia/nightly/cuda-quantum:latest --module=cuda-mpich /bin/bash
python3 -m pip install cupy-cuda11x --user
- Check package persistent: exit shifter then relaunch; cupy should still be available, e.g., the below Python script should work.
import cupy
print(cupy.cuda.runtime.getDeviceCount())