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
It's more straightforward/easy to use bfloat16 type to create bfloat16 tensors, which can prevent some confusion. Currently TensorProto.BFLOAT16 is the only one which does not use the same type from NumPy.
Describe the alternatives you have considered
The current method is using numpy.dtype('float32') and then converting it to uint16 values for ONNX, because native NumPy does not support bfloat16 yet: numpy/numpy#19808.
Describe the feature
After native NumPy has supported bfloat16, ideally ONNX's make_tensor should directly use numpy.dtype('bfloat16') to create bfloat16 tensors. Create this PR for tracking. We need to keep float32 to create bfloat16 tensors for compatibility and deprecate it sometime in the later future.
Will this influence the current api?
In the beginning, ONNX should keep the both ways (float32 and bfloat16) for making bfloat16 tensors. After announcing that ONNX will deprecate float32 way to create bfloat16 tensors, then probably in later future make_tensor will only use numpy.dtype('bfloat16') to create bfloat16 tensors instead of numpy.dtype('float32')
Feature Area
Which area in ONNX does this impact? (e.g. model usage, backend, best practices, converters, shape_inference, version_converter, training, test, operators):
Utility
Are you willing to contribute it (Y/N):
Y
The text was updated successfully, but these errors were encountered:
Feature Request
System information
ONNX version (you are using): 1.12
What is the problem that this feature solves?
It's more straightforward/easy to use bfloat16 type to create bfloat16 tensors, which can prevent some confusion. Currently TensorProto.BFLOAT16 is the only one which does not use the same type from NumPy.
Describe the alternatives you have considered
The current method is using numpy.dtype('float32') and then converting it to uint16 values for ONNX, because native NumPy does not support bfloat16 yet: numpy/numpy#19808.
Describe the feature
After native NumPy has supported bfloat16, ideally ONNX's make_tensor should directly use
numpy.dtype('bfloat16')
to create bfloat16 tensors. Create this PR for tracking. We need to keep float32 to create bfloat16 tensors for compatibility and deprecate it sometime in the later future.Will this influence the current api?
In the beginning, ONNX should keep the both ways (float32 and bfloat16) for making bfloat16 tensors. After announcing that ONNX will deprecate float32 way to create bfloat16 tensors, then probably in later future make_tensor will only use numpy.dtype('bfloat16') to create bfloat16 tensors instead of numpy.dtype('float32')
Feature Area
Which area in ONNX does this impact? (e.g. model usage, backend, best practices, converters, shape_inference, version_converter, training, test, operators):
Utility
Are you willing to contribute it (Y/N):
Y
The text was updated successfully, but these errors were encountered: