New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add opset 15 kernels for Pow, BatchNorm, and Shape #8442
Conversation
.Alias(3, 1) | ||
.Alias(4, 2) | ||
.TypeConstraint("T", DataTypeImpl::GetTensorType<double>()) | ||
.TypeConstraint("U", DataTypeImpl::GetTensorType<double>()), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Bug fix: "U" was missing for opset-14. Kept the kernel hash backwards compatible by ensuring the hash is computed only using T.
kCudaExecutionProvider, \ | ||
(*KernelDefBuilder::Create()) \ | ||
.TypeConstraint("T", DataTypeImpl::GetTensorType<T>()) \ | ||
.TypeConstraint("U", DataTypeImpl::GetTensorType<T>()), \ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"U" was missing for opset-14 (https://github.com/microsoft/onnxruntime/pull/7806/files#r673442347)
|
||
Status ShapeToInitializer::Apply(Graph& graph, Node& node, RewriteRuleEffect& rule_effect, const logging::Logger&) const { | ||
// Store the statically inferred shape of the input to the Shape operator. | ||
const ONNX_NAMESPACE::TensorShapeProto* input_shape_proto = node.InputDefs()[0]->Shape(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Retiring this RewriteRule as its functionality is already offered by another GraphTransformer (ConstantFolding) at the same optimization level (Level 1). Updating this would have been a copy/paste of the new logic added to the Shape processing logic in ConstantFolding
OpTester test("BatchNormalization", 15); | ||
float epsilon = 1e-05f; | ||
float momentum = 0.1f; | ||
int64_t training_mode = 1; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Training mode is enabled. But it still tests the opset 15 kernel's availability.
@@ -67,7 +67,6 @@ | |||
"^test_add_uint8_cpu", | |||
"^test_div_uint8_cpu", | |||
// Following tests are for opset 15 ops and are not yet implemented in ORT | |||
"^test_shape_*", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pow and BatchNorm came with no ONNX tests. Only Shape came with tests.
LGTM 👍 . Can you resolve the pipelines? |
Yeah, it just needs the newer |
/azp run Windows GPU CI Pipeline |
Azure Pipelines successfully started running 1 pipeline(s). |
Fixed the pipelines. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Description:
Clubbing some simple opset-15 implementations together-
Pow
had an opset bump with the inclusion ofbfloat16
in the list of supported types for the exponent input. (onnx/onnx#3412)BatchNorm
had an opset bump with separate type constraints being introduced for scale and bias. (onnx/onnx#3545)Shape
supports slicing specific indices (onnx/onnx#3580)Motivation and Context
ONNX compliance