diff --git a/compiler/circlechef/circle/src/Convert.cpp b/compiler/circlechef/circle/src/Convert.cpp index 8f11e00cd8f..851b6979a61 100644 --- a/compiler/circlechef/circle/src/Convert.cpp +++ b/compiler/circlechef/circle/src/Convert.cpp @@ -39,6 +39,10 @@ circlechef::TensorType as_circlechef_type(const circle::TensorType type) return circlechef::INT16; case circle::TensorType_INT4: return circlechef::INT4; + case circle::TensorType_MXFP4: + return circlechef::MXFP4; + case circle::TensorType_MXINT8: + return circlechef::MXINT8; // TODO handle other types // TensorType_FLOAT16 // TensorType_STRING diff --git a/compiler/circlechef/core/src/Convert.cpp b/compiler/circlechef/core/src/Convert.cpp index d2c70de1ea7..a6c82664a3a 100644 --- a/compiler/circlechef/core/src/Convert.cpp +++ b/compiler/circlechef/core/src/Convert.cpp @@ -72,6 +72,10 @@ circle::TensorType as_circle_tensortype(const circlechef::TensorType &value) return circle::TensorType_STRING; case circlechef::BOOL: return circle::TensorType_BOOL; + case circlechef::MXFP4: + return circle::TensorType_MXFP4; + case circlechef::MXINT8: + return circle::TensorType_MXINT8; default: break; } diff --git a/compiler/circlechef/core/src/Convert.test.cpp b/compiler/circlechef/core/src/Convert.test.cpp index 8946b6e105f..4c9f629bd7d 100644 --- a/compiler/circlechef/core/src/Convert.test.cpp +++ b/compiler/circlechef/core/src/Convert.test.cpp @@ -51,6 +51,8 @@ TEST(ConvertTest, as_circle_tensortype) ASSERT_EQ(circle::TensorType_UINT8, as_circle_tensortype(circlechef::UINT8)); ASSERT_EQ(circle::TensorType_UINT4, as_circle_tensortype(circlechef::UINT4)); ASSERT_EQ(circle::TensorType_BOOL, as_circle_tensortype(circlechef::BOOL)); + ASSERT_EQ(circle::TensorType_MXFP4, as_circle_tensortype(circlechef::MXFP4)); + ASSERT_EQ(circle::TensorType_MXINT8, as_circle_tensortype(circlechef::MXINT8)); } TEST(ConvertTest, as_circle_tensortype_NEG) diff --git a/compiler/circlechef/proto/circlechef.proto b/compiler/circlechef/proto/circlechef.proto index 4bdd1bef1b4..7562e10c884 100644 --- a/compiler/circlechef/proto/circlechef.proto +++ b/compiler/circlechef/proto/circlechef.proto @@ -14,6 +14,8 @@ package circlechef; // This enum value corresponds to TensorType in TensorFlow Lite schema enum TensorType { + MXINT8 = -7; + MXFP4 = -6; UINT4 = -1; FLOAT32 = 0; INT32 = 2;