Skip to content

Commit

Permalink
[VITISAI] add float16 and bfloat16 support (#17438)
Browse files Browse the repository at this point in the history
### 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 <[email protected]>
  • Loading branch information
woinck authored Sep 22, 2023
1 parent 6b7bce5 commit 1bc215e
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
2 changes: 1 addition & 1 deletion onnxruntime/core/providers/vitisai/README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
VitsAI Execution Prividers
VitisAI Execution Provider
============================


Expand Down
7 changes: 5 additions & 2 deletions onnxruntime/core/providers/vitisai/imp/register_xir_ops.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down

0 comments on commit 1bc215e

Please sign in to comment.