Installing MONAI Model Zoo on ROCm#
2026-09-29
2 min read time
MONAI Model Zoo on ROCm installation requires MONAI on ROCm.
Install MONAI on ROCm.
Clone the AMD monai-model-zoo repository.
The AMD ROCm overlay files are in the AMD monai-model-zoo repository.
git clone https://github.com/AMD-Ecosystem/monai-model-zoo cd monai-model-zoo
Download a bundle from the MONAI model registry.
Replace
bundle_namewith the bundle you want to download, for examplevista3d.python -m monai.bundle download bundle_name \ --bundle_dir models/
Set the MIOpen and TorchInductor environment variables. The overlays rely on TorchInductor autotuning and the channels-last MIOpen path.
export PYTORCH_MIOPEN_SUGGEST_NHWC=1 export MIOPEN_FIND_MODE=1 export MIOPEN_FIND_ENFORCE=4 export TORCHINDUCTOR_MAX_AUTOTUNE=1 export TORCHINDUCTOR_MAX_AUTOTUNE_GEMM=1 export TORCHINDUCTOR_COORDINATE_DESCENT_TUNING=1 export TORCHINDUCTOR_EPILOGUE_FUSION=1 export TORCHINDUCTOR_MAX_AUTOTUNE_CONV_BACKENDS=ATEN,TRITON
Change directory to the bundle directory. Bundles load custom code from the bundle’s
scripts/package. This package must be on the Python path when the configuration is initialized.cd models/bundle_name
Run inference with the ROCm overlay.
Before running inference, prepare your input data. Refer to the
docs/directory inside the bundle for the expected input format.Pass the base inference configuration and the AMD ROCm overlay as a JSON list. The overlay merges into the base configuration at load time.
--dataset_dirand--output_dirare resolved relative to the bundle directory. Use absolute paths to avoid ambiguity, for example--dataset_dir /path/to/input_dir.python -m monai.bundle run \ --config_file "['configs/inference.json', \ 'configs/inference_rocm.json']" \ --bundle_root . \ --dataset_dir /path/to/input_dir \ --output_dir /path/to/output_dir
Note
Configuration files can be in either JSON or YAML format, depending on the bundle. The input key varies by bundle — for example,
vista3duses--input_dict. Refer to thedocs/directory inside the bundle for input format details. For information about overlay keys, see ROCm overlays. For information about overlay paths and configuration format, see Validated bundles.