mirror of
https://github.com/saymrwulf/onnxruntime.git
synced 2026-07-22 19:23:30 +00:00
[MIGraphX EP] Ensure we support all inputs for MatMulInteger and ConvInteger. (#21680)
… to int8 for now Allow for models with biases/full input and only check for int8 support in EP ### Description <!-- Describe your changes. --> Allows for all inputs for MatMulInteger and ConvInteger to be supported for prequantized models ### Motivation and Context <!-- - Why is this change required? What problem does it solve? - If it fixes an open issue, please link to the issue here. --> Fixes issues when using prequantized models that contain weight biases --------- Co-authored-by: Ted Themistokleous <tedthemistokleous@amd.com>
This commit is contained in:
parent
009209e016
commit
ed155ad46a
1 changed files with 6 additions and 19 deletions
|
|
@ -316,22 +316,14 @@ 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
|
||||
// only support int8 and uint8 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) {
|
||||
if ((input_type->tensor_type().elem_type() != ONNX_NAMESPACE::TensorProto_DataType::TensorProto_DataType_INT8) and
|
||||
(input_type->tensor_type().elem_type() != ONNX_NAMESPACE::TensorProto_DataType::TensorProto_DataType_UINT8)) {
|
||||
return true;
|
||||
}
|
||||
} else if (optype == "Expand") {
|
||||
|
|
@ -373,18 +365,14 @@ static bool IsUnsupportedOpMode(const onnxruntime::GraphViewer& graph_viewer, co
|
|||
return true;
|
||||
}
|
||||
} else if (optype == "MatMulInteger") {
|
||||
// migraphx can handle only two inputs
|
||||
if (node->InputDefs().size() != 2) {
|
||||
return true;
|
||||
}
|
||||
|
||||
// only support int8 type
|
||||
// only support int8 and uint8 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) {
|
||||
if ((input_type->tensor_type().elem_type() != ONNX_NAMESPACE::TensorProto_DataType::TensorProto_DataType_INT8) and
|
||||
(input_type->tensor_type().elem_type() != ONNX_NAMESPACE::TensorProto_DataType::TensorProto_DataType_UINT8)) {
|
||||
return true;
|
||||
}
|
||||
} else if (optype == "NonZero") {
|
||||
|
|
@ -456,7 +444,6 @@ static bool IsUnsupportedOpMode(const onnxruntime::GraphViewer& graph_viewer, co
|
|||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
} else if (optype == "ReduceSum") {
|
||||
const auto& args = node->InputDefs();
|
||||
if (args.size() == 2) {
|
||||
|
|
|
|||
Loading…
Reference in a new issue