Driver options#
2025-01-14
10 min read time
This document lists the MIGraphX driver commands along with the eligible options.
read#
Loads and prints input graph.
- <input file>#
File to load
- --test#
Test MIGraphX with single layer GEMM model
- --onnx#
Load as onnx
- --tf#
Load as tensorflow
- --migraphx#
Load as MIGraphX
- --migraphx-json#
Load as MIGraphX JSON
- --batch [unsigned int] (Default: 1)#
For a static model, set batch size. For a dynamic batch model, sets the batch size at runtime.
- --nhwc#
Treat tensorflow format as nhwc
- --skip-unknown-operators#
Skip unknown operators when parsing and continue to parse.
- --nchw#
Treat tensorflow format as nchw
- --trim, -t [unsigned int]#
Trim instructions from the end (Default: 0)
- --input-dim [std::vector<std::string>]#
Dim of a parameter (format: “@name d1 d2 dn”)
- --dyn-input-dim [std::vector<std::string>]#
Set dynamic dimensions of a parameter using JSON formatting (format “@name” “dynamic_dimension_json”)
- --default-dyn-dim#
Set the default dynamic dimension (format {min:x, max:y, optimals:[o1,o2,…]})
- --optimize, -O#
Optimize when reading
- --apply-pass, -p#
Passes to apply to model
- --graphviz, -g#
Print out a graphviz representation.
- --brief#
Make the output brief.
- --cpp#
Print out the program as cpp program.
- --json#
Print out program as json.
- --netron#
Print out program as a Netron viewable json file.
- --text#
Print out program in text format.
- --binary#
Print out program in binary format.
- --py#
Print out program using python API.
- --output, -o [std::string]#
Output to file.
compile#
Compiles and prints input graph.
- <input file>#
File to load
- --test#
Test MIGraphX with single layer GEMM model
- --onnx#
Load as onnx
- --tf#
Load as tensorflow
- --migraphx#
Load as MIGraphX
- --migraphx-json#
Load as MIGraphX JSON
- --batch [unsigned int] (Default: 1)#
For a static model, set batch size. For a dynamic batch model, sets the batch size at runtime.
- --nhwc#
Treat tensorflow format as nhwc
- --skip-unknown-operators#
Skip unknown operators when parsing and continue to parse.
- --nchw#
Treat tensorflow format as nchw
- --trim, -t [unsigned int]#
Trim instructions from the end (Default: 0)
- --input-dim [std::vector<std::string>]#
Dim of a parameter (format: “@name d1 d2 dn”)
- --dyn-input-dim [std::vector<std::string>]#
Set dynamic dimensions of a parameter using JSON formatting (format “@name” “dynamic_dimension_json”)
- --default-dyn-dim#
Set the default dynamic dimension (format {min:x, max:y, optimals:[o1,o2,…]})
- --optimize, -O#
Optimize when reading
- --apply-pass, -p#
Passes to apply to model
- --graphviz, -g#
Print out a graphviz representation.
- --brief#
Make the output brief.
- --cpp#
Print out the program as cpp program.
- --json#
Print out program as json.
- --netron#
Print out program as a Netron viewable json file.
- --text#
Print out program in text format.
- --binary#
Print out program in binary format.
- --py#
Print out program using python API.
- --output, -o [std::string]#
Output to file.
- --fill0 [std::vector<std::string>]#
Fill parameter with 0s
- --fill1 [std::vector<std::string>]#
Fill parameter with 1s
- --gpu#
Compile on the gpu
- --cpu#
Compile on the cpu
- --ref#
Compile on the reference implementation
- --enable-offload-copy#
Enable implicit offload copying
- --disable-fast-math#
Disable fast math optimization
- --exhaustive-tune#
Perform an exhaustive search to find the fastest version of generated kernels for selected backend
- --fp16#
Quantize for fp16
- --bf16#
Quantize for bf16
- --int8#
Quantize for int8
- --fp8#
Quantize for Float8E4M3FNUZ type
run#
Loads and prints input graph.
- <input file>#
File to load
- --test#
Test MIGraphX with single layer GEMM model
- --onnx#
Load as onnx
- --tf#
Load as tensorflow
- --migraphx#
Load as MIGraphX
- --migraphx-json#
Load as MIGraphX JSON
- --batch [unsigned int] (Default: 1)#
For a static model, set batch size. For a dynamic batch model, sets the batch size at runtime.
- --nhwc#
Treat tensorflow format as nhwc
- --skip-unknown-operators#
Skip unknown operators when parsing and continue to parse.
- --nchw#
Treat tensorflow format as nchw
- --trim, -t [unsigned int]#
Trim instructions from the end (Default: 0)
- --input-dim [std::vector<std::string>]#
Dim of a parameter (format: “@name d1 d2 dn”)
- --dyn-input-dim [std::vector<std::string>]#
Set dynamic dimensions of a parameter using JSON formatting (format “@name” “dynamic_dimension_json”)
- --default-dyn-dim#
Set the default dynamic dimension (format {min:x, max:y, optimals:[o1,o2,…]})
- --optimize, -O#
Optimize when reading
- --apply-pass, -p#
Passes to apply to model
- --graphviz, -g#
Print out a graphviz representation.
- --brief#
Make the output brief.
- --cpp#
Print out the program as cpp program.
- --json#
Print out program as json.
- --netron#
Print out program as a Netron viewable json file.
- --text#
Print out program in text format.
- --binary#
Print out program in binary format.
- --py#
Print out program using python API.
- --output, -o [std::string]#
Output to file.
- --fill0 [std::vector<std::string>]#
Fill parameter with 0s
- --fill1 [std::vector<std::string>]#
Fill parameter with 1s
- --gpu#
Compile on the gpu
- --cpu#
Compile on the cpu
- --ref#
Compile on the reference implementation
- --enable-offload-copy#
Enable implicit offload copying
- --disable-fast-math#
Disable fast math optimization
- --exhaustive-tune#
Perform an exhaustive search to find the fastest version of generated kernels for selected backend
- --fp16#
Quantize for fp16
- --bf16#
Quantize for bf16
- --int8#
Quantize for int8
- --fp8#
Quantize for Float8E4M3FNUZ type
perf#
Compiles and runs input graph then prints performance report.
- <input file>#
File to load
- --test#
Test MIGraphX with single layer GEMM model
- --onnx#
Load as onnx
- --tf#
Load as tensorflow
- --migraphx#
Load as MIGraphX
- --migraphx-json#
Load as MIGraphX JSON
- --batch [unsigned int] (Default: 1)#
For a static model, set batch size. For a dynamic batch model, sets the batch size at runtime.
- --nhwc#
Treat tensorflow format as nhwc
- --skip-unknown-operators#
Skip unknown operators when parsing and continue to parse.
- --nchw#
Treat tensorflow format as nchw
- --trim, -t [unsigned int]#
Trim instructions from the end (Default: 0)
- --input-dim [std::vector<std::string>]#
Dim of a parameter (format: “@name d1 d2 dn”)
- --dyn-input-dim [std::vector<std::string>]#
Set dynamic dimensions of a parameter using JSON formatting (format “@name” “dynamic_dimension_json”)
- --default-dyn-dim#
Set the default dynamic dimension (format {min:x, max:y, optimals:[o1,o2,…]})
- --optimize, -O#
Optimize when reading
- --apply-pass, -p#
Passes to apply to model
- --graphviz, -g#
Print out a graphviz representation.
- --brief#
Make the output brief.
- --cpp#
Print out the program as cpp program.
- --json#
Print out program as json.
- --netron#
Print out program as a Netron viewable json file.
- --text#
Print out program in text format.
- --binary#
Print out program in binary format.
- --py#
Print out program using python API.
- --output, -o [std::string]#
Output to file.
- --fill0 [std::vector<std::string>]#
Fill parameter with 0s
- --fill1 [std::vector<std::string>]#
Fill parameter with 1s
- --gpu#
Compile on the gpu
- --cpu#
Compile on the cpu
- --ref#
Compile on the reference implementation
- --enable-offload-copy#
Enable implicit offload copying
- --disable-fast-math#
Disable fast math optimization
- --exhaustive-tune#
Perform an exhaustive search to find the fastest version of generated kernels for selected backend
- --fp16#
Quantize for fp16
- --bf16#
Quantize for bf16
- --int8#
Quantize for int8
- --fp8#
Quantize for Float8E4M3FNUZ type
- --iterations, -n [unsigned int]#
Sets number of iterations to run for perf report (Default: 100)
verify#
Runs reference and CPU or GPU implementations and checks outputs for consistency.
- <input file>#
File to load
- --test#
Test MIGraphX with single layer GEMM model
- --onnx#
Load as onnx
- --tf#
Load as tensorflow
- --migraphx#
Load as MIGraphX
- --migraphx-json#
Load as MIGraphX JSON
- --batch [unsigned int] (Default: 1)#
For a static model, set batch size. For a dynamic batch model, sets the batch size at runtime.
- --nhwc#
Treat tensorflow format as nhwc
- --skip-unknown-operators#
Skip unknown operators when parsing and continue to parse.
- --nchw#
Treat tensorflow format as nchw
- --trim, -t [unsigned int]#
Trim instructions from the end (Default: 0)
- --input-dim [std::vector<std::string>]#
Dim of a parameter (format: “@name d1 d2 dn”)
- --dyn-input-dim [std::vector<std::string>]#
Set dynamic dimensions of a parameter using JSON formatting (format “@name” “dynamic_dimension_json”)
- --default-dyn-dim#
Set the default dynamic dimension (format {min:x, max:y, optimals:[o1,o2,…]})
- --optimize, -O#
Optimize when reading
- --apply-pass, -p#
Passes to apply to model
- --graphviz, -g#
Print out a graphviz representation.
- --brief#
Make the output brief.
- --cpp#
Print out the program as cpp program.
- --json#
Print out program as json.
- --netron#
Print out program as a Netron viewable json file.
- --text#
Print out program in text format.
- --binary#
Print out program in binary format.
- --py#
Print out program using python API.
- --output, -o [std::string]#
Output to file.
- --fill0 [std::vector<std::string>]#
Fill parameter with 0s
- --fill1 [std::vector<std::string>]#
Fill parameter with 1s
- --gpu#
Compile on the gpu
- --cpu#
Compile on the cpu
- --ref#
Compile on the reference implementation
- --enable-offload-copy#
Enable implicit offload copying
- --disable-fast-math#
Disable fast math optimization
- --exhaustive-tune#
Perform an exhaustive search to find the fastest version of generated kernels for selected backend
- --fp16#
Quantize for fp16
- --bf16#
Quantize for bf16
- --int8#
Quantize for int8
- --fp8#
Quantize for Float8E4M3FNUZ type
- --rms-tol [double]#
Sets tolerance for RMS error (Default: 0.001)
- --atol [double]#
Sets tolerance for elementwise absolute difference (Default: 0.001)
- --rtol [double]#
Sets tolerance for elementwise relative difference (Default: 0.001)
- -i, --per-instruction#
Verifies each instruction
- -r, --reduce#
Reduces program and verifies
- --ref-use-double#
Converts floating point values to double for the ref target
roctx#
roctx
provides marker information for each operation which allows MIGraphX to be used with rocprof for performance analysis.
This allows you to get GPU-level kernel timing information.
Here is how you can use roctx
combined with rocprof for tracing:
/opt/rocm/bin/rocprof --hip-trace --roctx-trace --flush-rate 1ms --timestamp on -d <OUTPUT_PATH> --obj-tracking on /opt/rocm/bin/migraphx-driver roctx <ONNX_FILE> <MIGRAPHX_OPTIONS>
Running rocprof generates trace information for HIP, HCC and ROCTX in separate .txt
files.
To understand the interactions between API calls, utilize the roctx.py helper script.
- <input file>#
File to load
- --test#
Test MIGraphX with single layer GEMM model
- --onnx#
Load as onnx
- --tf#
Load as tensorflow
- --migraphx#
Load as MIGraphX
- --migraphx-json#
Load as MIGraphX JSON
- --batch [unsigned int] (Default: 1)#
For a static model, set batch size. For a dynamic batch model, sets the batch size at runtime.
- --nhwc#
Treat tensorflow format as nhwc
- --skip-unknown-operators#
Skip unknown operators when parsing and continue to parse.
- --nchw#
Treat tensorflow format as nchw
- --trim, -t [unsigned int]#
Trim instructions from the end (Default: 0)
- --input-dim [std::vector<std::string>]#
Dim of a parameter (format: “@name d1 d2 dn”)
- --dyn-input-dim [std::vector<std::string>]#
Set dynamic dimensions of a parameter using JSON formatting (format “@name” “dynamic_dimension_json”)
- --default-dyn-dim#
Set the default dynamic dimension (format {min:x, max:y, optimals:[o1,o2,…]})
- --optimize, -O#
Optimize when reading
- --apply-pass, -p#
Passes to apply to model
- --graphviz, -g#
Print out a graphviz representation.
- --brief#
Make the output brief.
- --cpp#
Print out the program as cpp program.
- --json#
Print out program as json.
- --netron#
Print out program as a Netron viewable json file.
- --text#
Print out program in text format.
- --binary#
Print out program in binary format.
- --py#
Print out program using python API.
- --output, -o [std::string]#
Output to file.
- --fill0 [std::vector<std::string>]#
Fill parameter with 0s
- --fill1 [std::vector<std::string>]#
Fill parameter with 1s
- --gpu#
Compile on the gpu
- --cpu#
Compile on the cpu
- --ref#
Compile on the reference implementation
- --enable-offload-copy#
Enable implicit offload copying
- --disable-fast-math#
Disable fast math optimization
- --exhaustive-tune#
Perform an exhaustive search to find the fastest version of generated kernels for selected backend
- --fp16#
Quantize for fp16
- --bf16#
Quantize for bf16
- --int8#
Quantize for int8
- --fp8#
Quantize for Float8E4M3FNUZ type