matteosal opened a new issue, #21075:
URL: https://github.com/apache/incubator-mxnet/issues/21075

   This script runs a large convolution operator:
   ```
   import mxnet as mx
   import os, psutil
   
   device = mx.cpu()
   
   sym = mx.sym.Convolution(
        mx.sym.Variable('in'), 
        mx.sym.Variable('w'), 
        mx.sym.Variable('b'),
        kernel=(25, 25, 25), 
        num_filter=1
   )
   inputs = {
        'in': mx.nd.zeros([1, 1, 134, 284, 284], ctx=device), 
        'w': mx.nd.zeros([1, 1, 25, 25, 25], ctx=device),
        'b': mx.nd.zeros([1], ctx=device)
   }
   
   cached_op = mx.ndarray.CachedOp(sym)
   output = cached_op(*inputs.values(), default_ctx=device)
   mx.ndarray.waitall()
   print(output.shape)
   ```
   
   I have 32GB of system memory + 50GB of swap space, and the script fails very 
quickly with this error: 
   ```
   Traceback (most recent call last):
     File "script.py", line 21, in <module>
       mx.ndarray.waitall()
     File "/home/matteo/Git/mxnet/python/mxnet/ndarray/ndarray.py", line 240, 
in waitall
       check_call(_LIB.MXNDArrayWaitAll())
     File "/home/matteo/Git/mxnet/python/mxnet/base.py", line 246, in check_call
       raise get_last_ffi_error()
   mxnet.base.MXNetError: Traceback (most recent call last):
     File 
"/Developer/teamcity/work/cd49599405c3204/mxnet-build/Build/Linux-x86-64/CUDA/mxnet/src/storage/./pooled_storage_manager.h",
 line 192
   MXNetError: Memory allocation failed Cannot allocate memory
   ```
   
   But changing the line `device = mx.cpu()` with `device = mx.gpu()` makes the 
script work, even if I have a GTX 1650 with only 4GB of memory.


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

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to