MargaretQian commented on code in PR #11171:
URL: https://github.com/apache/tvm/pull/11171#discussion_r863306492
##########
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:
i was hoping to keep the edge case handling to a minimum since this is a
common test function. I understand that reinterpreting to bfloat16 would allow
the tolerance to seem lower, but it would require adding a lot more code to
`test_onnx_nodes` in order to handle just the single `to_bfloat16` unit test
(i.e. I'd have to reinterpret both the expected onnx output and the tvm output
to bfloat16) -- would you say we should still have the reinterpret cast?
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]