Overview

MOFA training can be massively speed up by using GPUs. We have implemented all computations using CuPy, an open-source array library for GPU-accelerated computing with Python.

GPU training can be accessed from R via the training options gpu_mode and gpu_device. For this basilisk needs to be disabled, and reticulate needs to point to a python environment with CuPy.

Installation

To use GPU need to make sure that you have a functional NVIDIA GPU with the right version of CUDA and CuPy installed. Please check the CuPy installation instructions

Docker file

Frederik Ziebell kindly prepared a Dockerfile, available here. If you try it please leave your feedback in the github issue.

Conda environment

First, create a file called mofa_conda_env_gpu.yml with the following content

name: mofa_env_gpu
channels:
  - conda-forge
dependencies:
  - cupy
  - cudatoolkit=11.0 # note that you might have to change this depending on your desired cuda version
  - dtw-python
  - pip
  - pip:
    - mofapy2==0.6.7

and then run:

conda env create --file mofa_conda_env_gpu.yml

Basic example

We provide some simple scripts to test whether your GPU set up is working: