You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Tests that use bfloat16 as model input/ouput (listed in [0]) are disabled in most backends (see e.g. here). On one side, this can be problematic for other backends and, on the other, it becomes unclear what is the level of support for bfloat16.
A quick look at the test runner shows that there is support forTensorProto.BFLOAT16 where the data - in that format - gets converted to float32 through numpy_helper.bfloat16_to_float32. The problem with the test cases mentioned before is that the output_*.pb files seem to be read the reference data as TensorProto.UINT16, which then never triggers the expected conversion to float32.
I'm not sure if converting to float32 is the expected behavior but I'm assuming so, for the purpose of this discussion.
…ntation (onnx#6166)
### Description
Supports bfloat16 binary, unary operations if ml_dtypes is installed.
Partially answer onnx#6151.
### Motivation and Context
numpy does not support bfloat16 natively but pytorch or tensorflow does.
The reference implementation should support that as well.
---------
Signed-off-by: Xavier Dupre <xadupre@microsoft.com>
Signed-off-by: Xavier Dupré <xadupre@users.noreply.github.com>
Co-authored-by: Justin Chu <justinchuby@users.noreply.github.com>
Bug Report
Is the issue related to model conversion?
No
Describe the bug
Tests that use bfloat16 as model input/ouput (listed in [0]) are disabled in most backends (see e.g. here). On one side, this can be problematic for other backends and, on the other, it becomes unclear what is the level of support for bfloat16.
A quick look at the test runner shows that there is support for
TensorProto.BFLOAT16
where the data - in that format - gets converted tofloat32
throughnumpy_helper.bfloat16_to_float32
. The problem with the test cases mentioned before is that theoutput_*.pb
files seem to be read the reference data asTensorProto.UINT16
, which then never triggers the expected conversion tofloat32
.I'm not sure if converting to
float32
is the expected behavior but I'm assuming so, for the purpose of this discussion.Related issue
[0]
System information
Expected behavior
Unsure. By looking at the code, the output for the tests that return
bfloat16
should be innp.float32
not innp.uint16
formatThe text was updated successfully, but these errors were encountered: