Skip to content

Commit

Permalink
Ensure we support all inputs for MatMulInteger and ConvInteger. Limit…
Browse files Browse the repository at this point in the history
… to int8 for now

Allow for models with biases/full input and only check for int8 support in EP
  • Loading branch information
TedThemistokleous committed Aug 8, 2024
1 parent a26b7d7 commit 59bd055
Showing 1 changed file with 9 additions and 22 deletions.
31 changes: 9 additions & 22 deletions onnxruntime/core/providers/migraphx/migraphx_execution_provider.cc
Original file line number Diff line number Diff line change
Expand Up @@ -315,15 +315,6 @@ static bool IsUnsupportedOpMode(const onnxruntime::GraphViewer& graph_viewer, co
return true;
}
} else if (optype == "ConvInteger") {
if (node->InputDefs()[0]->Shape()->dim_size() != 4) {
return true;
}

// migraphx can handle only two inputs
if (node->InputDefs().size() != 2) {
return true;
}

// only support int8 type
const auto& input_type = node->InputDefs()[0]->TypeAsProto();
if (input_type == nullptr) {
Expand Down Expand Up @@ -371,20 +362,16 @@ static bool IsUnsupportedOpMode(const onnxruntime::GraphViewer& graph_viewer, co
data_type == ONNX_NAMESPACE::TensorProto_DataType::TensorProto_DataType_UINT8) {
return true;
}
} else if (optype == "MatMulInteger") {
// migraphx can handle only two inputs
if (node->InputDefs().size() != 2) {
return true;
}

// only support int8 type
const auto& input_type = node->InputDefs()[0]->TypeAsProto();
if (input_type == nullptr) {
return true;
}
else if (optype == "MatMulInteger") {

Check warning on line 365 in onnxruntime/core/providers/migraphx/migraphx_execution_provider.cc

View workflow job for this annotation

GitHub Actions / cpplint

[cpplint] onnxruntime/core/providers/migraphx/migraphx_execution_provider.cc#L365

An else should appear on the same line as the preceding } [whitespace/newline] [4]
Raw output
onnxruntime/core/providers/migraphx/migraphx_execution_provider.cc:365:  An else should appear on the same line as the preceding }  [whitespace/newline] [4]

Check warning on line 365 in onnxruntime/core/providers/migraphx/migraphx_execution_provider.cc

View workflow job for this annotation

GitHub Actions / cpplint

[cpplint] onnxruntime/core/providers/migraphx/migraphx_execution_provider.cc#L365

If an else has a brace on one side, it should have it on both [readability/braces] [5]
Raw output
onnxruntime/core/providers/migraphx/migraphx_execution_provider.cc:365:  If an else has a brace on one side, it should have it on both  [readability/braces] [5]
// only support int8 type
const auto& input_type = node->InputDefs()[0]->TypeAsProto();
if (input_type == nullptr) {
return true;
}

if (input_type->tensor_type().elem_type() != ONNX_NAMESPACE::TensorProto_DataType::TensorProto_DataType_INT8) {
return true;
if (input_type->tensor_type().elem_type() != ONNX_NAMESPACE::TensorProto_DataType::TensorProto_DataType_INT8) {
return true;
}
}
} else if (optype == "NonZero") {
if (!canEvalNodeArgument(graph_viewer, node, {0}, input_nodes)) {
Expand Down

0 comments on commit 59bd055

Please sign in to comment.