From 5d33db1b30e593ef6d8b81d6115aece2ac609706 Mon Sep 17 00:00:00 2001 From: Hyukjin Jeong Date: Tue, 5 Nov 2024 17:00:29 +0900 Subject: [PATCH] [luci] Support mx type (#14302) This supports mx type in luci. ONE-DCO-1.0-Signed-off-by: Hyukjin Jeong --- compiler/luci/export/src/CircleExporterUtils.cpp | 5 +++++ compiler/luci/import/src/CircleReader.cpp | 4 ++++ compiler/luci/logex/src/CircleNodeSummaryBuilders.cpp | 5 +++++ 3 files changed, 14 insertions(+) diff --git a/compiler/luci/export/src/CircleExporterUtils.cpp b/compiler/luci/export/src/CircleExporterUtils.cpp index 2656f2c2256..3ca0d03fb35 100644 --- a/compiler/luci/export/src/CircleExporterUtils.cpp +++ b/compiler/luci/export/src/CircleExporterUtils.cpp @@ -77,6 +77,11 @@ circle::TensorType to_circle_tensortype(loco::DataType type) case loco::DataType::STRING: return circle::TensorType_STRING; + case loco::DataType::MXFP4: + return circle::TensorType_MXFP4; + case loco::DataType::MXINT8: + return circle::TensorType_MXINT8; + default: INTERNAL_EXN_V("failed to convert unsupported loco::DataType", oops::to_uint32(type)); } diff --git a/compiler/luci/import/src/CircleReader.cpp b/compiler/luci/import/src/CircleReader.cpp index 2233ada24a7..76027e2607f 100644 --- a/compiler/luci/import/src/CircleReader.cpp +++ b/compiler/luci/import/src/CircleReader.cpp @@ -70,6 +70,10 @@ loco::DataType luci_datatype(const circle::TensorType type) return loco::DataType::S8; case circle::TensorType_INT4: return loco::DataType::S4; + case circle::TensorType_MXFP4: + return loco::DataType::MXFP4; + case circle::TensorType_MXINT8: + return loco::DataType::MXINT8; default: break; } diff --git a/compiler/luci/logex/src/CircleNodeSummaryBuilders.cpp b/compiler/luci/logex/src/CircleNodeSummaryBuilders.cpp index f60fecc9f10..4bbe9156657 100644 --- a/compiler/luci/logex/src/CircleNodeSummaryBuilders.cpp +++ b/compiler/luci/logex/src/CircleNodeSummaryBuilders.cpp @@ -62,6 +62,11 @@ std::string to_str(loco::DataType type) case loco::DataType::BOOL: return "BOOL"; + case loco::DataType::MXFP4: + return "MXFP4"; + case loco::DataType::MXINT8: + return "MXINT8"; + default: return "Error"; }