apache / mxnet

Lightweight, Portable, Flexible Distributed/Mobile Deep Learning with Dynamic, Mutation-aware Dataflow Dep Scheduler; for Python, R, Julia, Scala, Go, Javascript and more
https://mxnet.apache.org
Apache License 2.0
20.78k stars 6.79k forks source link

memory corruption error while trying to train BERT #16539

Open larroy opened 5 years ago

larroy commented 5 years ago

Note: Providing complete information in the most concise form is the best way to get help. This issue template serves as the checklist for essential information to most of the technical issues and bug reports. For non-technical issues and feature requests, feel free to present the information in what you believe is the best form.

For Q & A and discussion, please start a discussion thread at https://discuss.mxnet.io

Description

Environment info (Required)

http://ix.io/1Z8y

Architecture:        x86_64
CPU op-mode(s):      32-bit, 64-bit
Byte Order:          Little Endian
CPU(s):              96
On-line CPU(s) list: 0-95
Thread(s) per core:  2
Core(s) per socket:  24
Socket(s):           2
NUMA node(s):        2
Vendor ID:           GenuineIntel
CPU family:          6
Model:               85
Model name:          Intel(R) Xeon(R) Platinum 8175M CPU @ 2.50GHz
Stepping:            4
CPU MHz:             1617.763
BogoMIPS:            4999.99
Hypervisor vendor:   KVM
Virtualization type: full
L1d cache:           32K
L1i cache:           32K
L2 cache:            1024K
L3 cache:            33792K
NUMA node0 CPU(s):   0-23,48-71
NUMA node1 CPU(s):   24-47,72-95
Flags:               fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush mmx fxsr sse sse2 ss ht syscall nx pdpe1gb rdtscp lm constant_tsc arch_perfmon rep_good nopl xtopology nonstop_tsc cpuid aperfmperf tsc_known_freq pni pclmulqdq monitor ssse3 fma cx16 pcid sse4_1 sse4_2 x2apic movbe popcnt tsc_deadline_timer aes xsave avx f16c rdrand hypervisor lahf_lm abm 3dnowprefetch invpcid_single pti fsgsbase tsc_adjust bmi1 hle avx2 smep bmi2 erms invpcid rtm mpx avx512f avx512dq rdseed adx smap clflushopt clwb avx512cd avx512bw avx512vl xsaveopt xsavec xgetbv1 xsaves ida arat pku ospke
----------Python Info----------
Version      : 3.6.8
Compiler     : GCC 8.0.1 20180414 (experimental) [trunk revision 259383
Build        : ('default', 'Jan 14 2019 11:02:34')
Arch         : ('64bit', 'ELF')
------------Pip Info-----------
Version      : 19.2.3
Directory    : /usr/local/lib/python3.6/dist-packages/pip
----------MXNet Info-----------
Version      : 1.5.0
Directory    : /opt/mxnet/python/mxnet
Commit hash file "/opt/mxnet/python/mxnet/COMMIT_HASH" not found. Not installed from pre-built package or built from source.
Library      : ['/usr/local/lib/libmxnet.so']
Build features:
✔ CUDA
✔ CUDNN
✔ NCCL
✔ CUDA_RTC
✔ TENSORRT
✔ CPU_SSE
✔ CPU_SSE2
✔ CPU_SSE3
✔ CPU_SSE4_1
✔ CPU_SSE4_2
✖ CPU_SSE4A
✔ CPU_AVX
✖ CPU_AVX2
✖ OPENMP
✖ SSE
✔ F16C
✖ JEMALLOC
✖ BLAS_OPEN
✖ BLAS_ATLAS
✖ BLAS_MKL
✖ BLAS_APPLE
✔ LAPACK
✖ MKLDNN
✔ OPENCV
✖ CAFFE
✖ PROFILER
✔ DIST_KVSTORE
✖ CXX14
✖ INT64_TENSOR_SIZE
✖ SIGNAL_HANDLER
✖ DEBUG
----------System Info----------
Platform     : Linux-4.14.114-83.126.amzn1.x86_64-x86_64-with-Ubuntu-18.04-bionic
system       : Linux
node         : ip-172-31-29-65
release      : 4.14.114-83.126.amzn1.x86_64
version      : #1 SMP Tue May 7 02:26:58 UTC 2019
----------Hardware Info----------
machine      : x86_64
processor    : x86_64
----------Network Test----------
Setting timeout: 10
Timing for MXNet: https://github.com/apache/incubator-mxnet, DNS: 0.0018 sec, LOAD: 0.6100 sec.
Timing for Gluon Tutorial(en): http://gluon.mxnet.io, DNS: 0.0055 sec, LOAD: 0.0597 sec.
Timing for Gluon Tutorial(cn): https://zh.gluon.ai, DNS: 0.0004 sec, LOAD: 0.0928 sec.
Timing for FashionMNIST: https://apache-mxnet.s3-accelerate.dualstack.amazonaws.com/gluon/dataset/fashion-mnist/train-labels-idx1-ubyte.gz, DNS: 0.0004 sec, LOAD: 0.0701 sec.
Timing for PYPI: https://pypi.python.org/pypi/pip, DNS: 0.0010 sec, LOAD: 0.1455 sec.
Timing for Conda: https://repo.continuum.io/pkgs/free/, DNS: 0.0002 sec, LOAD: 0.0510 sec.
----------Environment----------
MXNET_VERSION="1.5.0"
MXNET_OPTIMIZER_AGGREGATION_SIZE="60"
MXNET_USE_OPERATOR_TUNING="0"
MXNET_GPU_COPY_NTHREADS="1"
MXNET_HOME="/opt/mxnet"
MXNET_CUDNN_AUTOTUNE_DEFAULT="2"

Build info (Required if built from source)

Compiler (gcc/clang/mingw/visual studio):

MXNet commit hash: (Paste the output of git rev-parse HEAD here.)

Build config: (Paste the content of config.mk, or the build command.)

Error Message:

--------------------------------------------------------------------------
[1,5]<stderr>:malloc(): memory corruption
[1,5]<stderr>:[ip-172-31-29-65:00109] *** Process received signal ***
[1,5]<stderr>:[ip-172-31-29-65:00109] Signal: Aborted (6)
[1,5]<stderr>:[ip-172-31-29-65:00109] Signal code:  (-6)
[1,5]<stderr>:[ip-172-31-29-65:00109] [ 0] [ip-172-31-29-65:00109] *** Process received signal ***
[1,5]<stderr>:/lib/x86_64-linux-gnu/libc.so.6(+0x3ef20)[0x7f3b606f4f20]
[1,5]<stderr>:[ip-172-31-29-65:00109] [ 1] [ip-172-31-29-65:00109] Signal: Segmentation fault (11)
[1,5]<stderr>:[ip-172-31-29-65:00109] Signal code: Invalid permissions (2)
[1,5]<stderr>:[ip-172-31-29-65:00109] Failing at address: 0x7f39fc021008
[1,5]<stderr>:/lib/x86_64-linux-gnu/libc.so.6(gsignal+0xc7)[0x7f3b606f4e97]
[1,5]<stderr>:[ip-172-31-29-65:00109] [ 2] [ip-172-31-29-65:00109] [ 0] /lib/x86_64-linux-gnu/libc.so.6(abort+0x141)[0x7f3b606f6801]
[1,5]<stderr>:[ip-172-31-29-65:00109] [ 3] /lib/x86_64-linux-gnu/libc.so.6(+0x3ef20)[0x7f3b606f4f20]
[1,5]<stderr>:[ip-172-31-29-65:00109] [ 1] /usr/local/lib/libmxnet.so(_ZNSt6vectorISt10shared_ptrINSt15__exception_ptr13exception_ptrEESaIS3_EE17_M_realloc_insertIJRKS3_EEEvN9__gnu_cxx17__normal_ite
ratorIPS3_S5_EEDpOT_+0xb4)[0x7f3a85fc41d4]
[1,5]<stderr>:[ip-172-31-29-65:00109] [ 2] /lib/x86_64-linux-gnu/libc.so.6(+0x89897)[0x7f3b6073f897]
[1,5]<stderr>:[ip-172-31-29-65:00109] [ 4] /usr/local/lib/libmxnet.so(_ZN5mxnet6engine14ThreadedEngine10OnCompleteEPNS0_11ThreadedOprE+0xddb)[0x7f3a85fd1a5b]
[1,5]<stderr>:[ip-172-31-29-65:00109] [ 3] /lib/x86_64-linux-gnu/libc.so.6(+0x9090a)[0x7f3b6074690a]
[1,5]<stderr>:[ip-172-31-29-65:00109] [ 5] /usr/local/lib/libmxnet.so(_ZN5mxnet6engine14ThreadedEngine16OnCompleteStaticEPNS_6EngineEPvPKN4dmlc5ErrorE+0x13e)[0x7f3a85fcbd4e]
[1,5]<stderr>:[ip-172-31-29-65:00109] [ 4] /lib/x86_64-linux-gnu/libc.so.6(+0x94994)[0x7f3b6074a994]
[1,5]<stderr>:[ip-172-31-29-65:00109] [ 6] /lib/x86_64-linux-gnu/libc.so.6(__libc_malloc+0x27d)[0x7f3b6074d2ed]
[1,5]<stderr>:[ip-172-31-29-65:00109] [ 7] /usr/local/lib/libmxnet.so(_ZN5mxnet6engine14ThreadedEngine15ExecuteOprBlockENS_10RunContextEPNS0_8OprBlockE+0xbd3)[0x7f3a85fc5253]
[1,5]<stderr>:[ip-172-31-29-65:00109] [ 5] /usr/lib/x86_64-linux-gnu/libstdc++.so.6(__cxa_allocate_exception+0x10)[0x7f3b5246b8f0]
[1,5]<stderr>:[ip-172-31-29-65:00109] [ 8] /usr/local/lib/python3.6/dist-packages/horovod-0.18.1-py3.6-linux-x86_64.egg/horovod/mxnet/mpi_lib.cpython-36m-x86_64-linux-gnu.so(_ZN7horovod5mxnet27DoHor
ovodOperationCudaOnCPUEPvS1_S1_+0x125d)[0x7f39ce54f6dd]
[1,5]<stderr>:[ip-172-31-29-65:00109] [ 9] /usr/local/lib/libmxnet.so(_ZNSt17_Function_handlerIFvSt10shared_ptrIN4dmlc11ManualEventEEEZN5mxnet6engine23ThreadedEnginePerDevice5StartEvEUlS3_E_E9_M_inv
okeERKSt9_Any_dataOS3_+0xf8)[0x7f3a85fda668]
[1,5]<stderr>:[ip-172-31-29-65:00109] [ 6] /usr/local/lib/libmxnet.so(+0x3e6624c)[0x7f3a8604724c]
[1,5]<stderr>:[ip-172-31-29-65:00109] [10] /usr/local/lib/libmxnet.so(_ZNSt6thread11_State_implINS_8_InvokerISt5tupleIJSt8functionIFvSt10shared_ptrIN4dmlc11ManualEventEEEES7_EEEEE6_M_runEv+0x4a)[0x7
f3a85fc379a]
[1,5]<stderr>:[ip-172-31-29-65:00109] [ 7] /usr/local/lib/libmxnet.so(_ZN5mxnet6engine14ThreadedEngine15ExecuteOprBlockENS_10RunContextEPNS0_8OprBlockE+0x5b5)[0x7f3a85fc4c35]
[1,5]<stderr>:[ip-172-31-29-65:00109] [11] /usr/lib/x86_64-linux-gnu/libstdc++.so.6(+0xbd66f)[0x7f3b5249766f]
[1,5]<stderr>:[ip-172-31-29-65:00109] [ 8] /usr/local/lib/libmxnet.so(_ZNSt17_Function_handlerIFvSt10shared_ptrIN4dmlc11ManualEventEEEZN5mxnet6engine23ThreadedEnginePerDevice5StartEvEUlS3_E_E9_M_inv
okeERKSt9_Any_dataOS3_+0xf8)[0x7f3a85fda668]
[1,5]<stderr>:[ip-172-31-29-65:00109] [12] /lib/x86_64-linux-gnu/libpthread.so.0(+0x76db)[0x7f3b6049e6db]
[1,5]<stderr>:[ip-172-31-29-65:00109] [ 9] /usr/local/lib/libmxnet.so(_ZNSt6thread11_State_implINS_8_InvokerISt5tupleIJSt8functionIFvSt10shared_ptrIN4dmlc11ManualEventEEEES7_EEEEE6_M_runEv+0x4a)[0x7
f3a85fc379a]
[1,5]<stderr>:[ip-172-31-29-65:00109] [13] /lib/x86_64-linux-gnu/libc.so.6(clone+0x3f)[0x7f3b607d788f]
[1,5]<stderr>:[ip-172-31-29-65:00109] *** End of error message ***

Minimum reproducible example

(If you are using your own code, please provide a short script that reproduces the error. Otherwise, please provide link to the existing example.)

Steps to reproduce

I'm using the gluon-nlp scripts to train.

leezu commented 5 years ago

Can you provide the complete command you use for training? When does the corruption happen?

larroy commented 5 years ago

@eric-haibin-lin I used his container....

nvidia-docker run -it --security-opt seccomp:unconfined --privileged   -v ~/.ssh:/root/.ssh                        -v ~/mxnet-data/bert-pretraining/datasets:/data   --network=host --shm-size=32768m --ulimit nofile=65536:65536 haibinlin/nvidia:1909-lamb-trunc-ssh-bind
root@ip-172-31-29-65:/workspace/gluon-nlp/scripts/bert# bash cmd.sh
libibverbs: Warning: no userspace device-specific driver found for /sys/class/infiniband_verbs/uverbs0