[VITISAI] add float16 and bfloat16 support (#17438)

### Description
Add float16 and bfloat16 data type support for VitisAI ep



### Motivation and Context
The VitisAI ep has added the bfloat datatype support. So we would like
to register the datatype from onnxruntime side to enable them.

---------

Signed-off-by: Yiming Hu <yiming.hu@amd.com>
This commit is contained in:
Yiming Hu 2023-09-21 19:22:28 -07:00 committed by GitHub
parent 6b7bce5ec9
commit 1bc215e1d1
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 3 deletions

View file

@ -1,4 +1,4 @@
VitsAI Execution Prividers
VitisAI Execution Provider
============================

View file

@ -34,9 +34,12 @@ static void xir_shape_infer(ONNX_NAMESPACE::InferenceContext& ctx) {
updateOutputElemType(ctx, 0, ONNX_NAMESPACE::TensorProto::INT64);
} else if (data_type->s() == "int1") {
updateOutputElemType(ctx, 0, ONNX_NAMESPACE::TensorProto::BOOL);
} else if (data_type->s() == "bfloat16") {
updateOutputElemType(ctx, 0, ONNX_NAMESPACE::TensorProto::BFLOAT16);
} else if (data_type->s() == "float16") {
updateOutputElemType(ctx, 0, ONNX_NAMESPACE::TensorProto::FLOAT16);
} else {
std::cerr << "not supported data_type " << data_type->s();
abort();
vai_assert(false, ", not supported data_type: " + data_type->s());
}
if (shape != nullptr) {
for (auto i = 0; i < shape->ints_size(); ++i) {