Installing MALA

Prerequisites

MALA supports any Python version starting from 3.10.4. No upper limit on Python versions are enforced. The most recent tested version is 3.10.12.

Installing the Python library

MALA requires torch (https://pytorch.org). We install the latest GPU-enabled version (see requirements.txt), unless you have torch already installed (for example a version that supports AMD’s ROCm a specific CUDA version).

To install the MALA package

  • Download the MALA repository, e.g., with git clone git@github.com:mala-project/mala.git

  • Change into the directory you cloned the repository to

  • Install MALA via pip install -e .[options]

The following options are available:

  • dev: Installs bump2version which is needed to correctly increment the version and thus needed for large code development (developers)

  • opt: Installs oapackage, so that the orthogonal array method may be used for large scale hyperparameter optimization (advanced users)

  • mpi: Installs mpi4py for MPI parallelization (advanced users)

  • test: Installs pytest which allows users to test the code (developers)

  • doc: Installs all dependencies for building the documentary locally (developers)

Build documentation locally (Optional)

  • Install the prerequisites (if you haven’t already during the MALA setup) via pip install -r docs/requirements.txt

  • Change into docs/ folder.

  • Run make apidocs on Linux/macOS or .\make.bat apidocs on Windows.

  • Run make html on Linux/macOS or .\make.bat html on Windows. This creates a _build folder inside docs. You may also want to use make html SPHINXOPTS="-W" sometimes. This treats warnings as errors and stops the output at first occurence of an error (useful for debugging rST syntax).

  • Open docs/_build/html/index.html.

  • Run make clean on Linux/macOS or .\make.bat clean on Windows. if required (e.g. after fixing erros) and building again