Representation and Reference Lowering of ONNX Models in MLIR Compiler Infrastructure
View the Project on GitHub onnx/onnx-mlir
This project is maintained by onnx
Hosted on GitHub Pages — Theme by orderedlist
Command-line options can be used to alter the default behavior of onnx-mlir, or onnx-mlir-opt, and help user experimenting, debugging or performance tuning. We implemented command-line in ONNX-MLIR based on the command-line utility provided by LLVM. We did not define Option
or ListOption
with MLIR pass classes(see discussion).
Refer llvm document for basic idea of how to define an option. In ONNX-MLIR, options are put into groups (llvm::cl::OptionCategory
). All command-line options for onnx-mlir are in the OnnxMlirOptions
group.
Command-line options should be placed in src/Compiler/CompilerOptions.cpp
and declared in src/Compiler/CompilerOptions.hpp
.
src/Compiler/CompilerOptions.hpp
src/Compiler/CompilerOptions.cpp
, define the optionsrc/Compiler/CompilerOptions.hpp
in new source files; it should only be used in the onnx-mlir and onnn-mlir-opt command-line tools.Use MLIR’s Pass Options to configure passes.