singa-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From GitBox <...@apache.org>
Subject [GitHub] [singa] chrishkchris commented on issue #579: hotfix: bugs in autograd.py and also update test case
Date Thu, 23 Jan 2020 03:28:40 GMT
chrishkchris commented on issue #579: hotfix: bugs in autograd.py and also update test case
URL: https://github.com/apache/singa/pull/579#issuecomment-577488473
 
 
   Here I include three tests when using -DUSE_CUDA=OFF in cmake: (i) Build Test, (ii) Python
autograd test case test_conv2d_cpu, (iii) mnist_cnn after changing to cpu device
   
   (i) Build Test with -DUSE_CUDA=OFF
   
   ```
   ubuntu@ip-172-31-24-48:~/singa/build$ cmake -D CMAKE_PREFIX_PATH="/usr/local/cuda/lib64;/usr/local/cuda/"
-DENABLE_TEST=OFF -DUSE_CUDA=OFF -DUSE_PYTHON3=ON -DUSE_MKLDNN=ON -DUSE_MODULES=OFF ..
   -- The C compiler identification is GNU 5.4.0
   -- The CXX compiler identification is GNU 5.4.0
   -- Check for working C compiler: /usr/bin/cc
   -- Check for working C compiler: /usr/bin/cc -- works
   -- Detecting C compiler ABI info
   -- Detecting C compiler ABI info - done
   -- Detecting C compile features
   -- Detecting C compile features - done
   -- Check for working CXX compiler: /usr/bin/c++
   -- Check for working CXX compiler: /usr/bin/c++ -- works
   -- Detecting CXX compiler ABI info
   -- Detecting CXX compiler ABI info - done
   -- Detecting CXX compile features
   -- Detecting CXX compile features - done
   -- Looking for pthread.h
   -- Looking for pthread.h - found
   -- Looking for pthread_create
   -- Looking for pthread_create - not found
   -- Looking for pthread_create in pthreads
   -- Looking for pthread_create in pthreads - not found
   -- Looking for pthread_create in pthread
   -- Looking for pthread_create in pthread - found
   -- Found Threads: TRUE
   -- Found Protobuf: /usr/local/lib/libprotobuf.so;-lpthread (found suitable version "3.0.0",
minimum required is "3.0")
   -- Found CBLAS: /usr/local/include
   -- Found GLOG: /usr/include
   -- Found PythonInterp: /usr/bin/python3 (found suitable version "3.5.2", minimum required
is "3")
   -- Found PythonLibs: /usr/lib/x86_64-linux-gnu/libpython3.5m.so (found suitable version
"3.5.2", minimum required is "3")
   -- Found SWIG: /usr/local/bin/swig (found suitable version "3.0.12", minimum required is
"3.0.10")
   -- Found MKLDNN at /usr/local/include
   -- Configuring done
   -- Generating done
   -- Build files have been written to: /home/ubuntu/singa/build
   ubuntu@ip-172-31-24-48:~/singa/build$ make -j4
   Scanning dependencies of target copy_protobuf
   [  1%] Running C++ protocol buffer compiler on /home/ubuntu/singa/src/proto/model.proto
   [  2%] Running C++ protocol buffer compiler on /home/ubuntu/singa/src/proto/core.proto
   [  3%] Running C++ protocol buffer compiler on /home/ubuntu/singa/src/proto/io.proto
   [  4%] Running C++ protocol buffer compiler on /home/ubuntu/singa/src/proto/caffe.proto
   [libprotobuf WARNING google/protobuf/compiler/parser.cc:547] No syntax specified for the
proto file: model.proto. Please use 'syntax = "proto2";' or 'syntax = "proto3";' to specify
a syntax version. (Defaulted to proto2 syntax.)
   [libprotobuf WARNING google/protobuf/compiler/parser.cc:547] No syntax specified for the
proto file: core.proto. Please use 'syntax = "proto2";' or 'syntax = "proto3";' to specify
a syntax version. (Defaulted to proto2 syntax.)
   [libprotobuf WARNING google/protobuf/compiler/parser.cc:547] No syntax specified for the
proto file: io.proto. Please use 'syntax = "proto2";' or 'syntax = "proto3";' to specify a
syntax version. (Defaulted to proto2 syntax.)
   [  5%] Copying Protobuf headers
   [  5%] Built target copy_protobuf
   Scanning dependencies of target singa_objects
   [  6%] Building CXX object src/CMakeFiles/singa_objects.dir/caffe.pb.cc.o
   [  8%] Building CXX object src/CMakeFiles/singa_objects.dir/core.pb.cc.o
   [  9%] Building CXX object src/CMakeFiles/singa_objects.dir/model.pb.cc.o
   [ 10%] Building CXX object src/CMakeFiles/singa_objects.dir/io.pb.cc.o
   [ 11%] Building CXX object src/CMakeFiles/singa_objects.dir/utils/channel.cc.o
   [ 12%] Building CXX object src/CMakeFiles/singa_objects.dir/utils/logging.cc.o
   [ 13%] Building CXX object src/CMakeFiles/singa_objects.dir/io/binfile_reader.cc.o
   [ 15%] Building CXX object src/CMakeFiles/singa_objects.dir/io/binfile_writer.cc.o
   [ 16%] Building CXX object src/CMakeFiles/singa_objects.dir/io/communicator.cc.o
   [ 17%] Building CXX object src/CMakeFiles/singa_objects.dir/io/csv_decoder.cc.o
   [ 18%] Building CXX object src/CMakeFiles/singa_objects.dir/io/csv_encoder.cc.o
   [ 19%] Building CXX object src/CMakeFiles/singa_objects.dir/io/image_transformer.cc.o
   [ 20%] Building CXX object src/CMakeFiles/singa_objects.dir/io/jpg_decoder.cc.o
   [ 22%] Building CXX object src/CMakeFiles/singa_objects.dir/io/jpg_encoder.cc.o
   [ 23%] Building CXX object src/CMakeFiles/singa_objects.dir/io/lmdb_reader.cc.o
   [ 24%] Building CXX object src/CMakeFiles/singa_objects.dir/io/lmdb_writer.cc.o
   [ 25%] Building CXX object src/CMakeFiles/singa_objects.dir/io/snapshot.cc.o
   [ 26%] Building CXX object src/CMakeFiles/singa_objects.dir/io/textfile_reader.cc.o
   [ 27%] Building CXX object src/CMakeFiles/singa_objects.dir/io/textfile_writer.cc.o
   [ 29%] Building CXX object src/CMakeFiles/singa_objects.dir/io/network/endpoint.cc.o
   [ 30%] Building CXX object src/CMakeFiles/singa_objects.dir/io/network/message.cc.o
   [ 31%] Building CXX object src/CMakeFiles/singa_objects.dir/core/device/cpp_cpu.cc.o
   [ 32%] Building CXX object src/CMakeFiles/singa_objects.dir/core/device/cuda_gpu.cc.o
   [ 33%] Building CXX object src/CMakeFiles/singa_objects.dir/core/device/device.cc.o
   [ 34%] Building CXX object src/CMakeFiles/singa_objects.dir/core/device/opencl_device.cc.o
   [ 36%] Building CXX object src/CMakeFiles/singa_objects.dir/core/device/platform.cc.o
   [ 37%] Building CXX object src/CMakeFiles/singa_objects.dir/core/memory/memory.cc.o
   [ 38%] Building CXX object src/CMakeFiles/singa_objects.dir/core/scheduler/scheduler.cc.o
   [ 39%] Building CXX object src/CMakeFiles/singa_objects.dir/core/tensor/sparse_tensor.cc.o
   [ 40%] Building CXX object src/CMakeFiles/singa_objects.dir/core/tensor/tensor.cc.o
   [ 41%] Building CXX object src/CMakeFiles/singa_objects.dir/model/feed_forward_net.cc.o
   [ 43%] Building CXX object src/CMakeFiles/singa_objects.dir/model/layer/activation.cc.o
   /home/ubuntu/singa/src/core/tensor/tensor.cc: In function ‘void singa::SoftMax(const
singa::Tensor&, singa::Tensor*, int)’:
   /home/ubuntu/singa/src/core/tensor/tensor.cc:758:13: warning: comparison between signed
and unsigned integer expressions [-Wsign-compare]
          if (i < axis)
                ^
   [ 44%] Building CXX object src/CMakeFiles/singa_objects.dir/model/layer/batchnorm.cc.o
   [ 45%] Building CXX object src/CMakeFiles/singa_objects.dir/model/layer/concat.cc.o
   [ 46%] Building CXX object src/CMakeFiles/singa_objects.dir/model/layer/convolution.cc.o
   [ 47%] Building CXX object src/CMakeFiles/singa_objects.dir/model/layer/cudnn_activation.cc.o
   [ 48%] Building CXX object src/CMakeFiles/singa_objects.dir/model/layer/cudnn_batchnorm.cc.o
   [ 50%] Building CXX object src/CMakeFiles/singa_objects.dir/model/layer/cudnn_convolution.cc.o
   [ 51%] Building CXX object src/CMakeFiles/singa_objects.dir/model/layer/cudnn_dropout.cc.o
   [ 52%] Building CXX object src/CMakeFiles/singa_objects.dir/model/layer/cudnn_lrn.cc.o
   [ 53%] Building CXX object src/CMakeFiles/singa_objects.dir/model/layer/cudnn_pooling.cc.o
   [ 54%] Building CXX object src/CMakeFiles/singa_objects.dir/model/layer/cudnn_rnn.cc.o
   [ 55%] Building CXX object src/CMakeFiles/singa_objects.dir/model/layer/cudnn_softmax.cc.o
   [ 56%] Building CXX object src/CMakeFiles/singa_objects.dir/model/layer/dense.cc.o
   [ 58%] Building CXX object src/CMakeFiles/singa_objects.dir/model/layer/dropout.cc.o
   [ 59%] Building CXX object src/CMakeFiles/singa_objects.dir/model/layer/flatten.cc.o
   [ 60%] Building CXX object src/CMakeFiles/singa_objects.dir/model/layer/lrn.cc.o
   [ 61%] Building CXX object src/CMakeFiles/singa_objects.dir/model/layer/merge.cc.o
   [ 62%] Building CXX object src/CMakeFiles/singa_objects.dir/model/layer/opencl_convolution.cc.o
   [ 63%] Building CXX object src/CMakeFiles/singa_objects.dir/model/layer/opencl_pooling.cc.o
   [ 65%] Building CXX object src/CMakeFiles/singa_objects.dir/model/layer/pooling.cc.o
   [ 66%] Building CXX object src/CMakeFiles/singa_objects.dir/model/layer/prelu.cc.o
   [ 67%] Building CXX object src/CMakeFiles/singa_objects.dir/model/layer/rnn.cc.o
   [ 68%] Building CXX object src/CMakeFiles/singa_objects.dir/model/layer/slice.cc.o
   [ 69%] Building CXX object src/CMakeFiles/singa_objects.dir/model/layer/softmax.cc.o
   [ 70%] Building CXX object src/CMakeFiles/singa_objects.dir/model/layer/split.cc.o
   [ 72%] Building CXX object src/CMakeFiles/singa_objects.dir/model/optimizer/adagrad.cc.o
   [ 73%] Building CXX object src/CMakeFiles/singa_objects.dir/model/optimizer/local_all_reduce.cc.o
   [ 74%] Building CXX object src/CMakeFiles/singa_objects.dir/model/optimizer/nesterov.cc.o
   [ 75%] Building CXX object src/CMakeFiles/singa_objects.dir/model/optimizer/optimizer.cc.o
   [ 76%] Building CXX object src/CMakeFiles/singa_objects.dir/model/optimizer/rmsprop.cc.o
   [ 77%] Building CXX object src/CMakeFiles/singa_objects.dir/model/optimizer/sgd.cc.o
   [ 79%] Building CXX object src/CMakeFiles/singa_objects.dir/model/loss/mse.cc.o
   [ 80%] Building CXX object src/CMakeFiles/singa_objects.dir/model/loss/softmax_cross_entropy.cc.o
   [ 81%] Building CXX object src/CMakeFiles/singa_objects.dir/model/metric/accuracy.cc.o
   [ 82%] Building CXX object src/CMakeFiles/singa_objects.dir/model/updater/local_updater.cc.o
   [ 83%] Building CXX object src/CMakeFiles/singa_objects.dir/model/updater/updater.cc.o
   [ 84%] Building CXX object src/CMakeFiles/singa_objects.dir/model/operation/batchnorm.cc.o
   [ 86%] Building CXX object src/CMakeFiles/singa_objects.dir/model/operation/convolution.cc.o
   [ 87%] Building CXX object src/CMakeFiles/singa_objects.dir/model/operation/pooling.cc.o
   [ 91%] Built target singa_objects
   [ 93%] Running Python protocol buffer compiler on /home/ubuntu/singa/src/proto/caffe.proto
   [ 94%] Running Python protocol buffer compiler on /home/ubuntu/singa/src/proto/model.proto
   Scanning dependencies of target singa
   [ 95%] Running Python protocol buffer compiler on /home/ubuntu/singa/src/proto/core.proto
   [libprotobuf WARNING google/protobuf/compiler/parser.cc:547] No syntax specified for the
proto file: model.proto. Please use 'syntax = "proto2";' or 'syntax = "proto3";' to specify
a syntax version. (Defaulted to proto2 syntax.)
   [libprotobuf WARNING google/protobuf/compiler/parser.cc:547] No syntax specified for the
proto file: core.proto. Please use 'syntax = "proto2";' or 'syntax = "proto3";' to specify
a syntax version. (Defaulted to proto2 syntax.)
   [ 96%] Linking CXX shared library ../lib/libsinga.so
   [ 97%] Running Python protocol buffer compiler on /home/ubuntu/singa/src/proto/io.proto
   [libprotobuf WARNING google/protobuf/compiler/parser.cc:547] No syntax specified for the
proto file: io.proto. Please use 'syntax = "proto2";' or 'syntax = "proto3";' to specify a
syntax version. (Defaulted to proto2 syntax.)
   Scanning dependencies of target _singa_wrap
   [ 98%] Building CXX object python/CMakeFiles/_singa_wrap.dir/__/src/api/singa_wrap.cxx.o
   [ 98%] Built target singa
   [100%] Linking CXX shared library singa/_singa_wrap.so
   [100%] Built target _singa_wrap
   
   ```
   (ii) Test Case after removing the gpu_dev
   
   ```
   ubuntu@ip-172-31-24-48:~/singa/test/python$ python3 test_operation.py TestPythonOperation.test_conv2d_cpu
   .
   ----------------------------------------------------------------------
   Ran 1 test in 0.051s
   
   OK
   ```
   
   (iii) mnist_cnn (i.e. a conv. netural network) after changed to "dev = device.get_default_device()"
   
   ```
   ubuntu@ip-172-31-24-48:~/singa/examples/autograd$ python3 mnist_cnn.py
   Starting Epoch 0:
   Training loss = 585.431152, training accuracy = 0.791739
   Evaluation accuracy = 0.930088, Elapsed Time = 55.447133s
   Starting Epoch 1:
   Training loss = 232.831589, training accuracy = 0.922158
   Evaluation accuracy = 0.967949, Elapsed Time = 55.337850s
   Starting Epoch 2:
   Training loss = 166.067307, training accuracy = 0.945788
   Evaluation accuracy = 0.968550, Elapsed Time = 55.367847s
   Starting Epoch 3:
   Training loss = 136.865341, training accuracy = 0.954092
   Evaluation accuracy = 0.973357, Elapsed Time = 55.358584s
   Starting Epoch 4:
   Training loss = 118.813286, training accuracy = 0.960195
   Evaluation accuracy = 0.979567, Elapsed Time = 55.270505s
   Starting Epoch 5:
   Training loss = 106.185112, training accuracy = 0.964481
   Evaluation accuracy = 0.975962, Elapsed Time = 55.281344s
   Starting Epoch 6:
   Training loss = 94.444023, training accuracy = 0.968016
   Evaluation accuracy = 0.980970, Elapsed Time = 55.081426s
   Starting Epoch 7:
   Training loss = 88.213493, training accuracy = 0.970418
   Evaluation accuracy = 0.982873, Elapsed Time = 54.912524s
   Starting Epoch 8:
   Training loss = 81.126442, training accuracy = 0.972886
   Evaluation accuracy = 0.981470, Elapsed Time = 54.907317s
   Starting Epoch 9:
   Training loss = 77.790993, training accuracy = 0.974236
   Evaluation accuracy = 0.974159, Elapsed Time = 54.915229s
   ```

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services

Mime
View raw message