You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Benchgc is a tool used to verify the correctness and performance of graph compiler. Benchgc accepts MLIR files based on the OneDNN graph dialect as test cases and prepares test data for them. For correctness verification, Benchgc will use PyTorch as a reference for comparison.
5
+
Benchgc is a tool used to verify the correctness and performance of graph compiler. Benchgc accepts MLIR files as test cases and prepares test data for them. For correctness verification, Benchgc will use PyTorch as a reference for comparison.
6
6
7
7
## Prerequisite
8
8
* python >= 3.10
9
9
* torch >= 2.2
10
-
*pybind11
10
+
*Enable mlir python binding, Refer to [`python/README.md`](../../python/README.md) for detail
* if driver=pattern, please provide the pre-defined pattern name, such as mlp here
39
54
* if driver is a dialect name, please provide the detail op name to start a single op test
40
55
56
+
### --entry [str]
57
+
* default : "entry"
58
+
* the entry name of the kernel of input mlir or generated mlir
59
+
41
60
### --seed [int]
42
61
* set the seed to generate the test data and reprodce the test
43
62
44
63
### --verbose [int]
45
-
* set the verbose level
64
+
* set the verbose level, default : 0
65
+
* 0 : NO_VERBOSE
66
+
* 1 : MODULE_VERBOSE, print the module will be executed
67
+
* 2 : ARG_VERBOSE, + print arg information
68
+
* 3 : COMPARE_VERBOSE, + print threshold for comparison
69
+
* 4 : ERROR_OUTPUT_VERBOSE, + print all error data points if failed
70
+
* 5 : OUTPUT_VERBOSE, + print all result including passed tensor
71
+
* 6 : INPUT_VERBOSE, + print input torch tensors
72
+
73
+
### --ir_printing (action=store_true)
74
+
* Print the ir during the pass-pipeline
46
75
47
76
### --md index:SHAPExTYPE
48
77
* Describe the shape and data type for argument
@@ -97,7 +126,28 @@ module {
97
126
| Norm check | N | threshold |
98
127
| Benchdnn driver | D | driver_name:dtype:case|
99
128
129
+
## Bench Options
130
+
### --bench_kind [str]
131
+
* py : use the MLIR Python API to invoke the kernel and use Python to calculate the time cost
132
+
* wrapper : modify MLIR by wrapping the kernel into a new method and calling the `nanoTime()` method before and after calling the kernel. Finally, calculate the difference as the time cost
133
+
134
+
### --warm_up [int]
135
+
* warm-up times of the execution
136
+
137
+
### --repeat [int]
138
+
* repeat times of the execution
139
+
140
+
## Pattern Options
141
+
Each pattern has its own unique options.
142
+
### mlp
143
+
*`--batch_size`: the input
144
+
*`--hidden_size_list`: hidden_sizes of mlp, example: 32x16x64
145
+
*`--has_bias`: if the matmul op has bias, example: 1x0
146
+
*`--act_type`: choices=["noop", "relu"]
147
+
*`--dtype`: choices=["bf16", "f32"]
148
+
100
149
## Example
150
+
### Correctness testing example
101
151
```
102
152
# single add op test
103
153
# using the same data filling / compare strategy as the benchdnn primitive driver if not set
0 commit comments