ROCm overlays#
2026-09-01
2 min read time
A ROCm overlay is a MONAI Bundle configuration file that AMD ships next to an upstream inference config. The overlay adds or overrides selected keys at load time. Model weights aren’t modified. Only the runtime execution path is adapted for ROCm.
Layered configuration#
MONAI Bundle supports layered configuration. A base inference.json or inference.yaml file provides the complete model definition. An overlay file adds or overrides specific keys when you run inference.
Pass the base file and the overlay together in --config_file as a JSON list. The overlay merges into the base config at load time. Upstream files on disk aren’t changed.
python -m monai.bundle run \
--config_file "['models/bundle_name/configs/inference.json', \
'models/bundle_name/configs/inference_rocm.json']" \
--bundle_root models/bundle_name
Replace bundle_name with a validated bundle directory name. Use .yaml for both paths when the bundle’s upstream inference config is YAML. Among the validated bundles, only pancreas_ct_dints_segmentation uses YAML.
See Installation for setup steps. See Validated bundles for per-bundle overlay paths.
Overlay files#
AMD provides one overlay per validated bundle, named inference_rocm.json or inference_rocm.yaml. Each file is under models/bundle_name/configs/, next to the upstream inference config.
JSON overlays use +imports to add $import torch without replacing the upstream import list. The pancreas_ct_dints_segmentation overlay sets imports to $import torch.
Bundle-specific keys#
Some overlays set keys beyond the shared set.
Bundle |
Extra overlay keys |
|---|---|
|
Replaces |
|
Re-declares |
|
Calls |
|
Replaces |