fierceX opened a new issue #14979: [BUG] Using a package with MKL and GPU versions, using python to open a new process will cause an error URL: https://github.com/apache/incubator-mxnet/issues/14979 Hardware and version information: ----------Python Info---------- Version : 3.6.8 Compiler : GCC 7.3.0 Build : ('default', 'Dec 30 2018 01:22:34') Arch : ('64bit', '') ------------Pip Info----------- Version : 19.1.1 Directory : /home/bird/miniconda3/envs/test/lib/python3.6/site-packages/pip ----------MXNet Info----------- Version : 1.4.1 Directory : /home/bird/miniconda3/envs/test/lib/python3.6/site-packages/mxnet Hashtag not found. Not installed from pre-built package. ----------System Info---------- Platform : Linux-4.15.0-50-generic-x86_64-with-debian-buster-sid system : Linux node : ctmp release : 4.15.0-50-generic version : #54-Ubuntu SMP Mon May 6 18:46:08 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: 94 Model name: Intel(R) Core(TM) i7-6700 CPU @ 3.40GHz Stepping: 3 CPU MHz: 800.218 CPU max MHz: 4000.0000 CPU min MHz: 800.0000 BogoMIPS: 6816.00 Virtualization: VT-x L1d cache: 32K L1i cache: 32K L2 cache: 256K L3 cache: 8192K 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 smx 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 epb invpcid_single pti ssbd ibrs ibpb stibp tpr_shadow vnmi flexpriority ept vpid fsgsbase tsc_adjust bmi1 hle avx2 smep bmi2 erms invpcid rtm mpx rdseed adx smap clflushopt intel_pt xsaveopt xsavec xgetbv1 xsaves dtherm ida arat pln pts hwp hwp_notify hwp_act_window hwp_epp md_clear flush_l1d Python package version ``` Package Version -------------- -------- certifi 2019.3.9 chardet 3.0.4 gluonnlp 0.6.0 graphviz 0.8.4 idna 2.8 mxnet-cu100mkl 1.4.1 numpy 1.14.6 pip 19.1.1 requests 2.22.0 setuptools 41.0.1 urllib3 1.25.2 wheel 0.33.4 ``` In a GPU package with MKL, if you create a new process in Python and use multiple processes to load data at the same time, you will get an error. ```python from multiprocessing import Process import gluonnlp as nlp import numpy as np from gluonnlp.data import SQuAD from mxnet import nd,gluon import mxnet as mx from mxnet.gluon import nn class Transform(object): def __init__(self): pass def __call__(self, record_index, question_id, question, context, answer_list, answer_start_list): return np.ones((100,1)),np.ones((100,3)) def train(): train_data = SQuAD('train') dataloader = gluon.data.DataLoader(train_data.transform(Transform()),batch_size=128, shuffle=True, num_workers=4) net = nn.HybridSequential() net.add(nn.Dense(10)) net.initialize(mx.init.Xavier(), ctx=mx.gpu(0)) print(net) p = Process(target=train) p.start() p.join() ``` ``` Segmentation fault: 11 Stack trace returned 10 entries: [bt] (0) /home/bird/miniconda3/envs/test/lib/python3.6/site-packages/mxnet/libmxnet.so(+0x3f935a) [0x7ff39d25735a] [bt] (1) /home/bird/miniconda3/envs/test/lib/python3.6/site-packages/mxnet/libmxnet.so(+0x3513b36) [0x7ff3a0371b36] [bt] (2) /lib/x86_64-linux-gnu/libc.so.6(+0x3ef20) [0x7ff3e124ff20] [bt] (3) /home/bird/miniconda3/envs/test/lib/python3.6/site-packages/mxnet/libiomp5.so(+0xa9ea5) [0x7ff3dce09ea5] [bt] (4) /home/bird/miniconda3/envs/test/lib/python3.6/site-packages/mxnet/libiomp5.so(+0xa9ba4) [0x7ff3dce09ba4] [bt] (5) /home/bird/miniconda3/envs/test/lib/python3.6/site-packages/mxnet/libmxnet.so(+0x2da4d13) [0x7ff39fc02d13] [bt] (6) /home/bird/miniconda3/envs/test/lib/python3.6/site-packages/mxnet/libmxnet.so(+0x2db56c8) [0x7ff39fc136c8] [bt] (7) /home/bird/miniconda3/envs/test/lib/python3.6/site-packages/mxnet/libmxnet.so(std::shared_ptr<mxnet::engine::ThreadedEnginePerDevice::ThreadWorkerBlock<(dmlc::ConcurrentQueueType)1> > mxnet::common::LazyAllocArray<mxnet::engine::ThreadedEnginePerDevice::ThreadWorkerBlock<(dmlc::ConcurrentQueueType)1> >::Get<mxnet::engine::ThreadedEnginePerDevice::PushToExecute(mxnet::engine::OprBlock*, bool)::{lambda()#2}>(int, mxnet::engine::ThreadedEnginePerDevice::PushToExecute(mxnet::engine::OprBlock*, bool)::{lambda()#2})+0x251) [0x7ff39fc18501] [bt] (8) /home/bird/miniconda3/envs/test/lib/python3.6/site-packages/mxnet/libmxnet.so(+0x2dbd359) [0x7ff39fc1b359] [bt] (9) /home/bird/miniconda3/envs/test/lib/python3.6/site-packages/mxnet/libmxnet.so(+0x2da9428) [0x7ff39fc07428] ``` If you change the mxnet version to `mxnet-cu100-1.4.1`, there will be no errors. Similarly, `mxnet-cu100mkl-1.5.0b20190516` will fail and `mxnet-cu100-1.5.0b20190516` will not go wrong. In addition Using cpu Remove the num_workers parameter Do not create a new process Nothing in any of the above three cases will go wrong
---------------------------------------------------------------- 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: [email protected] With regards, Apache Git Services
