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 --helpCompile an ONNX model for AMD GPU:
migraphx-driver compile model.onnx --gpuRun once with generated inputs:
migraphx-driver run model.onnx --gpuBenchmark:
migraphx-driver perf model.onnx --gpuSave A Compiled Program
migraphx-driver compile model.onnx --gpu --save model.mxrUse the saved program later:
migraphx-driver run model.mxr
migraphx-driver perf model.mxrThe 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 --gpuIf 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 runsKeep this checklist in CI when models are part of your repository or release artifact.