driver.rst 2.39 KB
Newer Older
1
2
3
MIGraphX Driver
===============

Charlie Lin's avatar
Charlie Lin committed
4
5
The MIGraphX driver is a tool that allows you to utilize many of the core functions of MIGraphX without having to write your own program. It can read, compile, run, and test the performance of a model with randomized data.

6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
read
----

.. program:: migraphx-driver read

Loads and prints input graph.

.. include:: ./driver/read.rst

compile
-------

.. program:: migraphx-driver compile

Compiles and prints input graph.

Charlie Lin's avatar
Charlie Lin committed
22
.. include:: ./driver/read.rst
23
24
25
26
27
28
29
30
31
.. include:: ./driver/compile.rst

run
---

.. program:: migraphx-driver run

Loads and prints input graph.

Charlie Lin's avatar
Charlie Lin committed
32
.. include:: ./driver/read.rst
33
34
35
36
37
38
39
40
41
.. include:: ./driver/compile.rst

perf
----

.. program:: migraphx-driver perf

Compiles and runs input graph then prints performance report.

Charlie Lin's avatar
Charlie Lin committed
42
.. include:: ./driver/read.rst
43
44
45
46
47
48
49
50
51
52
53
54
55
.. include:: ./driver/compile.rst

.. option::  --iterations, -n [unsigned int]

Number of iterations to run for perf report (Default: 100)

verify
------

.. program:: migraphx-driver verify

Runs reference and CPU or GPU implementations and checks outputs for consistency.

Charlie Lin's avatar
Charlie Lin committed
56
.. include:: ./driver/read.rst
57
58
.. include:: ./driver/compile.rst

59
.. option::  --rms-tol [double]
60

61
62
63
64
65
66
67
68
69
Tolerance for RMS error (Default: 0.001)

.. option::  --atol [double]

Tolerance for elementwise absolute difference (Default: 0.001)

.. option::  --rtol [double]

Tolerance for elementwise relative difference (Default: 0.001)
70
71
72
73
74
75
76
77

.. option::  -i, --per-instruction

Verify each instruction

.. option::  -r, --reduce

Reduce program and verify
78
79

roctx
Charlie Lin's avatar
Charlie Lin committed
80
-----
81
82
83
84
85
86
87
88
89
90
91
92
93
94

.. program:: migraphx-driver roctx

Provides marker information for each operation, allowing MIGraphX to be used with `rocprof <https://rocmdocs.amd.com/en/latest/ROCm_Tools/ROCm-Tools.html>`_ for performance analysis.
This allows user to get GPU-level kernel timing information.
An example command line combined with rocprof for tracing purposes is given below:

.. code-block:: bash

    /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>

After `rocprof` is run, the output directory will contain trace information for HIP, HCC and ROCTX in seperate `.txt` files.
To understand the interactions between API calls, it is recommended to utilize `roctx.py` helper script as desribed in :ref:`dev/tools:rocTX` section. 

Charlie Lin's avatar
Charlie Lin committed
95
96
.. include:: ./driver/read.rst
.. include:: ./driver/compile.rst