MIGraphX Field Guide

MIGraphX Driver

Use migraphx-driver to inspect, compile, verify, run, and benchmark models before writing application code.

migraphx-driver is the first tool to use when integrating a new model. If the driver cannot parse, compile, or run the model, application code will not fix the underlying compatibility issue.

Basic Commands

Show help:

migraphx-driver --help

Compile an ONNX model for AMD GPU:

migraphx-driver compile model.onnx --gpu

Run once with generated inputs:

migraphx-driver run model.onnx --gpu

Benchmark:

migraphx-driver perf model.onnx --gpu

Save A Compiled Program

migraphx-driver compile model.onnx --gpu --save model.mxr

Use the saved program later:

migraphx-driver run model.mxr
migraphx-driver perf model.mxr

The saved file is the deployment artifact you can produce in CI or during a model build step.

Verify A Model

Use verification when comparing targets or checking whether an optimization changed outputs:

migraphx-driver verify model.onnx --gpu

If verification fails, check:

  • unsupported or partially supported ONNX operators
  • dynamic output shapes
  • precision differences from FP16 or other fast math modes
  • preprocessing mismatch between generated and real inputs

Shape Discipline

For image models, keep shapes explicit. A common YOLO-style input is:

images: [batch, 3, 640, 640]

If your ONNX model uses dynamic dimensions, compile with the batch and spatial shapes you will actually serve. Recompiling for every observed shape defeats the purpose of a compiled runtime.

Suggested Model Gate

Before adding a model to an application, record:

1. parse succeeds
2. compile succeeds on gpu
3. verify succeeds or numerical tolerance is accepted
4. perf result is recorded
5. output shape matches postprocess expectations
6. saved program loads and runs

Keep this checklist in CI when models are part of your repository or release artifact.

On this page