MIGraphX examples#

2026-10-12

3 min read time

Applies to Linux

The MIGraphX repository includes examples for common inference workflows. Each example below is documented in its README file. Follow the linked path in the MIGraphX GitHub repository to build and run the example.

Getting started examples#

These examples teach core MIGraphX workflows. Start here if you are new to the library.

Example

Target user

What it demonstrates

Parse, load, and save a model

C++ application developers

Parse ONNX models, inspect graphs, and save or load programs in MessagePack or JSON format.

cpp_mnist

C++ application developers

End-to-end inference: parse ONNX, compile for GPU or CPU, quantize, prepare inputs, and evaluate.

migraphx_driver

Model integrators

Command-line usage of migraphx-driver for read, compile, run, verify, and perf without writing code.

MIGraphX API examples#

Examples under examples/migraphx/ cover MIGraphX-specific utilities and advanced C++ API usage.

Example

Target user

What it demonstrates

cpp_parse_load_save

C++ application developers

Parse, load, and save graph programs.

cpp_dynamic_batch

C++ application developers

Run programs with dynamic batch sizes using dynamic_dimension objects.

cpp_trace_callback

MIGraphX contributors and debuggers

Inspect operator output buffers during evaluation with program::run_trace.

export_frozen_graph_tf1

Model integrators

Export frozen TensorFlow 1 graphs for MIGraphX ingestion.

export_frozen_graph_tf2

Model integrators

Export frozen TensorFlow 2 graphs for MIGraphX ingestion.

Vision examples#

Examples under examples/vision/ cover image classification, detection, segmentation, and super resolution.

Example

Target user

What it demonstrates

cpp_mnist

C++ application developers

MNIST digit classification with the C++ API.

python_resnet50

Python application developers

ResNet50 V2 inference in Python via a Jupyter notebook.

python_nfnet

Python application developers

NFNet inference and ONNX Runtime comparison.

python_super_resolution

Python application developers

Super resolution inference.

python_unet

Python application developers

U-Net segmentation inference.

python_3dunet

Python application developers

3D U-Net inference.

python_yolov4

Python application developers

YOLOv4 object detection inference.

python_yolo26

Python application developers

YOLO26 object detection inference.

Natural language processing examples#

Examples under examples/nlp/ cover question answering and speech recognition.

Example

Target user

What it demonstrates

python_bert_squad

Python application developers

BERT question answering on SQuAD.

python_rnnt

Python application developers

RNN-T speech recognition inference.

Diffusion examples#

Examples under examples/diffusion/ cover text-to-image diffusion models.

Example

Target user

What it demonstrates

python_stable_diffusion_21

Python application developers

Stable Diffusion 2.1 text-to-image inference.

python_stable_diffusion_xl

Python application developers

Stable Diffusion XL text-to-image inference.

python_stable_diffusion_3

Python application developers

Stable Diffusion 3 text-to-image inference.

python_flux

Python application developers

Flux text-to-image inference.

python_controlnet_canny_sd_15

Python application developers

ControlNet Canny edge guidance with Stable Diffusion 1.5.

Transformer examples#

Examples under examples/transformers/ cover large language model and speech model inference.

Example

Target user

What it demonstrates

python_llama2

Python application developers

Llama 2 inference.

python_whisper

Python application developers

Whisper automatic speech recognition.

ONNX Runtime examples#

Examples under examples/onnxruntime/ show MIGraphX integration through the ONNX Runtime execution provider.

Example

Target user

What it demonstrates

resnet50

ONNX Runtime users

ResNet50 inference through ONNX Runtime with the MIGraphX execution provider.

inceptionV3

ONNX Runtime users

InceptionV3 inference through ONNX Runtime with the MIGraphX execution provider.

See also#