Install MORI
Use a ROCm environment with Python 3.10 or later and a matching ROCm build of
PyTorch for tensor-based examples. Choose either the stable or nightly package;
both provide the mori import and must not be installed together.
The installation instructions below are included from the repository README so package choices, system dependencies and fabric checks stay consistent.
Installation
Prerequisites
ROCm >= 6.4 (hipcc needed at runtime for JIT kernel compilation, not at install time)
System packages (required for
pip install; not bundled in wheels). On Debian/Ubuntu install at least:libpci-devlibibverbs-dev,ibverbs-utilsSee docker/Dockerfile.dev for the full apt list used in CI/dev images.
Optional:
libopenmpi-dev,openmpi-bin— only needed when building C++ examples (BUILD_EXAMPLES=ON) or enabling MPI bootstrap (MORI_WITH_MPI=ON)
Or build docker image with:
cd mori && docker build -t rocm/mori:dev -f docker/Dockerfile.dev .
IBGDA NIC support (optional, for GPU-direct RDMA — auto-detected, no manual configuration needed):
NIC |
User library |
|---|---|
AMD Pollara (AINIC) |
|
Mellanox ConnectX |
|
Broadcom Thor2 |
|
Note: IBGDA requires vendor-specific DV (Direct Verbs) libraries. Mellanox
libmlx5is typically pre-installed with the kernel OFED stack. For Thor2 and Pollara, install the corresponding userspace library from your NIC vendor.
Recommended NIC firmware/driver versions (check with mori check or tools/env_check.sh):
Vendor |
Recommendation |
|---|---|
AMD Pollara (AINIC) |
|
Broadcom (Thor2) |
|
Mellanox (ConnectX, mlx5) |
No known minimum; tested on |
Validate the environment
Before a cross-node run, check the fabric:
mori check <peer_ip> # or: tools/env_check.sh <peer_ip>
Six steps — NIC firmware and driver, QoS/PFC, DCQCN, then intra-node, inter-node bandwidth and latency meshes over every NIC pair, on host memory and on GPU memory. Exits non-zero if any check failed, and reports the fabric topology, which decides what can run on it.
Install
MoRI can be installed in three ways: from PyPI (stable), nightly pre-built wheels (latest dev), or from source.
From PyPI (stable release)
pip install amd_mori
Nightly (pre-built, tested daily)
pip install --pre amd-mori-nightly
Deprecated: the GitHub Pages nightly index (
https://rocm.github.io/mori/nightly/) is being retired. Please install nightly builds from PyPI (amd-mori-nightly) as shown above.
Note:
amd-moriandamd-mori-nightlyboth provide themoriPython module. Do not install both at the same time — uninstall one before installing the other.
From source
git clone --recursive https://github.com/ROCm/mori.git
cd mori
# NOTE: for venv build, add --no-build-isolation at the end
pip install .
No hipcc needed at install time — host code compiles with a standard
C++ compiler. GPU kernels are JIT-compiled on first use and cached to
~/.mori/jit/. If a GPU is detected during install, kernel precompilation
starts automatically in the background.
To manually precompile all kernels (e.g. in a Docker image build):
MORI_PRECOMPILE=1 python -c "import mori"
Verify installation
python -c "import mori; print(mori.__version__)"
Optional FlyDSL integration
The FlyDSL device API is optional. To install it with the stable MORI package:
pip install 'amd_mori[flydsl]'
The optional dependency is not version-pinned by MORI. When using MORI in a framework image, preserve that image’s tested FlyDSL version rather than upgrading the compiler independently. See EP backends for paths that require FlyDSL and paths that can run with HIP alone.
Next steps
Quickstart provides runnable checks and API sketches.
EP backends explains API and backend selection.
CCO guide describes communicator setup and transports.