onnx-mlir
onnx-mlir copied to clipboard
Improve the instrumentation tool
I noticed that the instrumentation tool for onnx duplicated to support ZHigh dialect. Other than code duplication, the current tool cannot easily support IR with mixed dialect. I think the instrumentation should be independent of dialect, while user can still have control on which operations to be instrumented. Changes are:
- Specify dialect name as list of string with command line option.
- In the instrumentation code, we check the name of the dialect, not the class of the dialect.
- In the runtime interface, pass the op name with dialect prefix. For example, from "Conv" to "onnx.Conv" or "ZHigh.Conv".
Another expansion of the functionality of our instrumentation tool is to output the data, or just shape of the data.
@imaihal I think that it may help you to measure the performance if we support the mixed dialect instrumentation at ZHigh level. We can get the execution time for ONNX op and ZHigh op at one place, and do not need to worry whether the execution time are mixed.