From 9f1aba08619e2e455976f74d491f60471124b984 Mon Sep 17 00:00:00 2001 From: Alexandre Eichenberger Date: Wed, 16 Oct 2024 12:03:12 -0400 Subject: [PATCH 1/2] fix spelling, punctuation, and some end of line in help Signed-off-by: Alexandre Eichenberger --- .../NNPA/Compiler/NNPACompilerOptions.cpp | 14 +- src/Compiler/CompilerOptions.cpp | 188 +++++++++--------- 2 files changed, 103 insertions(+), 99 deletions(-) diff --git a/src/Accelerators/NNPA/Compiler/NNPACompilerOptions.cpp b/src/Accelerators/NNPA/Compiler/NNPACompilerOptions.cpp index ee4e0ae363..2ed3f8afda 100644 --- a/src/Accelerators/NNPA/Compiler/NNPACompilerOptions.cpp +++ b/src/Accelerators/NNPA/Compiler/NNPACompilerOptions.cpp @@ -61,7 +61,7 @@ llvm::cl::opt nnpaEnableCompilerStickUnstick( llvm::cl::opt nnpaEnableScalarBcastBinary( "nnpa-enable-scalar-bcast-binary", llvm::cl::desc("Enable the lowering to NNPA of binary operations with " - "broadcasting of a scalar operand." + "broadcasting of a scalar operand.\n" "Currently only enable ONNXDiv. Default is false."), llvm::cl::init(false), llvm::cl::cat(OnnxMlirCommonOptions)); @@ -70,9 +70,9 @@ llvm::cl::opt nnpaLoadDevicePlacementFile{ llvm::cl::desc( "Load device placement configuration from a JSON file. To " "have a template for the JSON file, use " - "--nnpa-save-device-placement-file=cfg.json. Note that we can use " + "--nnpa-save-device-placement-file=cfg.json.\nNote that we can use " "regex for " - "string values in the JSON file to match operations. The compiler uses " + "string values in the JSON file to match operations.\nThe compiler uses " "C++ std::regex_match function for matching."), llvm::cl::init(""), llvm::cl::cat(OnnxMlirOptions)}; @@ -87,11 +87,11 @@ llvm::cl::opt nnpaPlacementHeuristic{ "[Optional] Choose NNPA-related heuristic to place operations " "on NNPA device:"), llvm::cl::values( - clEnumVal(QualifyingOps, "Place all qualifying ops on NNPA (default)"), - clEnumVal(FasterOps, "Place qualifying ops that are faster on NNPA"), - clEnumVal(FasterOpsWSU, "FasterOps with stick/unstick cost"), + clEnumVal(QualifyingOps, "Place all qualifying ops on NNPA (default)."), + clEnumVal(FasterOps, "Place qualifying ops that are faster on NNPA."), + clEnumVal(FasterOpsWSU, "FasterOps with stick/unstick cost."), clEnumVal(MuchFasterOpsWSU, - "Much/Significantly FasterOps with stick/unstick cost")), + "Much/Significantly FasterOps with stick/unstick cost.")), llvm::cl::init(QualifyingOps), llvm::cl::cat(OnnxMlirOptions)}; llvm::cl::opt nnpaEnableSaturation("nnpa-saturation", diff --git a/src/Compiler/CompilerOptions.cpp b/src/Compiler/CompilerOptions.cpp index 64ec8e5830..d71d5c333a 100644 --- a/src/Compiler/CompilerOptions.cpp +++ b/src/Compiler/CompilerOptions.cpp @@ -97,11 +97,11 @@ bool allowUnregisteredDialects; // onnx-mlir-opt only // Category for common options shared between onnx-mlir and onnx-mlir-opt. llvm::cl::OptionCategory OnnxMlirCommonOptions("common options", - "These are options shared between onnx-mlir and onnx-mlir-opt"); + "These are options shared between onnx-mlir and onnx-mlir-opt."); // Category for options for onnx-mlir only. llvm::cl::OptionCategory OnnxMlirOptions( - "onnx-mlir options", "These are onnx-mlir frontend options"); + "onnx-mlir options", "These are onnx-mlir frontend options."); // Category for options for onnx-mlir-opt only. llvm::cl::OptionCategory OnnxMlirOptOptions( @@ -116,7 +116,7 @@ static llvm::cl::opt inputFilenameOpt(llvm::cl::Positional, static llvm::cl::opt outputBaseNameOpt("o", llvm::cl::desc("For onnx-mlir, specify the base path for output file, " - "extension will be added. Default is input filename " + "extension will be added.\nDefault is input filename " "without the extension, or \"stdin\" if input is stdin.\n" "For onnx-mlir-opt, specify the output filename. Default is " "stdout."), @@ -127,7 +127,7 @@ static llvm::cl::opt outputBaseNameOpt("o", static llvm::cl::list> maccelOpt("maccel", - llvm::cl::desc("Specify an accelerator to generate code for"), + llvm::cl::desc("Specify an accelerator to generate code for."), llvm::cl::location(maccel), // clang-format off llvm::cl::values( @@ -139,27 +139,27 @@ static llvm::cl::list OptimizationLevelOpt( llvm::cl::desc("Levels:"), - llvm::cl::values(clEnumVal(O0, "Optimization level 0 (default):"), - clEnumVal(O1, "Optimization level 1"), - clEnumVal(O2, "Optimization level 2"), - clEnumVal(O3, "Optimization level 3, SIMD is enabled")), + llvm::cl::values(clEnumVal(O0, "Optimization level 0 (default)."), + clEnumVal(O1, "Optimization level 1."), + clEnumVal(O2, "Optimization level 2."), + clEnumVal(O3, "Optimization level 3, SIMD is enabled.")), llvm::cl::location(OptimizationLevel), llvm::cl::init(O0), llvm::cl::cat(OnnxMlirCommonOptions)); static llvm::cl::opt mtripleOpt("mtriple", - llvm::cl::desc("Override target triple for module"), + llvm::cl::desc("Override target triple for module."), llvm::cl::value_desc("LLVM target triple"), llvm::cl::location(mtriple), llvm::cl::init(kDefaultTriple), llvm::cl::cat(OnnxMlirCommonOptions), llvm::cl::ValueRequired); static llvm::cl::opt mcpuOpt("mcpu", - llvm::cl::desc("Target cpu"), + llvm::cl::desc("Target cpu."), llvm::cl::value_desc("Target a specific CPU type"), llvm::cl::location(mcpu), llvm::cl::cat(OnnxMlirCommonOptions), llvm::cl::ValueRequired); static llvm::cl::opt marchOpt("march", - llvm::cl::desc("Target architecture to generate code for"), + llvm::cl::desc("Target architecture to generate code for."), llvm::cl::value_desc("Target a specific architecture type"), llvm::cl::location(march), llvm::cl::cat(OnnxMlirCommonOptions), llvm::cl::ValueRequired); @@ -175,16 +175,17 @@ static llvm::cl::opt onnxConstPropRoundFPToIntOpt( "onnx-const-prop-round-fp-to-int", llvm::cl::desc("If true constant propagates onnx.Cast from a floating " "point type to an integer type by rounding to nearest, " - "ties to even. If false truncates towards zero."), + "ties to even.\nIf false truncates towards zero."), llvm::cl::location(onnxConstPropRoundFPToInt), llvm::cl::init(false), llvm::cl::cat(OnnxMlirCommonOptions)); static llvm::cl::opt onnxConstPropExpansionBoundOpt( "onnx-const-prop-expansion-bound", - llvm::cl::desc("ONNX dialect constant propagation maximum expansion factor." - " Constants are not propagated if their bytes size exceed" - " the aggregate operands' sizes by more than this factor." - " Set to -1 to always propagate, which is the default."), + llvm::cl::desc( + "ONNX dialect constant propagation maximum expansion factor\n" + "Constants are not propagated if their bytes size exceed " + "the aggregate operands' sizes by more than this factor\n" + "Set to -1 to always propagate, which is the default."), llvm::cl::location(onnxConstPropExpansionBound), llvm::cl::init(-1), llvm::cl::cat(OnnxMlirCommonOptions)); @@ -204,7 +205,7 @@ static llvm::cl::opt enableONNXHybridPassOpt("onnx-hybrid-pass", static llvm::cl::list> functionsToDecomposeOpt("functions-to-decompose", - llvm::cl::desc("Specify ONNX functions to decompose"), + llvm::cl::desc("Specify ONNX functions to decompose."), llvm::cl::location(functionsToDecompose), llvm::cl::cat(OnnxMlirCommonOptions)); @@ -226,8 +227,8 @@ static llvm::cl::opt disable_quantization_zero_point( static llvm::cl::opt enableKrnlBufferReuseOpt( "enable-krnl-buffer-reuse", - llvm::cl::desc("enable buffer reuse within an op in onnx-to-krnl pass" - "(default=false)\n" + llvm::cl::desc("enable buffer reuse within an op in onnx-to-krnl pass " + "(default=false).\n" "Set to 'true' if you want to enable buffer reuse."), llvm::cl::location(enableKrnlBufferReuse), llvm::cl::init(false), llvm::cl::cat(OnnxMlirCommonOptions)); @@ -266,44 +267,43 @@ static llvm::cl::opt emissionTargetOpt( static llvm::cl::opt invokeOnnxVersionConverterOpt( "invokeOnnxVersionConverter", - llvm::cl::desc( - "call onnx version converter to convert ONNX model to current version"), + llvm::cl::desc("Call onnx version converter to convert ONNX model to " + "current version."), llvm::cl::location(invokeOnnxVersionConverter), llvm::cl::init(false), llvm::cl::cat(OnnxMlirOptions)); static llvm::cl::opt preserveLocationsOpt("preserveLocations", - llvm::cl::desc("emit location data:"), + llvm::cl::desc("Emit location data."), llvm::cl::location(preserveLocations), llvm::cl::init(false), llvm::cl::cat(OnnxMlirOptions)); static llvm::cl::opt printIROpt("printIR", - llvm::cl::desc("print the IR to stdout:"), llvm::cl::location(printIR), + llvm::cl::desc("Print the IR to stdout:."), llvm::cl::location(printIR), llvm::cl::init(false), llvm::cl::cat(OnnxMlirOptions)); static llvm::cl::opt preserveBitcodeOpt("preserveBitcode", - llvm::cl::desc( - "dont delete the bitcode files (optimized and unoptimized):"), + llvm::cl::desc("Preserve the bitcode files (optimized and unoptimized)."), llvm::cl::location(preserveBitcode), llvm::cl::init(false), llvm::cl::cat(OnnxMlirOptions)); static llvm::cl::opt preserveLLVMIROpt("preserveLLVMIR", - llvm::cl::desc("dont delete the LLVMIR files:"), + llvm::cl::desc("Preserve the LLVMIR files."), llvm::cl::location(preserveLLVMIR), llvm::cl::init(false), llvm::cl::cat(OnnxMlirOptions)); static llvm::cl::opt preserveMLIROpt("preserveMLIR", - llvm::cl::desc("dont delete the MLIR files (input and llvm):"), + llvm::cl::desc("Preserve the MLIR files (input and llvm)."), llvm::cl::location(preserveMLIR), llvm::cl::init(false), llvm::cl::cat(OnnxMlirOptions)); static llvm::cl::opt useOnnxModelTypesOpt("useOnnxModelTypes", - llvm::cl::desc("use types and shapes from ONNX model"), + llvm::cl::desc("Use types and shapes from ONNX model."), llvm::cl::location(useOnnxModelTypes), llvm::cl::init(true), llvm::cl::cat(OnnxMlirOptions)); static llvm::cl::opt repeatOnnxTransformOpt("repeatOnnxTransform", - llvm::cl::desc( - "invoke extra onnx transform pass(shape inference, constant and etc.)"), + llvm::cl::desc("Invoke extra onnx transform pass(shape inference, constant " + "and etc.)."), llvm::cl::location(repeatOnnxTransform), llvm::cl::init(0), llvm::cl::cat(OnnxMlirOptions)); @@ -316,14 +316,14 @@ static llvm::cl::opt shapeInformationOpt("shapeInformation", "where \"INPUT_ID1, INPUT_ID2, ...\" are input indices (starting from " "0 or being -1 for all input indices), and\n" "\"D1, D2, ...\" are dimension sizes (positive integers or -1 for " - "unknown dimensions)"), + "unknown dimensions)."), llvm::cl::value_desc("value"), llvm::cl::location(shapeInformation), llvm::cl::cat(OnnxMlirOptions)); static llvm::cl::opt dimParamsOpt("dimParams", llvm::cl::desc( - "Custom onnx.dim_params attributes for the inputs of the ONNX model for" - "specifying relationship among dynamic dimensions of the inputs.\n" + "Custom onnx.dim_params attributes for the inputs of the ONNX model " + "for specifying relationship among dynamic dimensions of the inputs.\n" "\"value\" is in the format of " "\"INPUT_ID1:D1=S1,D2=S2,...,Dn=Sn|INPUT_ID2:D1=T1,D2=T2,...Dn=Tn|" "...\" where \"INPUT_ID1, INPUT_ID2, ...\" are input indices " @@ -331,7 +331,7 @@ static llvm::cl::opt dimParamsOpt("dimParams", "\"S1, S2, ...\" and \"T2, T2, ...\" are symbols to specify that same " "symbols have the same value. " "All dimensions of onnx.dim_params for a specified input index in " - "the original onnx model are cleared and repalced by this option. " + "the original onnx model are cleared and replaced by this option. " "onnx.dim_params for other input indices in the original onnx model " "are not cleared"), llvm::cl::value_desc("value"), llvm::cl::location(dimParams), @@ -344,18 +344,18 @@ static llvm::cl::opt dimParamsOpt("dimParams", // parseCustomEnvFlagsCommandLineOption(...) function. static llvm::cl::opt customEnvFlagsOpt("customEnvFlags", llvm::cl::desc("Override default option env var OnnxMlirEnvOptionName: " - "ONNX_MLIR_FLAGS"), + "ONNX_MLIR_FLAGS."), llvm::cl::value_desc("option env var"), llvm::cl::location(customEnvFlags), llvm::cl::cat(OnnxMlirOptions)); static llvm::cl::opt modelSizeOpt("modelSize", - llvm::cl::desc("Model to generate code"), + llvm::cl::desc("Model to generate code:"), llvm::cl::value_desc("Only support small or large"), llvm::cl::location(modelSize), llvm::cl::values( clEnumVal(small, "Generate code for the small model. " "No special treatment at this moment. This is the " - "default code model"), + "default code model."), clEnumVal(large, "Generate code for the large model. " "Global constants are put into large read-only data section.")), @@ -366,16 +366,16 @@ static llvm::cl::opt storeConstantsToFileOpt( "store-constants-to-file", llvm::cl::desc( "Constants will be stored on a binary file instead of be embedded " - "into the model.so when compiling a big model. The binary file is in " + "into the model.so when compiling a big model.\nThe binary file is in " "the same folder as the model.so and has the same name as the model " - "with the extension of .constants.bin. For inference, " + "with the extension of .constants.bin.\nFor inference, " "model.constants.bin must be at the same folder as the inference " - "program. If model.constants.bin is at another folder, use the " - "environment variable OM_CONSTANT_PATH to set the constant folder. " + "program.\nIf model.constants.bin is at another folder, use the " + "environment variable OM_CONSTANT_PATH to set the constant folder.\n" "When using this option, two other options " "constants-to-file-single-threshold and " - "constants-to-file-total-threshold can be used to finetune the amount " - "of constants stored on the file. Windows will be supported soon. " + "constants-to-file-total-threshold can be used to fine-tune the amount " + "of constants stored on the file.\n" "Default is True."), llvm::cl::location(storeConstantsToFile), llvm::cl::init(true), llvm::cl::cat(OnnxMlirOptions)); @@ -384,8 +384,8 @@ static llvm::cl::opt constantsToFileTotalThresholdOpt( "constants-to-file-total-threshold", llvm::cl::desc( "Put global constants to a file if the total size in " - "bytes of constants is greater than this threshold. " - "store-constants-to-file must be enabled for this to be effective. " + "bytes of constants is greater than this threshold.\n" + "store-constants-to-file must be enabled for this to be effective.\n" "Only count constants whose size is greater than " "constants-to-file-single-threshold. Value is in GB. Default is " "1.5GB."), @@ -396,21 +396,21 @@ static llvm::cl::opt constantsToFileSingleThresholdOpt( "constants-to-file-single-threshold", llvm::cl::desc( "Put global constants to a file if a single constant's size in " - "bytes is greater than this threshold. " - "store-constants-to-file must be enabled for this to be effective. " + "bytes is greater than this threshold.\n" + "store-constants-to-file must be enabled for this to be effective.\n" "Total sizes in bytes of satisfied constants must be greater than " "constants-to-file-total-threshold. Value is in KB. Default is 1KB."), llvm::cl::location(constantsToFileSingleThreshold), llvm::cl::init(1.0), llvm::cl::cat(OnnxMlirOptions)); static llvm::cl::opt VerboseOutputOpt("v", - llvm::cl::desc("Use verbose output"), llvm::cl::location(VerboseOutput), + llvm::cl::desc("Use verbose output."), llvm::cl::location(VerboseOutput), llvm::cl::init(false), llvm::cl::cat(OnnxMlirOptions)); static llvm::cl::list> XoptOpt("Xopt", llvm::cl::desc( - "Arguments to forward to LLVM's 'opt' option processing" - "Multiple arguments to 'opt' need to be pass with seperate 'Xopt'" + "Arguments to forward to LLVM's 'opt' option processing " + "multiple arguments to 'opt' need to be pass with separate 'Xopt'.\n" "For example, '-Xopt opt1 -Xopt opt2 ...'"), llvm::cl::value_desc("A valid LLVM's 'opt' option"), llvm::cl::location(Xopt), llvm::cl::cat(OnnxMlirOptions), llvm::cl::Hidden, @@ -418,8 +418,8 @@ static llvm::cl::list> XoptOpt("Xopt", static llvm::cl::list> XllcOpt("Xllc", llvm::cl::desc( - "Arguments to forward to LLVM's 'llc' option processing" - "Multiple arguments to 'llc' need to be pass with seperate 'Xllc'" + "Arguments to forward to LLVM's 'llc' option processing " + "multiple arguments to 'llc' need to be pass with separate 'Xllc'.\n" "For example, '-Xllc opt1 -Xllc opt2 ...'"), llvm::cl::value_desc("A valid LLVM's 'llc' option"), llvm::cl::location(Xllc), llvm::cl::cat(OnnxMlirOptions), llvm::cl::Hidden, @@ -427,15 +427,15 @@ static llvm::cl::list> XllcOpt("Xllc", static llvm::cl::opt mllvmOpt("mllvm", llvm::cl::desc( - "Arguments to forward to LLVM's 'opt' and 'llc' option processing"), + "Arguments to forward to LLVM's 'opt' and 'llc' option processing."), llvm::cl::value_desc("A valid LLVM's 'opt' and 'llc' option"), llvm::cl::location(mllvm), llvm::cl::cat(OnnxMlirOptions), llvm::cl::Hidden, llvm::cl::ValueRequired); static llvm::cl::opt instrumentOpsOpt("instrument-ops", llvm::cl::desc("Specify operations to be instrumented:\n" - "\"NONE\" or \"\" for no instrument (default),\n" - "\"ALL\" for instrument of all ops,\n" + "\"NONE\" or \"\" for no instrument (default).\n" + "\"ALL\" for instrument of all ops.\n" "\"ops1,ops2, ...\" for the multiple ops.\n" "e.g. \"onnx.Conv,onnx.Add\" for Conv and Add ops.\n" "Asterisk is also available.\n" @@ -457,8 +457,8 @@ static llvm::cl::bits instrumentControlBitsOpt( static llvm::cl::opt parallelizeOpsOpt("parallelize-ops", llvm::cl::desc("Specify explicitly which operations to parallelize:\n" - "\"ALL\" or \"\" for all available operations (default),\n" - "\"NONE\" for no instrument,\n" + "\"ALL\" or \"\" for all available operations (default).\n" + "\"NONE\" for no instrument.\n" "\"ops1,ops2, ...\" for the multiple ops.\n" "e.g. \"onnx.MatMul,onnx.Add\" for MatMul and Add ops.\n" "Asterisk is also available.\n" @@ -470,8 +470,8 @@ static llvm::cl::opt instrumentSignatureOpt( "instrument-signature", llvm::cl::desc("Specify which high-level operations should print their" " input type(s) and shape(s)\n" - "\"ALL\" or \"\" for all available operations,\n" - "\"NONE\" for no instrument (default),\n" + "\"ALL\" or \"\" for all available operations.\n" + "\"NONE\" for no instrument (default).\n" "\"ops1,ops2, ...\" for the multiple ops.\n" "e.g. \"onnx.MatMul,onnx.Add\" for MatMul and Add ops.\n" "Asterisk is also available.\n" @@ -494,7 +494,7 @@ static llvm::cl::opt onnxOpTransformThresholdOpt( llvm::cl::desc( "Max iteration for dynamic op transform passes (default=3).\n" "If set to 0, onnxOpTransformPass will be disabled, and\n" - "static iteration will be used"), + "static iteration will be used."), llvm::cl::location(onnxOpTransformThreshold), llvm::cl::init(3), llvm::cl::cat(OnnxMlirOptions)); @@ -525,17 +525,18 @@ static llvm::cl::opt enableFastMathOptionOpt("enable-fast-math", llvm::cl::cat(OnnxMlirOptions)); static llvm::cl::opt enableSimdDataLayoutOpt("simd-data-layout", - llvm::cl::desc("Enable SIMD optimization for convolution (default=false)\n" + llvm::cl::desc("Enable SIMD optimization for convolution (default=false).\n" "Set to 'true' if you want to enable SIMD optimizations."), llvm::cl::location(enableSimdDataLayout), llvm::cl::init(false), llvm::cl::cat(OnnxMlirOptions)); llvm::cl::opt opsForCallOpt("ops-for-call", - llvm::cl::desc("Specify which ops are lowered to knrl.call instead of" - "krnl loops. op name are used to check against this option." - "Names of opa are separated with space." - "Example: ops-for-call=Conv MatMul" - "The regex match will be used to check against op name"), + llvm::cl::desc( + "Specify which ops are lowered to knrl.call instead of " + "krnl loops. op name are used to check against this option.\n" + "Names of opa are separated with space. " + "Example: ops-for-call=Conv MatMul.\n" + "The regex match will be used to check against op name."), llvm::cl::location(opsForCall), llvm::cl::init(""), llvm::cl::cat(OnnxMlirOptions)); @@ -548,7 +549,7 @@ static llvm::cl::opt verifyInputTensorsOpt("verifyInputTensors", llvm::cl::cat(OnnxMlirOptions)); static llvm::cl::opt allowSortingOpt("allowSorting", - llvm::cl::desc("Perform topological sort on onnx graph"), + llvm::cl::desc("Perform topological sort on onnx graph."), llvm::cl::location(allowSorting), llvm::cl::init(true), llvm::cl::cat(OnnxMlirOptions)); @@ -556,28 +557,28 @@ static llvm::cl::list> reportHeapBeforeOpt("report-heap-before", llvm::cl::desc("A list of names of passes.\n" "Before each heap statistics are dumped to " - ".heap.log"), + ".heap.log."), llvm::cl::location(reportHeapBefore), llvm::cl::cat(OnnxMlirOptions)); static llvm::cl::list> reportHeapAfterOpt( "report-heap-after", llvm::cl::desc("A list of names of passes.\n" "After each heap statistics are dumped to " - ".heap.log"), + ".heap.log."), llvm::cl::location(reportHeapAfter), llvm::cl::cat(OnnxMlirOptions)); static llvm::cl::opt modelTagOpt("tag", llvm::cl::desc( "Set a tag that will be used to postfix symbols in the generated " - "LLVMIR to make the symbols unique across multiple generated models. " + "LLVMIR to make the symbols unique across multiple generated models.\n" "By default, use the filename (without extension) of the input onnx " - "model or the value passed to `-o`. The tag will be appended to " + "model or the value passed to `-o`.\nThe tag will be appended to " "global variable and function names. For backward compatibility, each " "function has two versions with the same signature and doing the same " - "computation. For example, we will have two entry points: " + "computation.\nFor example, we will have two entry points: " "`run_main_graph` and `run_main_graph_tag`, where `run_main_graph` " - "is just a wrapper of `run_main_graph_tag`. Users can call one of " - "the entry points and expect the same result. Passing `NONE` to " + "is just a wrapper of `run_main_graph_tag`.\nUsers can call one of " + "the entry points and expect the same result.\nPassing `NONE` to " "`--tag` will disable tag completely, meaning no tag is appended to " "the symbols."), llvm::cl::value_desc("a string that matches regex ([0-9a-z_.-]+)"), @@ -590,28 +591,29 @@ static llvm::cl::opt enableConvOptPassOpt("enable-conv-opt-pass", llvm::cl::cat(OnnxMlirOptions)); static llvm::cl::opt disableConstantPropOpt("disable-constant-prop", - llvm::cl::desc("Disable Constant Propagation (default is false)\n" + llvm::cl::desc("Disable Constant Propagation (default is false).\n" "Set to 'true' to disable Constant Propagation."), llvm::cl::location(disableConstantProp), llvm::cl::init(false), llvm::cl::cat(OnnxMlirCommonOptions)); static llvm::cl::list> extraLibPathsOpt( "L", - llvm::cl::desc("Specify extra directories for libraries when compiling" - "an onnx model. Will be add used as -L in the linkage step." - "Each directory can be specified with one extra-lib-dirs"), + llvm::cl::desc( + "Specify extra directories for libraries when compiling " + "an onnx model. Will be add used as -L in the linkage step.\n" + "Each directory can be specified with one extra-lib-dirs."), llvm::cl::location(extraLibPaths), llvm::cl::Prefix, llvm::cl::cat(OnnxMlirOptions)); static llvm::cl::list> extraLibsOpt("l", llvm::cl::desc("Specify extra libraries when compiling an onnx model." - "Will be add used as -l in the linkage step." - "Each lib can be specified with one extra-libs"), + "Will be add used as -l in the linkage step.\n" + "Each lib can be specified with one extra-libs."), llvm::cl::location(extraLibs), llvm::cl::Prefix, llvm::cl::cat(OnnxMlirOptions)); static llvm::cl::opt profileIROpt("profile-ir", - llvm::cl::desc("Profile operations in an IR"), + llvm::cl::desc("Profile operations in an IR:"), llvm::cl::location(profileIR), llvm::cl::values(clEnumVal(None, "No profiling. Default value."), clEnumVal( @@ -620,7 +622,7 @@ static llvm::cl::opt profileIROpt("profile-ir", llvm::cl::init(ProfileIRs::None), llvm::cl::cat(OnnxMlirOptions)); static llvm::cl::opt optReportOpt("opt-report", - llvm::cl::desc("Provide information on a specific compiler optimization."), + llvm::cl::desc("Provide information on a specific compiler optimization:"), llvm::cl::location(optReport), llvm::cl::values(clEnumVal(NoReport, "No report. Default value."), clEnumVal(Parallel, @@ -636,8 +638,9 @@ static llvm::cl::opt enable_timing("enable-timing", llvm::cl::cat(OnnxMlirOptions)); static llvm::cl::opt enable_bound_check("enable-bound-check", - llvm::cl::desc("Enable runtime bound check for memrefs (default is false)\n" - "Set to 'true' if you want to enable the check."), + llvm::cl::desc( + "Enable runtime bound check for memrefs (default is false).\n" + "Set to 'true' if you want to enable the check."), llvm::cl::location(enableBoundCheck), llvm::cl::init(false), llvm::cl::cat(OnnxMlirOptions)); @@ -646,10 +649,11 @@ static llvm::cl::opt enable_bound_check("enable-bound-check", static llvm::cl::opt test_compiler_opt("test-compiler-opt", llvm::cl::desc( "Help compiler writers test a new (small) optimization. When false, " - "the old approach should be used. When true, the new opt should be " + "the old approach should be used.\nWhen true, the new opt should be " "used. Utilities such as CheckONNXModel.py can then verify that the " "new opt deliver the same results.\n" - "E.g. CheckONNXModel.py -m test.mlir -t -O3 -a test-compiler-opt=true\n" + "E.g. CheckONNXModel.py -m test.mlir -t -O3 -a " + "test-compiler-opt=true.\n" "Once the new opt works, it should not rely this option any more.\n" "Only defined in DEBUG build and default to false.\n"), llvm::cl::location(debugTestCompilerOpt), llvm::cl::init(false), @@ -663,33 +667,33 @@ bool debugTestCompilerOpt = false; // Options for onnx-mlir-opt only static llvm::cl::opt split_input_file_opt("split-input-file", llvm::cl::desc("Split the input file into pieces and process each " - "chunk independently"), + "chunk independently."), llvm::cl::location(split_input_file), llvm::cl::init(false), llvm::cl::cat(OnnxMlirOptOptions)); static llvm::cl::opt verify_diagnostics_opt("verify-diagnostics", llvm::cl::desc("Check that emitted diagnostics match " - "expected-* lines on the corresponding line"), + "expected-* lines on the corresponding line."), llvm::cl::location(verify_diagnostics), llvm::cl::init(false), llvm::cl::cat(OnnxMlirOptOptions)); static llvm::cl::opt verify_passes_opt("verify-each", - llvm::cl::desc("Run the verifier after each transformation pass"), + llvm::cl::desc("Run the verifier after each transformation pass."), llvm::cl::location(verify_passes), llvm::cl::init(true), llvm::cl::cat(OnnxMlirOptOptions)); static llvm::cl::opt allowUnregisteredDialectsOpt( "allow-unregistered-dialect", - llvm::cl::desc("Allow operation with no registered dialects"), + llvm::cl::desc("Allow operation with no registered dialects."), llvm::cl::location(allowUnregisteredDialects), llvm::cl::init(false), llvm::cl::cat(OnnxMlirOptOptions)); // Removed once the new LLVM bufferization works without performance regression. static llvm::cl::opt useOldBufferizationOpt("use-old-bufferization", llvm::cl::desc( - "Enable the old LLVM bufferization mechanism (default=true)\n" + "Enable the old LLVM bufferization mechanism (default=true).\n" "This option should be removed once the new LLVM bufferization works " - "well in onnx-mlir"), + "well in onnx-mlir."), llvm::cl::location(useOldBufferization), llvm::cl::init(true), llvm::cl::cat(OnnxMlirOptions)); From abc902f5d421578818f94d7ab5a74be452ea7762 Mon Sep 17 00:00:00 2001 From: Alexandre Eichenberger Date: Wed, 16 Oct 2024 12:06:34 -0400 Subject: [PATCH 2/2] format Signed-off-by: Alexandre Eichenberger --- src/Accelerators/NNPA/Compiler/NNPACompilerOptions.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/Accelerators/NNPA/Compiler/NNPACompilerOptions.cpp b/src/Accelerators/NNPA/Compiler/NNPACompilerOptions.cpp index 2ed3f8afda..91b6aab183 100644 --- a/src/Accelerators/NNPA/Compiler/NNPACompilerOptions.cpp +++ b/src/Accelerators/NNPA/Compiler/NNPACompilerOptions.cpp @@ -72,7 +72,8 @@ llvm::cl::opt nnpaLoadDevicePlacementFile{ "have a template for the JSON file, use " "--nnpa-save-device-placement-file=cfg.json.\nNote that we can use " "regex for " - "string values in the JSON file to match operations.\nThe compiler uses " + "string values in the JSON file to match operations.\nThe compiler " + "uses " "C++ std::regex_match function for matching."), llvm::cl::init(""), llvm::cl::cat(OnnxMlirOptions)};