junrushao1994 commented on a change in pull request #5601:
URL: https://github.com/apache/incubator-tvm/pull/5601#discussion_r441191343



##########
File path: include/tvm/runtime/data_type.h
##########
@@ -72,6 +73,9 @@ class DataType {
     data_.code = static_cast<uint8_t>(code);
     data_.bits = static_cast<uint8_t>(bits);
     data_.lanes = static_cast<uint16_t>(lanes);
+    if (code == kBFloat) {
+      CHECK_EQ(bits, 16);

Review comment:
       It is understandable that right now we only support bf16, but my concern 
is that "should we put the check here"?

##########
File path: include/tvm/runtime/data_type.h
##########
@@ -372,7 +372,7 @@ inline DLDataType String2DLDataType(std::string s) {
     t.lanes = 1;
     return t;
   } else if (s.substr(0, 6) == "bfloat") {
-    t.code = kTVMBFloat;
+    t.code = kDLBfloat;

Review comment:
       I agree with tq

##########
File path: python/tvm/_ffi/_cython/base.pxi
##########
@@ -27,7 +27,7 @@ cdef enum TVMTypeCode:
     kUInt = 1
     kFloat = 2
     kTVMOpaqueHandle = 3
-    kTVMNullptr = 4
+    kBFloat = 4

Review comment:
       shall we remove this?

##########
File path: python/tvm/_ffi/runtime_ctypes.py
##########
@@ -96,6 +98,9 @@ def __init__(self, type_str):
             self.type_code = DataTypeCode.HANDLE
             bits = 64
             head = ""
+        elif head.startswith("bfloat"):
+            self.type_code = 4

Review comment:
       not sure if it is good to hard code here




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


Reply via email to