GPU¶
Ground-state calculations on a GPU is an experimental feature at the moment:
only PW-mode
it has only been implemented in the new GPAW
only parallelization over k-points
no forces
See gpaw/test/gpu/test_pw.py for an example.
The gpaw.gpu module¶
- gpaw.gpu.cupy¶
cupy
module (orgpaw.gpu.cpupy
ifcupy
is not available)
- gpaw.gpu.cupyx¶
cupyx
module (orgpaw.gpu.cpupyx
ifcupyx
is not available)
- gpaw.gpu.is_hip = False¶
True if we are using HIP
Fake cupy library¶
The implementation uses cupy. In the code, we don’t do import cupy as cp
.
Instead we use from gpaw.gpu import cupy as cp
. This allows us to use a
fake cupy
implementation so that we can run GPAW’s cupy
code without
having a physical GPU. To enable the fake cupy
module, do:
GPAW_CPUPY=1 python ...
This allows users without a GPU to find out if their code interferes with the GPU implementation, simply by running the tests.
CuPy enabled container objects¶
The following objects:
can have their data (.data
attribute) stored in a cupy.ndarray
array instead of, as normal, a numpy.ndarray
array. In additions,
these objects now have an xp
attribute that can be numpy
or
cupy
.
Also, the AtomCenteredFunctions
object can do its operations on the GPU.
GPU-aware MPI¶
Use a GPU-aware MPI implementation and set the GPAW_GPU
when compiling
GPAW’s C-extension.
- GPAW_GPU¶
Add support for passing
cupy.ndarray
objects to MPI