rvardimon opened a new issue #15148: Very Large CPU RAM Memory Consumption (>1GB) URL: https://github.com/apache/incubator-mxnet/issues/15148 ## Description Mxnet consumes nearly 2GB CPU RAM even when loading a relatively small model (e.g. Resnet-18) on directed on GPU (`ctx=mxnet.gpu()`). From what I understand, there is no real need to load so much CPU memory, when the model is running on GPU. This issue is extremely prohibitive when trying to run multiple processes with mxnet on the same machine, and IMO gives it a significant disadvantage compared to other frameworks for being used in AI production systems. ## Environment info ``` /usr/bin/python3.6 /home/ran-face/src/CameraResearch/workspace/mxnet_diagnose.py ----------Python Info---------- Version : 3.6.7 Compiler : GCC 8.2.0 Build : ('default', 'Oct 22 2018 11:32:17') Arch : ('64bit', 'ELF') ------------Pip Info----------- Version : 9.0.1 Directory : /usr/lib/python3/dist-packages/pip ----------MXNet Info----------- Version : 1.3.1 Directory : /usr/local/lib/python3.6/dist-packages/mxnet Commit Hash : 19c501680183237d52a862e6ae1dc4ddc296305b ----------System Info---------- Platform : Linux-4.15.0-45-generic-x86_64-with-Ubuntu-18.04-bionic system : Linux node : ranface-Lenovo-Y720-15IKB release : 4.15.0-45-generic version : #48-Ubuntu SMP Tue Jan 29 16:28:13 UTC 2019 ----------Hardware Info---------- machine : x86_64 processor : x86_64 Architecture: x86_64 CPU op-mode(s): 32-bit, 64-bit Byte Order: Little Endian CPU(s): 8 On-line CPU(s) list: 0-7 Thread(s) per core: 2 Core(s) per socket: 4 Socket(s): 1 NUMA node(s): 1 Vendor ID: GenuineIntel CPU family: 6 Model: 158 Model name: Intel(R) Core(TM) i7-7700HQ CPU @ 2.80GHz Stepping: 9 CPU MHz: 2411.711 CPU max MHz: 3800.0000 CPU min MHz: 800.0000 BogoMIPS: 5616.00 Virtualization: VT-x L1d cache: 32K L1i cache: 32K L2 cache: 256K L3 cache: 6144K NUMA node0 CPU(s): 0-7 Flags: fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe syscall nx pdpe1gb rdtscp lm constant_tsc art arch_perfmon pebs bts rep_good nopl xtopology nonstop_tsc cpuid aperfmperf tsc_known_freq pni pclmulqdq dtes64 monitor ds_cpl vmx est tm2 ssse3 sdbg fma cx16 xtpr pdcm pcid sse4_1 sse4_2 x2apic movbe popcnt tsc_deadline_timer aes xsave avx f16c rdrand lahf_lm abm 3dnowprefetch cpuid_fault invpcid_single pti ssbd ibrs ibpb stibp tpr_shadow vnmi flexpriority ept vpid fsgsbase tsc_adjust bmi1 avx2 smep bmi2 erms invpcid mpx rdseed adx smap clflushopt intel_pt xsaveopt xsavec xgetbv1 xsaves dtherm ida arat pln pts hwp hwp_notify hwp_act_window hwp_epp flush_l1d ----------Network Test---------- Setting timeout: 10 Timing for MXNet: https://github.com/apache/incubator-mxnet, DNS: 0.0694 sec, LOAD: 0.9665 sec. Timing for Gluon Tutorial(en): http://gluon.mxnet.io, DNS: 0.0841 sec, LOAD: 1.2019 sec. Timing for Gluon Tutorial(cn): https://zh.gluon.ai, DNS: 0.0988 sec, LOAD: 0.9435 sec. Timing for FashionMNIST: https://apache-mxnet.s3-accelerate.dualstack.amazonaws.com/gluon/dataset/fashion-mnist/train-labels-idx1-ubyte.gz, DNS: 0.0708 sec, LOAD: 1.2242 sec. Timing for PYPI: https://pypi.python.org/pypi/pip, DNS: 0.0637 sec, LOAD: 1.3118 sec. Timing for Conda: https://repo.continuum.io/pkgs/free/, DNS: 0.0499 sec, LOAD: 0.3116 sec. Process finished with exit code 0 ``` Package used (Python/R/Scala/Julia): I'm using Python3 ## Build info mxnet installed using pip3 ## Steps to reproduce (Paste the commands you ran that produced the error.) 1. Run the following code ``` import mxnet as mx import time if __name__ == '__main__': path='http://data.mxnet.io/models/imagenet/' [mx.test_utils.download(path+'resnet/18-layers/resnet-18-0000.params'), mx.test_utils.download(path+'resnet/18-layers/resnet-18-symbol.json'), mx.test_utils.download(path+'synset.txt')] ctx = mx.gpu() sym, arg_params, aux_params = mx.model.load_checkpoint('resnet-18', 0) mod = mx.mod.Module(symbol=sym, context=ctx, label_names=None) mod.bind(for_training=False, data_shapes=[('data', (1,3,224,224))], label_shapes=mod._label_shapes) mod.set_params(arg_params, aux_params, allow_missing=True) time.sleep(100) ``` 2. check process memory (run top, shift M to sort processes by memory usage) 3. memory usage is about ~1.5-2GB RAM
---------------------------------------------------------------- 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