<h3 dir="auto">Proposed new feature or change:</h3>
<p dir="auto">Tensorflow and jax extend the numpy dtype system to include bfloat16. (see: <a href="https://github.com/tensorflow/tensorflow/blob/master/tensorflow/python/lib/core/bfloat16.cc">https://github.com/tensorflow/tensorflow/blob/master/tensorflow/python/lib/core/bfloat16.cc</a>)</p>
<p dir="auto">I'm trying to scope out the possibility of upstreaming this into numpy.</p>
<p dir="auto">There is currently an eigen dependency, but I think this could probably be avoided because it is only use to convert to and from float32 and check for nans.</p>
<p dir="auto">Is this the sort of change that numpy would be interested in accepting?</p>
<p dir="auto">There are more accelerator floating point datatypes coming in the future, and we would probably want to add them to numpy as well.<br>
eg:</p>
<ul dir="auto">
<li>E4M3 with 4 exponent bits, 3 mantissa bits, and 1 sign bit.</li>
<li>E5M2, with 5 exponent bits, 2 mantissa bits, and 1 sign bit</li>
</ul>
<h2 dir="auto">Feature</h2>
<p dir="auto">Hi,<br>
I am working at PaddlePaddle(chinese DL framework). We and other DL frameworks would extremely benefit from integrated bfloat16 numpy datatype. I have seen that TF added its own implementation and lately a standalone pip package <a href="https://pypi.org/project/bfloat16/" rel="nofollow">bfloat16</a> was released.<br>
I have also seen NEP 41, 42, 43 which from what I understand will allow adding new, user-defined datatypes. Are you guys planning to integrate bfloat16 into core numpy? If you don't have the bandwidth to do that, is there anyone that can guide me how to implement that so I can make a PR? And how are these NEPs going?</p>