From 3504496713b610b1c54b0e6ccead3e9145c4f197 Mon Sep 17 00:00:00 2001 From: Yiming Hu Date: Tue, 5 Sep 2023 15:39:46 -0700 Subject: [PATCH 1/3] add bfloat16 support Signed-off-by: Yiming Hu --- onnxruntime/core/providers/vitisai/imp/register_xir_ops.cc | 2 ++ 1 file changed, 2 insertions(+) diff --git a/onnxruntime/core/providers/vitisai/imp/register_xir_ops.cc b/onnxruntime/core/providers/vitisai/imp/register_xir_ops.cc index 544e18350635d..ee73154f80600 100644 --- a/onnxruntime/core/providers/vitisai/imp/register_xir_ops.cc +++ b/onnxruntime/core/providers/vitisai/imp/register_xir_ops.cc @@ -34,6 +34,8 @@ 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 { std::cerr << "not supported data_type " << data_type->s(); abort(); From 3107921ae2fdf0dd38a11311e97285f0a9676278 Mon Sep 17 00:00:00 2001 From: Yiming Hu Date: Wed, 6 Sep 2023 16:20:32 -0700 Subject: [PATCH 2/3] fix typo --- onnxruntime/core/providers/vitisai/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/onnxruntime/core/providers/vitisai/README.md b/onnxruntime/core/providers/vitisai/README.md index 15e0c804489c5..6ddb58b8d96ae 100644 --- a/onnxruntime/core/providers/vitisai/README.md +++ b/onnxruntime/core/providers/vitisai/README.md @@ -1,4 +1,4 @@ -VitsAI Execution Prividers +VitisAI Execution Provider ============================ From ddccead6763d702573362f487e3db66b60330b98 Mon Sep 17 00:00:00 2001 From: Yiming Hu Date: Mon, 11 Sep 2023 10:21:04 -0700 Subject: [PATCH 3/3] add float16 support --- onnxruntime/core/providers/vitisai/imp/register_xir_ops.cc | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/onnxruntime/core/providers/vitisai/imp/register_xir_ops.cc b/onnxruntime/core/providers/vitisai/imp/register_xir_ops.cc index ee73154f80600..ee8dfc6d03d12 100644 --- a/onnxruntime/core/providers/vitisai/imp/register_xir_ops.cc +++ b/onnxruntime/core/providers/vitisai/imp/register_xir_ops.cc @@ -36,9 +36,10 @@ static void xir_shape_infer(ONNX_NAMESPACE::InferenceContext& ctx) { 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) {