Reported memory consumption in contrast to real memory consumption.
On a M6000 with 12GB the reported memory consumption from MXNet debug_str does not correspond to the real memory consumption measured with nvidia-smi.
cuDNN v5
| Phase | nvidia-smi | debug_str | batch size |
|---|---|---|---|
| Training | 11310 MiB | 6948 MiB | 16 |
| Training | 5752 MiB | 3474 MiB | 8 |
| Prediction | 7208 MiB | 3096 MiB | 16 |
cuDNN v4
| Phase | nvidia-smi | debug_str | batch size |
|---|---|---|---|
| Training | 11307 MiB | 6948 MiB | 16 |
| Prediction | 7442 MiB | 3088 MiB | 16 |
This network consists of
2*(Conv -> LeaktReLU -> BatchNorm) -> Pooling -> 2*(Conv -> LeaktReLU -> BatchNorm) -> Pooling
| |
Concat: UpSampling + UpSampling -> Conv -> Softmax
Debug Str reports internal allocation, such as internal representation, but not includes weight and gradient.
could it be possible to get them equal? I noticed this problem in my previous experiment in #1981. The get_cost function parsed the debug_str to give a memory estimation.
echo @antinucleon debug_str only amounts to the static allocation part of intermediate results, the real execution memory cost is going to be larger.
So the example I am looking at right now is https://gist.github.com/vchuravy/bdd8b080a64621433359d039a1a38ae9
Am I right in assuming that every output that has no storage_id is not part of the internal allocation? Those should be parameters and gradient?
That would leave dynamic allocations?
Is the workspace for deconvolution and convolution reported as part of the total allocated?
no, they are not so far. These are dynamic memory that are allocated in the first pass
We should have all information to compute the minimum size of the workspace during shape-inference. Would it be possible to make allocate workspace statically? I am currently working on a network where workspace is ~5GB with a network size of 3.3GB.
Edit: Maybe we could use aux for this? Or can't those not be shared between convolution. In an ideal world we would calculate the minimum workspace required for each convolution/deconvolution and then take the maximum workspace need and set it for all convolutions. Making memory usage queryable and thus predictable.
.
This issue is closed due to lack of activity in the last 90 days. Feel free to reopen if this is still an active issue. Thanks!