classicsong opened a new issue #16560: It is easy to crash MXNet when tensor 
goes larger
URL: https://github.com/apache/incubator-mxnet/issues/16560
 
 
   ## Description
   When I use large tensor, it is easy to crash the MXNet kernel.
   Using following python code to reproduce:
   
   ```
   >>> import mxnet.ndarray as nd
   
   >>> a = nd.random.randn(4, 256, 1, 100, 100)
   >>> b = nd.broadcast_axis(a, axis=2, size=256)
   >>> b.size
   2621440000
   >>> b.asnumpy()
   CRASH HERE
   ```
   The error looks like an int32 overflow on shape.size.
   Any easy way to fix this out? The only way I found out is to compile MXNet 
with USE_INT64_TENSOR_SIZE = ON, which is slower than the default one.
   
   ## Environment info (Required)
   mxnet 1.5.1 (pip3 install)
   
   Package used (Python/R/Scala/Julia):
   Python
   
   ## Error Message:
   ```
   Traceback (most recent call last):
     File "<stdin>", line 1, in <module>
     File "/usr/local/lib/python3.5/dist-packages/mxnet/ndarray/ndarray.py", 
line 1996, in asnumpy
       ctypes.c_size_t(data.size)))
     File "/usr/local/lib/python3.5/dist-packages/mxnet/base.py", line 253, in 
check_call
       raise MXNetError(py_str(_LIB.MXGetLastError()))
   mxnet.base.MXNetError: [07:26:09] include/mxnet/././tensor_blob.h:290: Check 
failed: this->shape_.Size() == static_cast<size_t>(shape.Size()) (2621440000 
vs. 18446744072036024320) : TBlob.get_with_shape: new and old shape do not 
match total elements
   ```

----------------------------------------------------------------
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:
us...@infra.apache.org


With regards,
Apache Git Services

Reply via email to