Skip to content

Commit fa05686

Browse files
authored
Add option to set ORT_DISABLE_ALL as optimization (#195)
* Allow ORT_DISABLE_ALL value * update readme
1 parent 80a0e5b commit fa05686

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -167,7 +167,7 @@ Details regarding when to use these options and what to expect from them can be
167167
* `inter_op_thread_count`: Sets the number of threads used to parallelize the execution of the graph (across nodes). If sequential execution is enabled this value is ignored.
168168
A value of 0 means ORT will pick a default which is number of cores.
169169
* `execution_mode`: Controls whether operators in the graph are executed sequentially or in parallel. Usually when the model has many branches, setting this option to 1 .i.e. "parallel" will give you better performance. Default is 0 which is "sequential execution."
170-
* `level`: Refers to the graph optimization level. By default all optimizations are enabled. Allowed values are -1 and 1. -1 refers to BASIC optimizations and 1 refers to basic plus extended optimizations like fusions. Please find the details [here](https://onnxruntime.ai/docs/performance/graph-optimizations.html)
170+
* `level`: Refers to the graph optimization level. By default all optimizations are enabled. Allowed values are -1, 1 and 2. -1 refers to BASIC optimizations, 1 refers to basic plus extended optimizations like fusions and 2 refers to all optimizations being disabled. Please find the details [here](https://onnxruntime.ai/docs/performance/graph-optimizations.html).
171171

172172
```
173173
optimization {

src/onnxruntime.cc

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -227,6 +227,8 @@ ModelState::ModelState(TRITONBACKEND_Model* triton_model)
227227
optimization_level = GraphOptimizationLevel::ORT_ENABLE_BASIC;
228228
} else if (graph_level == 1) {
229229
optimization_level = GraphOptimizationLevel::ORT_ENABLE_EXTENDED;
230+
} else if (graph_level == 2) {
231+
optimization_level = GraphOptimizationLevel::ORT_DISABLE_ALL;
230232
}
231233
}
232234
}

0 commit comments

Comments
 (0)