chrishkchris edited a comment on issue #552: SINGA-496 Implement softplus and softsign functions for tensor math URL: https://github.com/apache/singa/pull/552#issuecomment-553887595 This is the build log. We can see the missing codes from the log. Since you put cuda::softsign(num, inPtr, outPtr, ctx->stream); in tensor_math_cuda.h, you will need to add it the header in math_kernal.h and the cuda computation part in math_kernal.cu Thanks! ``` ubuntu@ip-172-31-28-197:~/incubator-singa/build$ cmake -D CMAKE_PREFIX_PATH="/usr/local/cuda/lib64;/usr/local/cuda/" -DENABLE_TEST=ON -DUSE_CUDA=ON -DUSE_PYTHON3=ON -DUSE_MKLDNN=ON .. -- 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 cuda_v10.0 -- Found CUDNN: /usr/local/cuda/include -- Found Cudnn_7401 at /usr/local/cuda/include /usr/local/cuda/lib64/libcudnn.so -- 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/incubator-singa/build ubuntu@ip-172-31-28-197:~/incubator-singa/build$ make -j4 Scanning dependencies of target cnmem Scanning dependencies of target copy_protobuf Scanning dependencies of target gtest [ 1%] Creating directories for 'cnmem' [ 2%] Running C++ protocol buffer compiler on /home/ubuntu/incubator-singa/src/proto/model.proto [ 3%] Running C++ protocol buffer compiler on /home/ubuntu/incubator-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.) [ 3%] Building CXX object test/CMakeFiles/gtest.dir/gtest/gtest-all.cc.o [ 3%] Performing download step (git clone) for 'cnmem' Cloning into 'cnmem'... [ 3%] Running C++ protocol buffer compiler on /home/ubuntu/incubator-singa/src/proto/core.proto [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.) [ 4%] Running C++ protocol buffer compiler on /home/ubuntu/incubator-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.) [ 4%] Copying Protobuf headers [ 4%] Built target copy_protobuf [ 5%] Building NVCC (Device) object src/CMakeFiles/cuda_compile_1.dir/core/tensor/cuda_compile_1_generated_math_kernel.cu.o Scanning dependencies of target singa_objects [ 6%] Building CXX object src/CMakeFiles/singa_objects.dir/caffe.pb.cc.o [ 7%] Building CXX object src/CMakeFiles/singa_objects.dir/core.pb.cc.o Already on 'master' Your branch is up-to-date with 'origin/master'. [ 8%] No patch step for 'cnmem' [ 9%] Performing update step for 'cnmem' [ 9%] Building CXX object src/CMakeFiles/singa_objects.dir/io.pb.cc.o Current branch master is up to date. [ 9%] Performing configure step for 'cnmem' -- 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 -- Configuring done -- Generating done -- Build files have been written to: /home/ubuntu/incubator-singa/build/cnmem-prefix/src/cnmem-build [ 10%] Performing build step for 'cnmem' Scanning dependencies of target cnmem [ 50%] Building CXX object CMakeFiles/cnmem.dir/src/cnmem.cpp.o [100%] Linking CXX static library libcnmem.a [100%] Built target cnmem [ 10%] Performing install step for 'cnmem' [ 11%] Building CXX object src/CMakeFiles/singa_objects.dir/model.pb.cc.o [100%] Built target cnmem Install the project... -- Install configuration: "" -- Installing: /home/ubuntu/incubator-singa/build/lib/libcnmem.a -- Installing: /home/ubuntu/incubator-singa/build/include/cnmem.h [ 12%] Completed 'cnmem' [ 12%] Built target cnmem [ 13%] Building CXX object src/CMakeFiles/singa_objects.dir/utils/channel.cc.o [ 13%] Building CXX object src/CMakeFiles/singa_objects.dir/utils/logging.cc.o [ 14%] Building CXX object src/CMakeFiles/singa_objects.dir/io/binfile_reader.cc.o [ 15%] Linking CXX static library ../lib/libgtest.a [ 15%] Building CXX object src/CMakeFiles/singa_objects.dir/io/binfile_writer.cc.o [ 15%] Built target gtest [ 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 [ 17%] Building CXX object src/CMakeFiles/singa_objects.dir/io/csv_encoder.cc.o [ 18%] Building CXX object src/CMakeFiles/singa_objects.dir/io/image_transformer.cc.o [ 19%] Building CXX object src/CMakeFiles/singa_objects.dir/io/jpg_decoder.cc.o [ 19%] Building CXX object src/CMakeFiles/singa_objects.dir/io/jpg_encoder.cc.o [ 20%] Building CXX object src/CMakeFiles/singa_objects.dir/io/lmdb_reader.cc.o [ 21%] Building CXX object src/CMakeFiles/singa_objects.dir/io/lmdb_writer.cc.o [ 21%] Building CXX object src/CMakeFiles/singa_objects.dir/io/snapshot.cc.o [ 22%] Building CXX object src/CMakeFiles/singa_objects.dir/io/textfile_reader.cc.o [ 22%] Building CXX object src/CMakeFiles/singa_objects.dir/io/textfile_writer.cc.o [ 23%] Building CXX object src/CMakeFiles/singa_objects.dir/io/network/endpoint.cc.o [ 24%] Building CXX object src/CMakeFiles/singa_objects.dir/io/network/message.cc.o [ 24%] Building CXX object src/CMakeFiles/singa_objects.dir/core/device/cpp_cpu.cc.o [ 25%] Building CXX object src/CMakeFiles/singa_objects.dir/core/device/cuda_gpu.cc.o [ 26%] Building CXX object src/CMakeFiles/singa_objects.dir/core/device/device.cc.o [ 26%] Building CXX object src/CMakeFiles/singa_objects.dir/core/device/opencl_device.cc.o [ 27%] Building CXX object src/CMakeFiles/singa_objects.dir/core/device/platform.cc.o [ 27%] Building CXX object src/CMakeFiles/singa_objects.dir/core/memory/memory.cc.o [ 28%] Building CXX object src/CMakeFiles/singa_objects.dir/core/scheduler/scheduler.cc.o [ 29%] Building CXX object src/CMakeFiles/singa_objects.dir/core/tensor/sparse_tensor.cc.o [ 29%] Building CXX object src/CMakeFiles/singa_objects.dir/core/tensor/tensor.cc.o [ 30%] Building CXX object src/CMakeFiles/singa_objects.dir/model/feed_forward_net.cc.o [ 31%] Building CXX object src/CMakeFiles/singa_objects.dir/model/layer/activation.cc.o In file included from /home/ubuntu/incubator-singa/src/core/tensor/tensor.cc:22:0: /home/ubuntu/incubator-singa/src/core/tensor/./tensor_math_cuda.h: In function ‘void singa::SoftSign(const singa::Tensor&, singa::Tensor*, singa::Context*) [with DType = float; Lang = singa::lang::_Cuda; singa::Context = singa::_Context]’: /home/ubuntu/incubator-singa/src/core/tensor/./tensor_math_cuda.h:669:5: error: ‘softsign’ is not a member of ‘singa::cuda’ cuda::softsign(num, inPtr, outPtr, ctx->stream); ^ /home/ubuntu/incubator-singa/src/core/tensor/./tensor_math_cuda.h:672:5: error: ‘softsign’ is not a member of ‘singa::cuda’ cuda::softsign(num, outPtr, outPtr, ctx->stream); ^ /home/ubuntu/incubator-singa/src/core/tensor/./tensor_math_cuda.h: In function ‘void singa::SoftMax(const singa::Tensor&, singa::Tensor*, singa::Context*, int) [with DType = float; Lang = singa::lang::_Cuda; singa::Context = singa::_Context]’: /home/ubuntu/incubator-singa/src/core/tensor/./tensor_math_cuda.h:1001:21: warning: comparison between signed and unsigned integer expressions [-Wsign-compare] for (int i = 0; i < in.shape().size(); i++) { ^ [ 31%] Building CXX object src/CMakeFiles/singa_objects.dir/model/layer/batchnorm.cc.o [ 32%] Building CXX object src/CMakeFiles/singa_objects.dir/model/layer/concat.cc.o src/CMakeFiles/singa_objects.dir/build.make:478: recipe for target 'src/CMakeFiles/singa_objects.dir/core/tensor/tensor.cc.o' failed make[2]: *** [src/CMakeFiles/singa_objects.dir/core/tensor/tensor.cc.o] Error 1 make[2]: *** Waiting for unfinished jobs.... CMakeFiles/Makefile2:168: recipe for target 'src/CMakeFiles/singa_objects.dir/all' failed make[1]: *** [src/CMakeFiles/singa_objects.dir/all] Error 2 Makefile:129: recipe for target 'all' failed make: *** [all] Error 2 ``` You may consider add and rebuild the code, and place the test result here for reference. Thanks!
---------------------------------------------------------------- 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