After my last post on Macs and CUDA I was sent a link to CuPy which is a library that is supported by NVIDIA that allows to easily run CUDA code in Python using NumPy arrays as input.
CuPy's interface is highly compatible with NumPy; in most cases it can be used as a drop-in replacement. All you need to do is just replace numpy with cupy in your Python code. It supports various methods, indexing, data types, broadcasting and more.
pip install cupy
The latest version of cuDNN and NCCL libraries are included in binary packages (wheels). For the source package, you will need to install cuDNN/NCCL before installing CuPy, if you want to use it.
Or you can install versions specific to the particular CUDA environment. Full details are on GitHub https://github.com/cupy/cupy.
One of the highlights for me at the recent 2nd RSC-BMCS / RSC-CICAG Artificial Intelligence in Chemistry in Cambridge was the work of Adrian Roitberg and Olexandr Isayev et al on Approaching coupled cluster accuracy with a general-purpose neural network potential through transfer learning DOI.
Here we train a general-purpose neural network potential (ANI- 1ccx) that approaches CCSD(T)/CBS accuracy on benchmarks for reaction thermochemistry, isomerization, and drug-like molecular torsions. This is achieved by training a network to DFT data then using transfer learning techniques to retrain on a dataset of gold standard QM calculations (CCSD(T)/CBS) that optimally spans chemical space. The resulting potential is broadly applicable to materials science, biology, and chemistry, and billions of times faster than CCSD(T)/CBS calculations.
The presentation was really compelling and really looks like an example where AI can be truly transformational. The good news is the code is all freely available on Github https://github.com/isayev/ASE_ANI, the bad news is that it "Works only under Ubuntu variants of Linux with a NVIDIA GPU" and Python binaries built for python 3.6 and CUDA 9.2.
In the past I would have stopped there but with the increasing number of external GPU and a NVIDIA CUDA Installation Guide for Mac OS X I'm wondering if there might be a path forward. I'd be very interested to hear about experiences with external GPU with NVIDIA graphics cards and using the CUDA toolkit on a Mac.
Olexandr emailed me to to mention they have a pure Python version https://github.com/aiqm/torchani this will run on Mac however there is no GPU acceleration.
TorchANI is a pytorch implementation of ANI. It is currently under alpha release, which means, the API is not stable yet. If you find a bug of TorchANI, or have some feature request, feel free to open an issue on GitHub, or send us a pull requests
Also stumbled across the paper
Ab-Initio Solution of the Many-Electron Schrödinger Equation with Deep Neural Networks https://arxiv.org/abs/1909.02487Arxiv