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 Jun 19, 2024
1 parent 46dbfe5 commit ef33abb
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 @@ -314,15 +314,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 @@ -370,20 +361,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") {
// 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 ef33abb

Please sign in to comment.