|
24 | 24 | namespace onnx_mlir {
|
25 | 25 |
|
26 | 26 | // Use external storage for the options so that they are globally accessible
|
27 |
| -std::string inputFilename; // common for both |
28 |
| -std::string outputBaseName; // common for both |
29 |
| -std::vector<accel::Accelerator::Kind> maccel; // common for both |
30 |
| -OptLevel OptimizationLevel; // common for both |
31 |
| -std::string mtriple; // common for both |
32 |
| -std::string mcpu; // common for both |
33 |
| -std::string march; // common for both |
34 |
| -InstrumentStages instrumentStage; // common for both |
35 |
| -int onnxConstPropExpansionBound; // common for both |
36 |
| -bool enableONNXHybridPass; // common for both |
37 |
| -std::vector<std::string> functionsToDecompose; // common for both |
38 |
| -EmissionTargetType emissionTarget; // onnx-mlir only |
39 |
| -bool invokeOnnxVersionConverter; // onnx-mlir only |
40 |
| -bool preserveLocations; // onnx-mlir only |
41 |
| -bool printIR; // onnx-mlir only |
42 |
| -bool preserveBitcode; // onnx-mlir only |
43 |
| -bool preserveLLVMIR; // onnx-mlir only |
44 |
| -bool preserveMLIR; // onnx-mlir only |
45 |
| -bool useOnnxModelTypes; // onnx-mlir only |
46 |
| -int repeatOnnxTransform; // onnx-mlir only |
47 |
| -std::string shapeInformation; // onnx-mlir only |
48 |
| -ModelSize modelSize; // onnx-mlir only |
49 |
| -bool storeConstantsToFile; // onnx-mlir only |
50 |
| -float constantsToFileTotalThreshold; // onnx-mlir only |
51 |
| -float constantsToFileSingleThreshold; // onnx-mlir only |
52 |
| -bool VerboseOutput; // onnx-mlir only |
53 |
| -std::vector<std::string> Xopt; // onnx-mlir only |
54 |
| -std::vector<std::string> Xllc; // onnx-mlir only |
55 |
| -std::string mllvm; // onnx-mlir only |
56 |
| -std::string instrumentOps; // onnx-mlir only |
57 |
| -unsigned instrumentControlBits; // onnx-mlir only |
58 |
| -bool instrumentONNXSignature; // onnx-mlir only |
59 |
| -std::string ONNXOpStats; // onnx-mlir only |
60 |
| -bool enableMemoryBundling; // onnx-mlir only |
61 |
| -int onnxOpTransformThreshold; // onnx-mlir only |
62 |
| -bool onnxOpTransformReport; // onnx-mlir only |
63 |
| -bool enableParallel; // onnx-mlir only |
64 |
| -bool disableSimdOption; // onnx-mlir only |
65 |
| -bool enableSimdDataLayout; // onnx-mlir only |
66 |
| -bool verifyInputTensors; // onnx-mlir only |
67 |
| -bool allowSorting; // onnx-mlir only |
68 |
| -std::string reportHeapBefore; // onnx-mlir only |
69 |
| -std::string reportHeapAfter; // onnx-mlir only |
70 |
| -std::string modelTag; // onnx-mlir only |
71 |
| -bool enableConvOptPass; // onnx-mlir only |
72 |
| -std::vector<std::string> extraLibPaths; // onnx-mlir only |
73 |
| -std::vector<std::string> extraLibs; // onnx-mlir only |
74 |
| -ProfileIRs profileIR; // onnx-mlir only |
75 |
| -OptReport optReport; // onnx-mlir only |
76 |
| -bool split_input_file; // onnx-mlir-opt only |
77 |
| -bool verify_diagnostics; // onnx-mlir-opt only |
78 |
| -bool verify_passes; // onnx-mlir-opt only |
79 |
| -bool allowUnregisteredDialects; // onnx-mlir-opt only |
| 27 | +std::string inputFilename; // common for both |
| 28 | +std::string outputBaseName; // common for both |
| 29 | +std::vector<accel::Accelerator::Kind> maccel; // common for both |
| 30 | +OptLevel OptimizationLevel; // common for both |
| 31 | +std::string mtriple; // common for both |
| 32 | +std::string mcpu; // common for both |
| 33 | +std::string march; // common for both |
| 34 | +InstrumentStages instrumentStage; // common for both |
| 35 | +int onnxConstPropExpansionBound; // common for both |
| 36 | +std::vector<std::string> onnxConstPropDisablePatterns; // common for both |
| 37 | +bool enableONNXHybridPass; // common for both |
| 38 | +std::vector<std::string> functionsToDecompose; // common for both |
| 39 | +EmissionTargetType emissionTarget; // onnx-mlir only |
| 40 | +bool invokeOnnxVersionConverter; // onnx-mlir only |
| 41 | +bool preserveLocations; // onnx-mlir only |
| 42 | +bool printIR; // onnx-mlir only |
| 43 | +bool preserveBitcode; // onnx-mlir only |
| 44 | +bool preserveLLVMIR; // onnx-mlir only |
| 45 | +bool preserveMLIR; // onnx-mlir only |
| 46 | +bool useOnnxModelTypes; // onnx-mlir only |
| 47 | +int repeatOnnxTransform; // onnx-mlir only |
| 48 | +std::string shapeInformation; // onnx-mlir only |
| 49 | +ModelSize modelSize; // onnx-mlir only |
| 50 | +bool storeConstantsToFile; // onnx-mlir only |
| 51 | +float constantsToFileTotalThreshold; // onnx-mlir only |
| 52 | +float constantsToFileSingleThreshold; // onnx-mlir only |
| 53 | +bool VerboseOutput; // onnx-mlir only |
| 54 | +std::vector<std::string> Xopt; // onnx-mlir only |
| 55 | +std::vector<std::string> Xllc; // onnx-mlir only |
| 56 | +std::string mllvm; // onnx-mlir only |
| 57 | +std::string instrumentOps; // onnx-mlir only |
| 58 | +unsigned instrumentControlBits; // onnx-mlir only |
| 59 | +bool instrumentONNXSignature; // onnx-mlir only |
| 60 | +std::string ONNXOpStats; // onnx-mlir only |
| 61 | +bool enableMemoryBundling; // onnx-mlir only |
| 62 | +int onnxOpTransformThreshold; // onnx-mlir only |
| 63 | +bool onnxOpTransformReport; // onnx-mlir only |
| 64 | +bool enableParallel; // onnx-mlir only |
| 65 | +bool disableSimdOption; // onnx-mlir only |
| 66 | +bool enableSimdDataLayout; // onnx-mlir only |
| 67 | +bool verifyInputTensors; // onnx-mlir only |
| 68 | +bool allowSorting; // onnx-mlir only |
| 69 | +std::string reportHeapBefore; // onnx-mlir only |
| 70 | +std::string reportHeapAfter; // onnx-mlir only |
| 71 | +std::string modelTag; // onnx-mlir only |
| 72 | +bool enableConvOptPass; // onnx-mlir only |
| 73 | +std::vector<std::string> extraLibPaths; // onnx-mlir only |
| 74 | +std::vector<std::string> extraLibs; // onnx-mlir only |
| 75 | +ProfileIRs profileIR; // onnx-mlir only |
| 76 | +OptReport optReport; // onnx-mlir only |
| 77 | +bool split_input_file; // onnx-mlir-opt only |
| 78 | +bool verify_diagnostics; // onnx-mlir-opt only |
| 79 | +bool verify_passes; // onnx-mlir-opt only |
| 80 | +bool allowUnregisteredDialects; // onnx-mlir-opt only |
80 | 81 |
|
81 | 82 | // Category for common options shared between onnx-mlir and onnx-mlir-opt.
|
82 | 83 | llvm::cl::OptionCategory OnnxMlirCommonOptions("common options",
|
@@ -163,6 +164,14 @@ static llvm::cl::opt<int, true> onnxConstPropExpansionBoundOpt(
|
163 | 164 | llvm::cl::location(onnxConstPropExpansionBound), llvm::cl::init(-1),
|
164 | 165 | llvm::cl::cat(OnnxMlirCommonOptions));
|
165 | 166 |
|
| 167 | +static llvm::cl::list<std::string, std::vector<std::string>> |
| 168 | + onnxConstPropDisablePatternsOpt("onnx-const-prop-disable-pattern", |
| 169 | + llvm::cl::desc("Named constant propagation pattern to disable. " |
| 170 | + "Repeat the flag to disable multiple patterns."), |
| 171 | + llvm::cl::value_desc("named constant propagation patterns to disable"), |
| 172 | + llvm::cl::location(onnxConstPropDisablePatterns), |
| 173 | + llvm::cl::cat(OnnxMlirCommonOptions)); |
| 174 | + |
166 | 175 | static llvm::cl::opt<bool, true> enableONNXHybridPassOpt("onnx-hybrid-pass",
|
167 | 176 | llvm::cl::desc("Enable ONNX hybrid pass (default=true)\n"
|
168 | 177 | "Set to 'false' if you want to disable ONNX hybrid pass."),
|
|
0 commit comments