You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tvm.apache.org by GitBox <gi...@apache.org> on 2022/06/26 11:13:27 UTC

[GitHub] [tvm] Qianshui-Jiang opened a new pull request, #11902: [DNNL] Add bfloat16 type support for dnnl conv2d kernel

Qianshui-Jiang opened a new pull request, #11902:
URL: https://github.com/apache/tvm/pull/11902

   Added bfloat16 for dnnl conv2d kernel in order to coordinate with bf16/fp32 mixed precision mode, 
   which implemented ny changing the type of dnnl primitive descriptor & memory descripor accoring to src/dst data format during the declaration.
   
   Test case also modified for both bf16 & fp32. 


-- 
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.

To unsubscribe, e-mail: commits-unsubscribe@tvm.apache.org

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


[GitHub] [tvm] driazati commented on pull request #11902: [DNNL] Add bfloat16 type support for dnnl conv2d kernel

Posted by GitBox <gi...@apache.org>.
driazati commented on PR #11902:
URL: https://github.com/apache/tvm/pull/11902#issuecomment-1167525831

   @tvm-bot rerun


-- 
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.

To unsubscribe, e-mail: commits-unsubscribe@tvm.apache.org

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


[GitHub] [tvm] Qianshui-Jiang commented on pull request #11902: [DNNL] Add bfloat16 type support for dnnl conv2d kernel

Posted by GitBox <gi...@apache.org>.
Qianshui-Jiang commented on PR #11902:
URL: https://github.com/apache/tvm/pull/11902#issuecomment-1168164760

   > LGTM. Just a nit.
   
   thx a lot !


-- 
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.

To unsubscribe, e-mail: commits-unsubscribe@tvm.apache.org

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


[GitHub] [tvm] comaniac merged pull request #11902: [DNNL] Add bfloat16 type support for dnnl conv2d kernel

Posted by GitBox <gi...@apache.org>.
comaniac merged PR #11902:
URL: https://github.com/apache/tvm/pull/11902


-- 
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.

To unsubscribe, e-mail: commits-unsubscribe@tvm.apache.org

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


[GitHub] [tvm] comaniac commented on pull request #11902: [DNNL] Add bfloat16 type support for dnnl conv2d kernel

Posted by GitBox <gi...@apache.org>.
comaniac commented on PR #11902:
URL: https://github.com/apache/tvm/pull/11902#issuecomment-1168169212

   Thanks @Qianshui-Jiang 


-- 
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.

To unsubscribe, e-mail: commits-unsubscribe@tvm.apache.org

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


[GitHub] [tvm] Qianshui-Jiang commented on pull request #11902: [DNNL] Add bfloat16 type support for dnnl conv2d kernel

Posted by GitBox <gi...@apache.org>.
Qianshui-Jiang commented on PR #11902:
URL: https://github.com/apache/tvm/pull/11902#issuecomment-1167084965

   seems CI was blocked,  cc @comaniac  @masahi ,  could you pls help to take a review of this PR? 


-- 
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.

To unsubscribe, e-mail: commits-unsubscribe@tvm.apache.org

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


[GitHub] [tvm] comaniac commented on a diff in pull request #11902: [DNNL] Add bfloat16 type support for dnnl conv2d kernel

Posted by GitBox <gi...@apache.org>.
comaniac commented on code in PR #11902:
URL: https://github.com/apache/tvm/pull/11902#discussion_r907609150


##########
python/tvm/contrib/dnnl.py:
##########
@@ -113,6 +113,17 @@ def dnnl_conv2d(
     else:
         dilation_h, dilation_w = dilation
 
+    pre_cast = False
+    post_cast = False
+    if src.dtype == "float32":
+        pre_cast = True
+    elif src.dtype == "bfloat16":
+        pre_cast = False
+    if out_dtype == "float32":
+        post_cast = True
+    elif out_dtype == "bfloat16":
+        post_cast = False

Review Comment:
   ```suggestion
       pre_cast = src.dtype == "float32"
       post_cast = out_dtype == "float32"
   ```



-- 
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.

To unsubscribe, e-mail: commits-unsubscribe@tvm.apache.org

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