Skip to content

OpenVINO™ is an open source toolkit for optimizing and deploying AI inference

Change the SimplifiedLayerNormalization's domain based on MS document (#28963)

liang6063d3f719ee
diff --git a/src/frontends/onnx/frontend/src/op/com.microsoft/simplified_layer_normalization.cpp b/src/frontends/onnx/frontend/src/op/com.microsoft/simplified_layer_normalization.cpp
index c34cd3f2105..7d65e34a0dc 100644
--- a/src/frontends/onnx/frontend/src/op/com.microsoft/simplified_layer_normalization.cpp
+++ b/src/frontends/onnx/frontend/src/op/com.microsoft/simplified_layer_normalization.cpp
@@ -21,7 +21,7 @@ using ::ONNX_NAMESPACE::TensorProto_DataType;
namespace ov {
namespace frontend {
namespace onnx {
-namespace com_microsoft {
+namespace ai_onnx {
namespace opset_1 {
ov::OutputVector simplified_layer_normalization(const ov::frontend::onnx::Node& node) {
@@ -66,12 +66,20 @@ ov::OutputVector simplified_layer_normalization(const ov::frontend::onnx::Node&
return ov::OutputVector{scaled, inv_std_var};
}
-ONNX_OP("SimplifiedLayerNormalization",
- OPSET_SINCE(1),
- com_microsoft::opset_1::simplified_layer_normalization,
- MICROSOFT_DOMAIN);
+/* This operator isn't clearly defined in ONNX documentation:
+ - https://github.com/onnx/onnx/blob/main/docs/Operators.md
+ - https://github.com/microsoft/onnxruntime/blob/main/docs/ContribOperators.md
+ Strange, but a SkipSimplifiedLayerNormalization is a part of com.microsoft domain:
+ -
+ https://github.com/microsoft/onnxruntime/blob/main/docs/ContribOperators.md#com.microsoft.SkipSimplifiedLayerNormalization
+ Same time SimplifiedLayerNormalization is described here and in some models it is found as a part of ai.onnx domain:
+ - https://github.com/microsoft/onnxruntime/blob/main/js/web/docs/webgpu-operators.md
+ To align with actual behavior and some documentation - decided to register it as a ai.onnx, but leave
+ in a folder with com.microsoft operations, because it isn't defined as a part of ONNX.
+*/
+ONNX_OP("SimplifiedLayerNormalization", OPSET_SINCE(1), ai_onnx::opset_1::simplified_layer_normalization);
} // namespace opset_1
-} // namespace com_microsoft
+} // namespace ai_onnx
} // namespace onnx
} // namespace frontend
} // namespace ov
diff --git a/src/frontends/onnx/tests/models/com.microsoft/simplified_layer_normalization_2x2x8.prototxt b/src/frontends/onnx/tests/models/com.microsoft/simplified_layer_normalization_2x2x8.prototxt
index 56c99e03a3f..3af35589ec8 100644
--- a/src/frontends/onnx/tests/models/com.microsoft/simplified_layer_normalization_2x2x8.prototxt
+++ b/src/frontends/onnx/tests/models/com.microsoft/simplified_layer_normalization_2x2x8.prototxt
@@ -22,7 +22,6 @@ graph {
i: 1
type: INT
}
- domain: "com.microsoft"
}
initializer {
dims: 8
@@ -70,6 +69,5 @@ graph {
}
}
opset_import {
- domain: "com.microsoft"
version: 1
}
diff --git a/src/frontends/onnx/tests/models/com.microsoft/simplified_layer_normalization_3x8.prototxt b/src/frontends/onnx/tests/models/com.microsoft/simplified_layer_normalization_3x8.prototxt
index ff7f58e3a38..74701495bc2 100644
--- a/src/frontends/onnx/tests/models/com.microsoft/simplified_layer_normalization_3x8.prototxt
+++ b/src/frontends/onnx/tests/models/com.microsoft/simplified_layer_normalization_3x8.prototxt
@@ -22,7 +22,6 @@ graph {
i: 1
type: INT
}
- domain: "com.microsoft"
}
initializer {
dims: 8
@@ -64,6 +63,5 @@ graph {
}
}
opset_import {
- domain: "com.microsoft"
version: 1
}
diff --git a/src/frontends/onnx/tests/onnx_import.in.cpp b/src/frontends/onnx/tests/onnx_import.in.cpp
index 6682e3918b2..1bd7ce253c7 100644
--- a/src/frontends/onnx/tests/onnx_import.in.cpp
+++ b/src/frontends/onnx/tests/onnx_import.in.cpp
@@ -6944,4 +6944,4 @@ OPENVINO_TEST(${BACKEND_NAME}, onnx_float8e4m3fn_constant) {
test_case.add_expected_output<ov::float8_e4m3>({-1.0f, 0.0f, 1.0f, NAN, 256.f, -256.f});
test_case.run();
-}
+}
\ No newline at end of file