Skip to content

Commit

Permalink
default on enable zhigh to onnx switched to disable
Browse files Browse the repository at this point in the history
Signed-off-by: Alexandre Eichenberger <[email protected]>
  • Loading branch information
AlexandreEichenberger committed Feb 12, 2025
1 parent bd52017 commit 5f98043
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
8 changes: 4 additions & 4 deletions src/Accelerators/NNPA/Compiler/NNPACompilerOptions.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -37,13 +37,13 @@ llvm::cl::opt<bool> nnpaClipToDLFloatRange("nnpa-clip-to-dlfloat-range",
"replaced by --nnpa-saturation in the future."),
llvm::cl::init(true), llvm::cl::cat(OnnxMlirOptions));

llvm::cl::opt<bool> nnpaEnableZHighToOnnx("enable-zhigh-to-onnx",
llvm::cl::opt<bool> nnpaDisableZHighToOnnx("disable-zhigh-to-onnx",
llvm::cl::desc(
"Enabling this will convert a pattern `stick -> element-wise op -> "
"By default we convert a pattern `stick -> element-wise op -> "
"unstick` back to an ONNX element-wise op. This conversion is called "
"after applying all optimizations to remove stick/unstick at ZHigh "
"level. Default is true."),
llvm::cl::init(true), llvm::cl::cat(OnnxMlirOptions));
"level. Use this option to disable this optimization."),
llvm::cl::init(false), llvm::cl::cat(OnnxMlirOptions));

llvm::cl::opt<bool> nnpaEnableZHighDecomposeStickUnstick(
"enable-zhigh-decompose-stick-unstick",
Expand Down
2 changes: 1 addition & 1 deletion src/Accelerators/NNPA/Compiler/NNPACompilerOptions.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ extern llvm::cl::OptionCategory OnnxMlirOptions;
extern llvm::cl::OptionCategory OnnxMlirCommonOptions;
extern llvm::cl::opt<onnx_mlir::NNPAEmissionTargetType> nnpaEmissionTarget;
extern llvm::cl::opt<bool> nnpaClipToDLFloatRange;
extern llvm::cl::opt<bool> nnpaEnableZHighToOnnx;
extern llvm::cl::opt<bool> nnpaDisableZHighToOnnx;
extern llvm::cl::opt<bool> nnpaEnableZHighDecomposeStickUnstick;
extern llvm::cl::opt<bool> nnpaEnableCompilerStickUnstick;
extern llvm::cl::opt<bool> nnpaEnableScalarBcastBinary;
Expand Down
2 changes: 1 addition & 1 deletion src/Accelerators/NNPA/Compiler/NNPACompilerUtils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,7 @@ void addONNXToZHighPasses(mlir::PassManager &pm) {
// sub, ...) that are of `stick -> light-weight op -> unstick`, it's better to
// use CPU instead of NNPA to avoid stick/unstick. CPU is efficient to handle
// these ops, e.g vectorize the computation.
if (nnpaEnableZHighToOnnx)
if (! nnpaDisableZHighToOnnx)
pm.addNestedPass<func::FuncOp>(onnx_mlir::createZHighToONNXPass());

// Constant propagation at ZHighIR: constant stickify.
Expand Down

0 comments on commit 5f98043

Please sign in to comment.