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/04/28 22:03:40 UTC

[GitHub] [tvm] anwang2009 commented on a diff in pull request #11171: [ONNX] Fix cast op to/from bfloat16

anwang2009 commented on code in PR #11171:
URL: https://github.com/apache/tvm/pull/11171#discussion_r861343175


##########
tests/python/frontend/onnx/test_forward.py:
##########
@@ -5174,6 +5172,10 @@ def test_onnx_nodes(target, dev, onnx_test):
         # roialign results to 4 decimal places
         atol = 1e-4
 
+    if "to_BFLOAT16" in test_dir:
+        # casting to BFLOAT has a larger accuracy loss
+        atol = 1

Review Comment:
   nit: curious what the magnitude of expected outputs was, like on the order of 10s, 100s, etc that you saw in the tests? 
   
   1 does seem pretty high and more than I would expect for a cast op -- I would've expected tvm's vs ort's cast implementation to be pretty similar, even for bfloat16. I'm wondering if you have thoughts as to what might cause that discrepancy?



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