Browse Source

!1511 add data type DT_INT4

From: @li-lei0106
Reviewed-by: @xchu42,@ji_chen
Signed-off-by: @ji_chen
tags/v1.3.0
mindspore-ci-bot Gitee 3 years ago
parent
commit
a171f50687
8 changed files with 12 additions and 32 deletions
  1. +2
    -0
      ge/client/proto/ge_ir.proto
  2. +2
    -0
      ge/common/proto/ge_ir.proto
  3. +2
    -0
      ge/executor/proto/ge_ir.proto
  4. +2
    -0
      ge/offline/proto/ge_ir.proto
  5. +2
    -0
      ge/proto/ge_ir.proto
  6. +1
    -1
      metadef
  7. +1
    -1
      parser
  8. +0
    -30
      tests/ut/ge/common/format_transfer_unittest.cc

+ 2
- 0
ge/client/proto/ge_ir.proto View File

@@ -31,6 +31,8 @@ enum DataType
DT_STRING_REF = 24; // string_ref type
DT_DUAL = 25; /**< dual output type */
DT_VARIANT = 26; // variant type
DT_BF16 = 27; // bf16 type
DT_INT4 = 28; // int4 type
}

message AttrDef


+ 2
- 0
ge/common/proto/ge_ir.proto View File

@@ -31,6 +31,8 @@ enum DataType
DT_STRING_REF = 24; // string_ref type
DT_DUAL = 25; /**< dual output type */
DT_VARIANT = 26; // variant type
DT_BF16 = 27; // bf16 type
DT_INT4 = 28; // int4 type
}

message AttrDef


+ 2
- 0
ge/executor/proto/ge_ir.proto View File

@@ -31,6 +31,8 @@ enum DataType
DT_STRING_REF = 24; // string_ref type
DT_DUAL = 25; /**< dual output type */
DT_VARIANT = 26; // variant type
DT_BF16 = 27; // bf16 type
DT_INT4 = 28; // int4 type
}

message AttrDef


+ 2
- 0
ge/offline/proto/ge_ir.proto View File

@@ -31,6 +31,8 @@ enum DataType
DT_STRING_REF = 24; // string_ref type
DT_DUAL = 25; /**< dual output type */
DT_VARIANT = 26; // variant type
DT_BF16 = 27; // bf16 type
DT_INT4 = 28; // int4 type
}

message AttrDef


+ 2
- 0
ge/proto/ge_ir.proto View File

@@ -31,6 +31,8 @@ enum DataType
DT_STRING_REF = 24; // string_ref type
DT_DUAL = 25; /**< dual output type */
DT_VARIANT = 26; // variant type
DT_BF16 = 27; // bf16 type
DT_INT4 = 28; // int4 type
}

message AttrDef


+ 1
- 1
metadef

@@ -1 +1 @@
Subproject commit fcebf37d7428caf4e0bd6e6c3a4f8143f6eac8b7
Subproject commit 72bcde72074856e6cb1e8ba19df43b358bdb0160

+ 1
- 1
parser

@@ -1 +1 @@
Subproject commit 424ac0609fe17f455865436462a2c62f85aea2b1
Subproject commit 88c66a63b382bb54b338859e44b6321da979b22e

+ 0
- 30
tests/ut/ge/common/format_transfer_unittest.cc View File

@@ -51,35 +51,5 @@ TEST_F(UtestFormatTransfer, build_unsupported_transfer) {
auto transfer2 = BuildFormatTransfer(args2);
EXPECT_EQ(transfer2, nullptr);
}

TEST_F(UtestFormatTransfer, get_size_by_data_type) {
EXPECT_EQ(GetSizeByDataType(DT_FLOAT), 4);
EXPECT_EQ(GetSizeByDataType(DT_FLOAT16), 2);
EXPECT_EQ(GetSizeByDataType(DT_INT8), 1);
EXPECT_EQ(GetSizeByDataType(DT_INT16), 2);
EXPECT_EQ(GetSizeByDataType(DT_UINT16), 2);
EXPECT_EQ(GetSizeByDataType(DT_UINT8), 1);
EXPECT_EQ(GetSizeByDataType(DT_INT32), 4);
EXPECT_EQ(GetSizeByDataType(DT_INT64), 8);
EXPECT_EQ(GetSizeByDataType(DT_UINT32), 4);
EXPECT_EQ(GetSizeByDataType(DT_UINT64), 8);
EXPECT_EQ(GetSizeByDataType(DT_BOOL), 1);
EXPECT_EQ(GetSizeByDataType(DT_DOUBLE), 8);
EXPECT_EQ(GetSizeByDataType(DT_STRING), -1);
EXPECT_EQ(GetSizeByDataType(DT_DUAL_SUB_INT8), 1);
EXPECT_EQ(GetSizeByDataType(DT_DUAL_SUB_UINT8), 1);
EXPECT_EQ(GetSizeByDataType(DT_COMPLEX64), 8);
EXPECT_EQ(GetSizeByDataType(DT_COMPLEX128), 16);
EXPECT_EQ(GetSizeByDataType(DT_QINT8), 1);
EXPECT_EQ(GetSizeByDataType(DT_QINT16), 2);
EXPECT_EQ(GetSizeByDataType(DT_QINT32), 4);
EXPECT_EQ(GetSizeByDataType(DT_QUINT8), 1);
EXPECT_EQ(GetSizeByDataType(DT_QUINT16), 2);
EXPECT_EQ(GetSizeByDataType(DT_RESOURCE), 8);
EXPECT_EQ(GetSizeByDataType(DT_STRING_REF), -1);
EXPECT_EQ(GetSizeByDataType(DT_DUAL), 5);
EXPECT_EQ(GetSizeByDataType(DT_UNDEFINED), -1);
EXPECT_EQ(DT_UNDEFINED, 28);
}
} // namespace formats
} // namespace ge

Loading…
Cancel
Save