You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mxnet.apache.org by GitBox <gi...@apache.org> on 2018/06/28 19:44:44 UTC

[GitHub] larroy opened a new issue #11468: Inconsistent / wrong output from sum

larroy opened a new issue #11468: Inconsistent / wrong output from sum
URL: https://github.com/apache/incubator-mxnet/issues/11468
 
 
   Followup of problems found during https://github.com/apache/incubator-mxnet/issues/9853
   
   ## Description
   Output inconsistent across runs and wrong when summing two arrays, also observed for other operators like bmod. But only after running sum.
   
   Couldn't reproduce with the pip installable package for 1.3.0
   Can't reproduce without debug flags
   
   ```
     output:
     [[2.5355392  3.314111   2.1423295 ]
      [4.1634665  3.7890441  3.1607347 ]
      [3.2863414  2.973648   3.8752291 ]
      [1.704005   0.11532945 4.315019  ]]
     data:
     [array([[0.51929279, 0.71588298, 0.70266935],
            [0.98779978, 0.36271363, 0.0987926 ],
            [0.95248205, 0.98068743, 0.01229028],
            [0.28883612, 0.06484356, 0.32346107]]), array([[0.5040616 , 0.86607602, 0.35991496],
            [0.79391669, 0.85658257, 0.76548548],
            [0.77795309, 0.66432023, 0.96573467],
            [0.471723  , 0.02524295, 0.99788945]])]
   ```
   
   ## Environment info (Required)
   ```
   Ubuntu 16.04 c5d.18xlarge
   ```
   
   ```
   ----------Python Info----------
   Version      : 3.5.2
   Compiler     : GCC 5.4.0 20160609
   Build        : ('default', 'Nov 23 2017 16:37:01')
   Arch         : ('64bit', 'ELF')
   ------------Pip Info-----------
   Version      : 10.0.1
   Directory    : /home/piotr/mxnet/mxnet_py3/lib/python3.5/site-packages/pip
   ----------MXNet Info-----------
   [19:29:52] ../src/engine/engine.cc:55: MXNet start using engine: NaiveEngine
   Version      : 1.3.0
   Directory    : /home/piotr/mxnet/python/mxnet
   Hashtag not found. Not installed from pre-built package.
   ----------System Info----------
   Platform     : Linux-4.4.0-1060-aws-x86_64-with-Ubuntu-16.04-xenial
   system       : Linux
   node         : ip-172-31-44-40
   release      : 4.4.0-1060-aws
   version      : #69-Ubuntu SMP Sun May 20 13:42:07 UTC 2018
   ----------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):                72
   On-line CPU(s) list:   0-71
   Thread(s) per core:    2
   Core(s) per socket:    18
   Socket(s):             2
   NUMA node(s):          2
   Vendor ID:             GenuineIntel
   CPU family:            6
   Model:                 85
   Model name:            Intel(R) Xeon(R) Platinum 8124M CPU @ 3.00GHz
   Stepping:              4
   CPU MHz:               3000.000
   BogoMIPS:              6000.00
   Hypervisor vendor:     KVM
   Virtualization type:   full
   L1d cache:             32K
   L1i cache:             32K
   L2 cache:              1024K
   L3 cache:              25344K
   NUMA node0 CPU(s):     0-17,36-53
   NUMA node1 CPU(s):     18-35,54-71
   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 arc
   h_perfmon rep_good nopl xtopology nonstop_tsc aperfmperf eagerfpu pni pclmulqdq monitor ssse3 fma cx16 pcid sse4_1 sse4_2 x2apic movbe popcnt tsc_deadline_timer aes xsave a
   vx f16c rdrand hypervisor lahf_lm abm 3dnowprefetch invpcid_single kaiser fsgsbase tsc_adjust bmi1 hle avx2 smep bmi2 erms invpcid rtm mpx avx512f rdseed adx smap clflushop
   t clwb avx512cd xsaveopt xsavec xgetbv1 ida arat
   ----------Network Test----------
   Setting timeout: 10
   Timing for Gluon Tutorial(cn): https://zh.gluon.ai, DNS: 0.1978 sec, LOAD: 1.0500 sec.
   Timing for Gluon Tutorial(en): http://gluon.mxnet.io, DNS: 0.1359 sec, LOAD: 0.3103 sec.
   Timing for FashionMNIST: https://apache-mxnet.s3-accelerate.dualstack.amazonaws.com/gluon/dataset/fashion-mnist/train-labels-idx1-ubyte.gz, DNS: 0.0391 sec, LOAD: 0.2770 se
   c.
   Timing for PYPI: https://pypi.python.org/pypi/pip, DNS: 0.0033 sec, LOAD: 0.4341 sec.
   Timing for MXNet: https://github.com/apache/incubator-mxnet, DNS: 0.0007 sec, LOAD: 0.7057 sec.
   Timing for Conda: https://repo.continuum.io/pkgs/free/, DNS: 0.0141 sec, LOAD: 0.3944 sec.
   
   ```
   
   Package used (Python/R/Scala/Julia):
   python
   
   ## Build info (Required if built from source)
   
   Compiler (gcc/clang/mingw/visual studio):
   ```
   Using built-in specs.
   COLLECT_GCC=gcc
   COLLECT_LTO_WRAPPER=/usr/lib/gcc/x86_64-linux-gnu/5/lto-wrapper
   Target: x86_64-linux-gnu
   Configured with: ../src/configure -v --with-pkgversion='Ubuntu 5.5.0-12ubuntu1~16.04' --with-bugurl=file:///usr/share/doc/gcc-5/README.Bugs --enable-languages=c,ada,c++,java,go,d,fortran,objc,obj-c++ --prefix=/usr --program-suffix=-5 --enable-shared --enable-linker-build-id --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --libdir=/usr/lib --enable-nls --with-sysroot=/ --enable-clocale=gnu --enable-libstdcxx-debug --enable-libstdcxx-time=yes --with-default-libstdcxx-abi=new --enable-gnu-unique-object --disable-vtable-verify --enable-libmpx --enable-plugin --with-system-zlib --disable-browser-plugin --enable-java-awt=gtk --enable-gtk-cairo --with-java-home=/usr/lib/jvm/java-1.5.0-gcj-5-amd64/jre --enable-java-home --with-jvm-root-dir=/usr/lib/jvm/java-1.5.0-gcj-5-amd64 --with-jvm-jar-dir=/usr/lib/jvm-exports/java-1.5.0-gcj-5-amd64 --with-arch-directory=amd64 --with-ecj-jar=/usr/share/java/eclipse-ecj.jar --enable-objc-gc --enable-multiarch --disable-werror --with-arch-32=i686 --with-abi=m64 --with-multilib-list=m32,m64,mx32 --enable-multilib --with-tune=generic --enable-checking=release --build=x86_64-linux-gnu --host=x86_64-linux-gnu --target=x86_64-linux-gnu
   Thread model: posix
   gcc version 5.5.0 20171010 (Ubuntu 5.5.0-12ubuntu1~16.04)
   ```
   
   MXNet commit hash:
   1b69e4bd92dc3c2a73a310993cd21e6119d52c0c
   
   
   Build config:
   ```
   #!/bin/bash
   set -e
   set -x
   
   renice -n 19 -p $$
   
   mkdir -p build && cd build
   cmake -DUSE_CPP_PACKAGE=ON -DUSE_CUDA=OFF -DUSE_OPENMP=OFF -DUSE_OPENCV=ON -DCMAKE_BUILD_TYPE=Debug -GNinja ..
   ninja -v
   
   cd ..
   if [ ! -d mxnet_py3 ]; then
       virtualenv -p `which python3` mxnet_py3
   fi
   source mxnet_py3/bin/activate
   cd python
   pip install -e .
   cd ..
   pip install opencv-python
   pip install ipython
   pip install matplotlib
   ```
   ## Error Message:
   
   
   ## Minimum reproducible example
   
   ```
   #!/usr/bin/env python
   # -*- coding: utf-8 -*-
   """Description"""
   
   __author__ = 'Pedro Larroy'
   __version__ = '0.1'
   
   import os
   import sys
   import subprocess
   import numpy as np
   import mxnet as mx
   import random
   
   def gen_data(dummy):
       ndim = np.random.randint(1, 6)
       shape = np.random.randint(1, 6, size=(ndim,))
       print("gen shape {}".format(shape))
       return [np.random.random(shape), np.random.random(shape)]
   
   def main():
       np.random.seed(0)
       mx.random.seed(0)
       random.seed(0)
       sample_num = 200
       for i in range(sample_num):
           d = gen_data(i)
           a = mx.sym.Variable('a')
           b = mx.sym.Variable('b')
           c = a + b
           y = c.bind(mx.cpu(), args={'a': mx.nd.array(d[0]), 'b': mx.nd.array(d[1])})
           y.forward(is_train=True)
           y = y.outputs[0].asnumpy()
           print("output:")
           print(y)
           print("data:")
           print(d)
       return 1
   
   if __name__ == '__main__':
       sys.exit(main())
   ```
   
   
   ## Steps to reproduce
   (Paste the commands you ran that produced the error.)
   
   ```
   python repro.py > 1
   python repro.py > 2
   diff 1 2
   ```
   ## What have you tried to solve it?
   
   1. Set MXNET_ENGINE_TYPE=NaiveEngine   problem still persists
   
   

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services