CuPy is a really nice library developed by a Japanese startup and supported by NVIDIA that allows to easily run CUDA code in Python using NumPy arrays as input. It also provides interoperability with Numba (just-in-time Python compiler) and DLPackAt (tensor specification used in PyTorch, the deep learning library).
CUDA is a parallel computing platform and application programming interface that allows using GPUs for general purpose, not only graphics related computing. Just to give an idea of the level of parallelization it can be achieved with it, a not very expensive consumer's GPU like the NVIDIA GTX 1080 comes with 2560 CUDA cores.
Because at ChEMBL we love anything that makes Python fast and that is well integrated with NumPy we couldn't resist to give it a try!
Let's go through a example to see how it is working...
Google colab notebook. Colab provides the option to run notebooks in GPU and CuPy is already installed on the default Python environment :)
You will need to upgrade PyTables to 3.5.1 in the default Python environment in order to make it work.
Rendered notebook
Comments