ROCm / rocALUTION

Next generation library for iterative sparse solvers for ROCm platform
https://rocm.docs.amd.com/projects/rocALUTION/en/latest/
MIT License
74 stars 38 forks source link
cplusplus cuda fortran mpi opencl openmp solver sparse

rocALUTION

rocALUTION is a sparse linear algebra library that can be used to explore fine-grained parallelism on top of the ROCm platform runtime and toolchains. Based on C++ and HIP, rocALUTION provides a portable, generic, and flexible design that allows seamless integration with other scientific software packages.

rocALUTION offers various backends for different (parallel) hardware:

Requirements

To use rocALUTION on GPU devices, you must first install the rocBLAS, rocSPARSE, and rocRAND libraries. You can install these from the ROCm repository, the GitHub 'releases' tab, or you can manually compile them.

Documentation

Documentation for rocALUTION is available at https://rocm.docs.amd.com/projects/rocALUTION/en/latest/.

To build our documentation locally, use the following code:

cd docs

pip3 install -r sphinx/requirements.txt

python3 -m sphinx -T -E -b html -d _build/doctrees -D language=en . _build/html

Build

You can compile rocALUTION using CMake 3.5 or later. Note that all compiler specifications are determined automatically.

# Clone rocALUTION using git
git clone https://github.com/ROCm/rocALUTION.git

# Go to rocALUTION directory, create and change to build directory
cd rocALUTION; mkdir build; cd build

# Configure rocALUTION
# Build options:
#   SUPPORT_HIP         - build rocALUTION with HIP support (ON)
#   SUPPORT_OMP         - build rocALUTION with OpenMP support (ON)
#   SUPPORT_MPI         - build rocALUTION with MPI (multi-node) support (OFF)
#   BUILD_SHARED_LIBS   - build rocALUTION as shared library (ON, recommended)
#   BUILD_EXAMPLES      - build rocALUTION examples (ON)
cmake .. -DSUPPORT_HIP=ON -DROCM_PATH=/opt/rocm/

# Build
make

To test your installation, run a CG solver on a Laplacian matrix:

cd rocALUTION; cd build
wget ftp://math.nist.gov/pub/MatrixMarket2/Harwell-Boeing/laplace/gr_30_30.mtx.gz
gzip -d gr_30_30.mtx.gz
./clients/staging/cg gr_30_30.mtx

General information

rocALUTION is based on a generic and robust design that allows expansion in the direction of new solvers and preconditioners with support for various hardware types. The library's design allows the use of all solvers as preconditioners in other solvers. For example, you can define a CG solver with a multi-elimination preconditioner, in which the last-block is preconditioned with another Chebyshev iteration method that itself is preconditioned with a multi-colored symmetric Gauss-Seidel scheme.

Iterative solvers

Preconditioners

Sparse matrix formats

Portability

All code based on rocALUTION is portable and hardware-independent. It compiles and runs on any supported platform. All solvers and preconditioners are based on a single source code implementation that delivers portable results across all backends (note that variations are possible due to different hardware rounding modes). The only visible difference between hardware is performance variation.