You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mxnet.apache.org by GitBox <gi...@apache.org> on 2020/07/25 00:23:58 UTC

[GitHub] [incubator-mxnet] leezu opened a new issue #18788: bfloat16 rendered as uint16

leezu opened a new issue #18788:
URL: https://github.com/apache/incubator-mxnet/issues/18788


   ```
   [ins] In [1]: import mxnet as mx
   
   [ins] In [3]: a = mx.nd.arange(10)
   
   [ins] In [6]: import numpy as np
   
   [ins] In [7]: a.astype(np.dtype([('bfloat16', np.uint16)]))
   Out[7]:
   
   [(    0,) (16256,) (16384,) (16448,) (16512,) (16544,) (16576,) (16608,)
    (16640,) (16656,)]
   <NDArray 10 @cpu(0)>
   ```


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

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-mxnet] rongzha1 commented on issue #18788: bfloat16 rendered as uint16

Posted by GitBox <gi...@apache.org>.
rongzha1 commented on issue #18788:
URL: https://github.com/apache/incubator-mxnet/issues/18788#issuecomment-664738282


   @piotr


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

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-mxnet] ElaineBao commented on issue #18788: bfloat16 rendered as uint16

Posted by GitBox <gi...@apache.org>.
ElaineBao commented on issue #18788:
URL: https://github.com/apache/incubator-mxnet/issues/18788#issuecomment-670341638


   As @leezu said, numpy doesn't support the data type of `bfloat16`, when printing a NDArray as type `bfloat16`, it will be printed as pre-defined `uint16`. 
   
   I think it's not a bug actually, if printing a NDArray has to work via converting to numpy, and numpy has no support of `bfloat16`, the only way to print is converting to another numpy supported data type.


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

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-mxnet] leezu commented on issue #18788: bfloat16 rendered as uint16

Posted by GitBox <gi...@apache.org>.
leezu commented on issue #18788:
URL: https://github.com/apache/incubator-mxnet/issues/18788#issuecomment-670577338


   @ElaineBao I agree it's expected for people who understand how the internal mxnet printing logic works. But I'm not sure if this is the optimal user experience.


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

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-mxnet] leezu commented on issue #18788: bfloat16 rendered as uint16

Posted by GitBox <gi...@apache.org>.
leezu commented on issue #18788:
URL: https://github.com/apache/incubator-mxnet/issues/18788#issuecomment-665793579


   MXNet bfloat16 type is registered as having numpy equivalent `np.dtype([('bfloat16', np.uint16)])`:
   
    https://github.com/apache/incubator-mxnet/blob/c1098aa33d6795f84a19601d0319d5bb8e19f317/python/mxnet/ndarray/ndarray.py#L86
   
   As printing a NDArray works via converting to numpy, this causes `bfloat16` arrays to be printed as `uint16`.
   
   The fundamental issue here is that numpy does not support `bfloat16`. We can consider if there is a better solution


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

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-mxnet] pengzhao-intel commented on issue #18788: bfloat16 rendered as uint16

Posted by GitBox <gi...@apache.org>.
pengzhao-intel commented on issue #18788:
URL: https://github.com/apache/incubator-mxnet/issues/18788#issuecomment-683538227


   @anko-intel 


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

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@mxnet.apache.org
For additional commands, e-mail: issues-help@mxnet.apache.org


[GitHub] [incubator-mxnet] samskalicky commented on issue #18788: bfloat16 rendered as uint16

Posted by GitBox <gi...@apache.org>.
samskalicky commented on issue #18788:
URL: https://github.com/apache/incubator-mxnet/issues/18788#issuecomment-670824689


   > MXNet bfloat16 type is registered as having numpy equivalent `np.dtype([('bfloat16', np.uint16)])`:
   > 
   > https://github.com/apache/incubator-mxnet/blob/c1098aa33d6795f84a19601d0319d5bb8e19f317/python/mxnet/ndarray/ndarray.py#L86
   > 
   > As printing a NDArray works via converting to numpy, this causes `bfloat16` arrays to be printed as `uint16`.
   > 
   > The fundamental issue here is that numpy does not support `bfloat16`. We can consider if there is a better solution
   
   Should we just convert to float32 in Numpy?


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

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-mxnet] leezu closed issue #18788: bfloat16 rendered as uint16

Posted by GitBox <gi...@apache.org>.
leezu closed issue #18788:
URL: https://github.com/apache/incubator-mxnet/issues/18788


   


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

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@mxnet.apache.org
For additional commands, e-mail: issues-help@mxnet.apache.org


[GitHub] [incubator-mxnet] szha commented on issue #18788: bfloat16 rendered as uint16

Posted by GitBox <gi...@apache.org>.
szha commented on issue #18788:
URL: https://github.com/apache/incubator-mxnet/issues/18788#issuecomment-663941201


   cc @rongzha1 @pengzhao-intel 


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

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-mxnet] pengzhao-intel commented on issue #18788: bfloat16 rendered as uint16

Posted by GitBox <gi...@apache.org>.
pengzhao-intel commented on issue #18788:
URL: https://github.com/apache/incubator-mxnet/issues/18788#issuecomment-670336291


   @ElaineBao could you explain the background?


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

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-mxnet] rongzha1 edited a comment on issue #18788: bfloat16 rendered as uint16

Posted by GitBox <gi...@apache.org>.
rongzha1 edited a comment on issue #18788:
URL: https://github.com/apache/incubator-mxnet/issues/18788#issuecomment-664738282


   @bgawrych @luc,pior


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

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-mxnet] sxjscience commented on issue #18788: bfloat16 rendered as uint16

Posted by GitBox <gi...@apache.org>.
sxjscience commented on issue #18788:
URL: https://github.com/apache/incubator-mxnet/issues/18788#issuecomment-673703215


   Is it possible to customized a dtype in numpy just for printing?


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

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-mxnet] ElaineBao commented on issue #18788: bfloat16 rendered as uint16

Posted by GitBox <gi...@apache.org>.
ElaineBao commented on issue #18788:
URL: https://github.com/apache/incubator-mxnet/issues/18788#issuecomment-670796064


   Yes, I think so, it's not that friendly for users to print out `bfloat16` values. We can consider if there is a better solution for this.


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

For queries about this service, please contact Infrastructure at:
users@infra.apache.org