Skip to content

Commit 7d71975

Browse files
authored
Allow TransposeOptimizer handle layout agonistic GeLU (microsoft#24708)
For NHWC EP, this GeLU op missing from handler would result in extra transpose wraps around GeLU ops. This fix address this issue and improves performance.
1 parent 2b5c0bc commit 7d71975

File tree

3 files changed

+3
-2
lines changed

3 files changed

+3
-2
lines changed

onnxruntime/core/optimizer/layout_transformation/layout_transformation_dev_notes.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ Foreach
1313
1. call GetCapability
1414
2. IF EP.DesiredFormat == NHWC
1515
2.1. Invoke Layout Transformer
16-
2.2 If graph is modified -> call GetCapability (layout transformer can add new nodes to the graph)
16+
2.2. If graph is modified -> call GetCapability (layout transformer can add new nodes to the graph)
1717
3 Compile
1818
```
1919

onnxruntime/core/optimizer/transpose_optimization/onnx_transpose_optimization.cc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2487,6 +2487,7 @@ constexpr HandlerInfo reshape_handler = {&FirstInput, &HandleReshape, /*transpos
24872487
static const std::unordered_map<std::string_view, const HandlerInfo&> handler_map{
24882488
{"Cast", simple_node_handler},
24892489
{"Exp", simple_node_handler},
2490+
{"Gelu", simple_node_handler},
24902491
{"Identity", simple_node_handler},
24912492
{"LeakyRelu", simple_node_handler},
24922493
{"Log", simple_node_handler},

onnxruntime/test/perftest/strings_helper.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ void ParseSessionConfigs(const std::string& configs_string,
4141
available_keys_str += ", ";
4242
}
4343
ORT_THROW("[ERROR] wrong key type entered : `", key,
44-
"`. The following runtime key options are avaible: [", available_keys_str, "]");
44+
"`. The following runtime key options are available: [", available_keys_str, "]");
4545
}
4646

4747
auto it = session_configs.find(key);

0 commit comments

Comments
 (0)