Code Monkey home page Code Monkey logo

thundersvm's Introduction

Build Status Build status GitHub license Documentation Status GitHub issues PyPI version Downloads

What's new

  • We have recently released ThunderGBM, a fast GBDT and Random Forest library on GPUs.
  • add scikit-learn interface, see here

Overview

The mission of ThunderSVM is to help users easily and efficiently apply SVMs to solve problems. ThunderSVM exploits GPUs and multi-core CPUs to achieve high efficiency. Key features of ThunderSVM are as follows.

  • Support all functionalities of LibSVM such as one-class SVMs, SVC, SVR and probabilistic SVMs.
  • Use same command line options as LibSVM.
  • Support Python, R, Matlab and Ruby interfaces.
  • Supported Operating Systems: Linux, Windows and MacOS.

Why accelerate SVMs: A survey conducted by Kaggle in 2017 shows that 26% of the data mining and machine learning practitioners are users of SVMs.

Documentation | Installation | API Reference (doxygen)

Contents

Getting Started

Prerequisites

  • cmake 2.8 or above
  • gcc 4.8 or above for Linux and MacOS
  • Visual C++ for Windows

If you want to use GPUs, you also need to install CUDA.

Quick Install

Download the Python wheel file (For Python3 or above).

Install the Python wheel file.

pip install thundersvm-cu90-0.2.0-py3-none-linux_x86_64.whl
Example
from thundersvm import SVC
clf = SVC()
clf.fit(x, y)

Download

git clone https://github.com/Xtra-Computing/thundersvm.git

Build on Linux (build instructions for MacOS and Windows)

ThunderSVM on GPUs
cd thundersvm
mkdir build && cd build && cmake .. && make -j

If you run into issues that can be traced back to your version of gcc, use cmake with a version flag to force gcc 6. That would look like this:

cmake -DCMAKE_C_COMPILER=gcc-6 -DCMAKE_CXX_COMPILER=g++-6 ..
ThunderSVM on CPUs
# in thundersvm root directory
git submodule init eigen && git submodule update
mkdir build && cd build && cmake -DUSE_CUDA=OFF .. && make -j

If make -j doesn't work, please simply use make. The number of CPU cores to use can be specified by the -o option (e.g., -o 10), and refer to Parameters for more information.

Quick Start

./bin/thundersvm-train -c 100 -g 0.5 ../dataset/test_dataset.txt
./bin/thundersvm-predict ../dataset/test_dataset.txt test_dataset.txt.model test_dataset.predict

You will see Accuracy = 0.98 after successful running.

How to cite ThunderSVM

If you use ThunderSVM in your paper, please cite our work (full version).

@article{wenthundersvm18,
 author = {Wen, Zeyi and Shi, Jiashuai and Li, Qinbin and He, Bingsheng and Chen, Jian},
 title = {{ThunderSVM}: A Fast {SVM} Library on {GPUs} and {CPUs}},
 journal = {Journal of Machine Learning Research},
 volume={19},
 pages={797--801},
 year = {2018}
}

Other publications

  • Zeyi Wen, Jiashuai Shi, Bingsheng He, Yawen Chen, and Jian Chen. Efficient Multi-Class Probabilistic SVMs on GPUs. IEEE Transactions on Knowledge and Data Engineering (TKDE), 2018.
  • Zeyi Wen, Bingsheng He, Kotagiri Ramamohanarao, Shengliang Lu, and Jiashuai Shi. Efficient Gradient Boosted Decision Tree Training on GPUs. The 32nd IEEE International Parallel and Distributed Processing Symposium (IPDPS), pages 234-243, 2018.
  • Borui Xu, Zeyi Wen, Lifeng Yan, Zhan Zhao, Zekun Yin, Weiguo Liu, Bingsheng He. Leveraging Data Density and Sparsity for Efficient SVM Training on GPUs. The 23rd IEEE International Conference on Data Mining (ICDM), 2023.

Related websites

Acknowledgement

  • We acknowledge NVIDIA for their hardware donations.
  • This project is hosted by NUS, collaborating with Prof. Jian Chen (South China University of Technology). Initial work of this project was done when Zeyi Wen worked at The University of Melbourne.
  • This work is partially supported by a MoE AcRF Tier 1 grant (T1 251RES1610) in Singapore.
  • We also thank the authors of LibSVM and OHD-SVM which inspire our algorithmic design.

Selected projects that use ThunderSVM

[1] Scene Graphs for Interpretable Video Anomaly Classification (published in NeurIPS18)

[2] 3D semantic segmentation for high-resolution aerial survey derived point clouds using deep learning. (published in ACM SIGSPATIAL International Conference on Advances in Geographic Information Systems, 2018).

[3] Performance Comparison of Machine Learning Models for DDoS Attacks Detection. (published in IEEE International Computer Science and Engineering Conference (ICSEC), 2018).

[4] Kernel machines that adapt to GPUs for effective large batch training. (in arXiv preprint arXiv:1806.06144, 2018).

[5] Sampling Bias in Deep Active Classification: An Empirical Study. (in arXiv preprint arXiv:1909.09389, 2019).

[6] Machine Learning-Based Fast Banknote Serial Number Recognition Using Knowledge Distillation and Bayesian Optimization. (published in Sensors 19.19:4218, 2019).

[7] Classification for Device-free Localization based on Deep Neural Networks. (in Diss. The University of Aizu, 2019).

[8] An accurate and robust approach of device-free localization with convolutional autoencoder. (published in IEEE Internet of Things Journal 6.3:5825-5840, 2019).

[9] Accounting for part pose estimation uncertainties during trajectory generation for part pick-up using mobile manipulators. (published in IEEE International Conference on Robotics and Automation (ICRA), 2019).

[10] Genetic improvement of GPU code. (published in IEEE/ACM International Workshop on Genetic Improvement (GI), 2019). The source code of ThunderSVM is used as a benchmark.

[11] Dynamic Multi-Resolution Data Storage. (published in IEEE/ACM International Symposium on Microarchitecture, 2019). The source code of ThunderSVM is used as a benchmark.

[12] Hyperparameter Estimation in SVM with GPU Acceleration for Prediction of Protein-Protein Interactions. (published in IEEE International Conference on Big Data, 2019).

[13] Texture Selection for Automatic Music Genre Classification. (published in Applied Soft Computing, 2020).

[14] Evolving Switch Architecture toward Accommodating In-Network Intelligence. (published in IEEE Communications Magazine 58.1: 33-39, 2020).

[15] Block-Sparse Coding Based Machine Learning Approach for Dependable Device-Free Localization in IoT Environment. (published in IEEE Internet of Things Journal, 2020).

[16] An adaptive trust boundary protection for IIoT networks using deep-learning feature extraction based semi-supervised model. (published in IEEE Transactions on Industrial Informatics, 2020).

[17] Performance Prediction for Multi-Application Concurrency on GPUs. (published in IEEE International Symposium on Performance Analysis of Systems and Software (ISPASS), 2020).

[18] Tensorsvm: accelerating kernel machines with tensor engine. (published in ACM International Conference on Supercomputing (ICS), 2020).

[19] GEVO: GPU Code Optimization Using Evolutionary Computation. (published in ACM Transactions on Architecture and Code Optimization (TACO), 2020).

[20] CRISPRpred (SEQ): a sequence-based method for sgRNA on target activity prediction using traditional machine learning. (published in BMC bioinformatics, 2020).

[21] Prediction of gas concentration using gated recurrent neural networks. (published in IEEE International Conference on Artificial Intelligence Circuits and Systems (AICAS), 2020).

[22] Design powerful predictor for mRNA subcellular location prediction in Homo sapiens. (published in Briefings in Bioinformatics, 2021).

thundersvm's People

Contributors

adrien1018 avatar ankane avatar bkj avatar blackjack201312 avatar boruixu avatar dvukolov avatar emmenlau avatar guillaumedsde avatar jacobjmarks avatar jiahuanluo avatar julianofoleiss avatar kurt-liuhf avatar lushl9301 avatar nathanskene avatar patrickkudo avatar qinbinli avatar ranchen07 avatar richardwarfield avatar shijiashuai avatar shyhuai avatar varir avatar yawenchen0823 avatar zeyiwen avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

thundersvm's Issues

编译GPU版本出错:CMakeFiles/thundersvm.dir/kernel/smo_kernel.cpp.o:smo_kernel.cpp:(.text+0x20af): first defined here

Building CXX object src/thundersvm/CMakeFiles/thundersvm.dir/syncmem.cpp.o
/usr/bin/cmake: /root/anaconda2/lib/libcurl.so.4: no version information available (required by /usr/bin/cmake)
[ 23%] /usr/bin/cmake: /root/anaconda2/lib/libcurl.so.4: no version information available (required by /usr/bin/cmake)
Building CXX object src/thundersvm/CMakeFiles/thundersvm.dir/svm_matlab_interface.cpp.o
/usr/bin/cmake: /root/anaconda2/lib/libcurl.so.4: no version information available (required by /usr/bin/cmake)
[ 24%] /usr/bin/cmake: /root/anaconda2/lib/libcurl.so.4: no version information available (required by /usr/bin/cmake)
Building CXX object src/thundersvm/CMakeFiles/thundersvm.dir/svm_python_interface.cpp.o
/usr/bin/cmake: /root/anaconda2/lib/libcurl.so.4: no version information available (required by /usr/bin/cmake)
Linking CXX shared library ../../lib/libthundersvm.so
/usr/bin/cmake: /root/anaconda2/lib/libcurl.so.4: no version information available (required by /usr/bin/cmake)
CMakeFiles/thundersvm.dir/kernel/thundersvm_generated_kernelmatrix_kernel.cu.o: In function void std::_Destroy<std::string>(std::string*)': /workspace/thundersvm/src/thundersvm/kernel/kernelmatrix_kernel.cu:92: multiple definition of svm_kernel::sum_kernel_values(SyncData const&, int, SyncData const&, SyncData const&, SyncData const&, SyncData const&, SyncData&, int, int)'
CMakeFiles/thundersvm.dir/kernel/kernelmatrix_kernel.cpp.o:kernelmatrix_kernel.cpp:(.text+0x275): first defined here
CMakeFiles/thundersvm.dir/kernel/thundersvm_generated_kernelmatrix_kernel.cu.o: In function svm_kernel::get_working_set_ins(SyncData<float> const&, SyncData<int> const&, SyncData<int> const&, SyncData<int> const&, SyncData<float>&, int)': /workspace/thundersvm/src/thundersvm/kernel/kernelmatrix_kernel.cu:101: multiple definition of svm_kernel::get_working_set_ins(SyncData const&, SyncData const&, SyncData const&, SyncData const&, SyncData&, int)'
CMakeFiles/thundersvm.dir/kernel/kernelmatrix_kernel.cpp.o:kernelmatrix_kernel.cpp:(.text+0x0): first defined here
CMakeFiles/thundersvm.dir/kernel/thundersvm_generated_kernelmatrix_kernel.cu.o: In function svm_kernel::RBF_kernel(SyncData<float> const&, SyncData<float> const&, SyncData<float>&, int, int, float)': /workspace/thundersvm/src/thundersvm/kernel/kernelmatrix_kernel.cu:111: multiple definition of svm_kernel::RBF_kernel(SyncData const&, SyncData const&, SyncData&, int, int, float)'
CMakeFiles/thundersvm.dir/kernel/kernelmatrix_kernel.cpp.o:kernelmatrix_kernel.cpp:(.text+0x74): first defined here
CMakeFiles/thundersvm.dir/kernel/thundersvm_generated_kernelmatrix_kernel.cu.o: In function svm_kernel::RBF_kernel(SyncData<int> const&, SyncData<float> const&, SyncData<float>&, int, int, float)': /workspace/thundersvm/src/thundersvm/kernel/kernelmatrix_kernel.cu:119: multiple definition of svm_kernel::RBF_kernel(SyncData const&, SyncData const&, SyncData&, int, int, float)'
CMakeFiles/thundersvm.dir/kernel/kernelmatrix_kernel.cpp.o:kernelmatrix_kernel.cpp:(.text+0xf8): first defined here
CMakeFiles/thundersvm.dir/kernel/thundersvm_generated_kernelmatrix_kernel.cu.o: In function svm_kernel::poly_kernel(SyncData<float>&, float, float, int, int)': /workspace/thundersvm/src/thundersvm/kernel/kernelmatrix_kernel.cu:124: multiple definition of svm_kernel::poly_kernel(SyncData&, float, float, int, int)'
CMakeFiles/thundersvm.dir/kernel/kernelmatrix_kernel.cpp.o:kernelmatrix_kernel.cpp:(.text+0x17c): first defined here
CMakeFiles/thundersvm.dir/kernel/thundersvm_generated_kernelmatrix_kernel.cu.o: In function svm_kernel::sigmoid_kernel(SyncData<float>&, float, float, int)': /workspace/thundersvm/src/thundersvm/kernel/kernelmatrix_kernel.cu:128: multiple definition of svm_kernel::sigmoid_kernel(SyncData&, float, float, int)'
CMakeFiles/thundersvm.dir/kernel/kernelmatrix_kernel.cpp.o:kernelmatrix_kernel.cpp:(.text+0x200): first defined here
CMakeFiles/thundersvm.dir/kernel/thundersvm_generated_kernelmatrix_kernel.cu.o: In function svm_kernel::dns_csr_mul(int, int, int, SyncData<float> const&, SyncData<float> const&, SyncData<int> const&, SyncData<int> const&, int, SyncData<float>&)': /workspace/thundersvm/src/thundersvm/kernel/kernelmatrix_kernel.cu:138: multiple definition of svm_kernel::dns_csr_mul(int, int, int, SyncData const&, SyncData const&, SyncData const&, SyncData const&, int, SyncData&)'
CMakeFiles/thundersvm.dir/kernel/kernelmatrix_kernel.cpp.o:kernelmatrix_kernel.cpp:(.text+0x308): first defined here
CMakeFiles/thundersvm.dir/kernel/thundersvm_generated_smo_kernel.cu.o: In function _ZN6thrust6system4cuda6detail4cub_12DoubleBufferIiEC4Ev': /workspace/thundersvm/src/thundersvm/kernel/smo_kernel.cu:260: multiple definition of svm_kernel::c_smo_solve(SyncData const&, SyncData&, SyncData&, SyncData&, SyncData const&, float, float, SyncData const&, SyncData const&, int, float, SyncData&, int)'
CMakeFiles/thundersvm.dir/kernel/smo_kernel.cpp.o:smo_kernel.cpp:(.text+0x7e): first defined here
CMakeFiles/thundersvm.dir/kernel/thundersvm_generated_smo_kernel.cu.o: In function svm_kernel::nu_smo_solve(SyncData<int> const&, SyncData<float>&, SyncData<float>&, SyncData<float>&, SyncData<int> const&, float, SyncData<float> const&, SyncData<float> const&, int, float, SyncData<float>&, int)': /workspace/thundersvm/src/thundersvm/kernel/smo_kernel.cu:273: multiple definition of svm_kernel::nu_smo_solve(SyncData const&, SyncData&, SyncData&, SyncData&, SyncData const&, float, SyncData const&, SyncData const&, int, float, SyncData&, int)'
CMakeFiles/thundersvm.dir/kernel/smo_kernel.cpp.o:smo_kernel.cpp:(.text+0xdaa): first defined here
CMakeFiles/thundersvm.dir/kernel/thundersvm_generated_smo_kernel.cu.o: In function _ZN6thrust6system4cuda6detail4cub_23DeviceRadixSortDispatchILb0EfiiE12KernelConfigC4Ev': /workspace/thundersvm/src/thundersvm/kernel/smo_kernel.cu:300: multiple definition of svm_kernel::update_f(SyncData&, SyncData const&, SyncData const&, int)'
CMakeFiles/thundersvm.dir/kernel/smo_kernel.cpp.o:smo_kernel.cpp:(.text+0x2054): first defined here
CMakeFiles/thundersvm.dir/kernel/thundersvm_generated_smo_kernel.cu.o: In function svm_kernel::sort_f(SyncData<float>&, SyncData<int>&)': /workspace/thundersvm/src/thundersvm/kernel/smo_kernel.cu:305: multiple definition of svm_kernel::sort_f(SyncData&, SyncData&)'
CMakeFiles/thundersvm.dir/kernel/smo_kernel.cpp.o:smo_kernel.cpp:(.text+0x20af): first defined here
collect2: error: ld returned 1 exit status
make[2]: *** [lib/libthundersvm.so] Error 1
make[1]: *** [src/thundersvm/CMakeFiles/thundersvm.dir/all] Error 2
make: *** [all] Error 2

ThunderSVM GCC 6 or later

Ubuntu 17.10
cuda 9.1 (installed with .deb)

Error occurs with or without -j in make:

-- The C compiler identification is GNU 7.2.0
-- The CXX compiler identification is GNU 7.2.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
CMake Warning (dev) at /usr/share/cmake-3.9/Modules/FindOpenMP.cmake:200 (if):
  Policy CMP0054 is not set: Only interpret if() arguments as variables or
  keywords when unquoted.  Run "cmake --help-policy CMP0054" for policy
  details.  Use the cmake_policy command to set the policy and suppress this
  warning.

  Quoted variables like "c" will no longer be dereferenced when the policy is
  set to NEW.  Since the policy is not set the OLD behavior will be used.
Call Stack (most recent call first):
  /usr/share/cmake-3.9/Modules/FindOpenMP.cmake:324 (_OPENMP_GET_FLAGS)
  CMakeLists.txt:26 (find_package)
This warning is for project developers.  Use -Wno-dev to suppress it.

Compile with CUDA
-- Found Threads: TRUE
-- Configuring done
-- Generating done
-- Build files have been written to: /home/devon/Code/thundersvm/build
[  3%] Building NVCC (Device) object src/thundersvm/CMakeFiles/thundersvm.dir/kernel/thundersvm_generated_smo_kernel.cu.o
In file included from /usr/local/cuda/include/host_config.h:50:0,
                 from /usr/local/cuda/include/cuda_runtime.h:78,
                 from <command-line>:0:
/usr/local/cuda/include/crt/host_config.h:121:2: error: #error -- unsupported GNU version! gcc versions later than 6 are not supported!
 #error -- unsupported GNU version! gcc versions later than 6 are not supported!
  ^~~~~
CMake Error at thundersvm_generated_smo_kernel.cu.o.Release.cmake:222 (message):
  Error generating
  /home/devon/Code/thundersvm/build/src/thundersvm/CMakeFiles/thundersvm.dir/kernel/./thundersvm_generated_smo_kernel.cu.o


src/thundersvm/CMakeFiles/thundersvm.dir/build.make:70: recipe for target 'src/thundersvm/CMakeFiles/thundersvm.dir/kernel/thundersvm_generated_smo_kernel.cu.o' failed
make[2]: *** [src/thundersvm/CMakeFiles/thundersvm.dir/kernel/thundersvm_generated_smo_kernel.cu.o] Error 1
CMakeFiles/Makefile2:126: recipe for target 'src/thundersvm/CMakeFiles/thundersvm.dir/all' failed
make[1]: *** [src/thundersvm/CMakeFiles/thundersvm.dir/all] Error 2
Makefile:83: recipe for target 'all' failed
make: *** [all] Error 2

Using precomputed kernels generates errors

I am trying to run ThunderSVM with a precomputed kernel, but have run into a few problems. Could you take a look?

My data works fine with libSVM:

kira@SYN-LAP-011:~/Software/libsvm-3.22$ ./svm-train -c 1 -t 4 /tmp/train_kernel.out 
*.*
optimization finished, #iter = 17
nu = 0.285714
obj = -3.296726, rho = -1.035408
nSV = 11, nBSV = 2
Total nSV = 11
kira@SYN-LAP-011:~/Software/libsvm-3.22$ ./svm-predict /tmp/libsvmkernel.out libsvmkernel.out.model test.out
Accuracy = 85.7143% (6/7) (classification)

If I try to run this directly with ThunderSVM, it complains that the kernel type is unknown:

kira@SYN-LAP-011:~/Software/thundersvm/build$ ./bin/thundersvm-train -c 1 -t 4 /tmp/train_kernel.out
2018-05-11 15:31:44,945 ERROR [default] unknown kernel type
2018-05-11 15:31:44,945 INFO [default] Usage (same as LibSVM): thundersvm [options] training_set_file [model_file]
options:
<output cut here>

If I try to run ThunderSVM via python, training runs (very differently to libSVM) and prediction crashes:

kira@SYN-LAP-011:~/Software/thundersvm/python$ python3
Python 3.5.2 (default, Nov 23 2017, 16:37:01) 
[GCC 5.4.0 20160609] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import svm
>>> y,x=svm.svm_read_problem("/tmp/train_kernel.out")
>>> svm.svm_train(y,x,"train_kernel.out.model","-c 1 -t 4")
2018-05-11 15:36:10,051 INFO [default] #classes = 2
2018-05-11 15:36:10,051 INFO [default] working set size = 8
2018-05-11 15:36:10,051 INFO [default] training start
2018-05-11 15:36:10,105 INFO [default] global iter = 0, total local iter = 100001, diff = 2
2018-05-11 15:36:10,150 INFO [default] global iter = 2, total local iter = 100805, diff = -inf
2018-05-11 15:36:10,150 INFO [default] rho = -nan
2018-05-11 15:36:10,150 INFO [default] #sv = 4
2018-05-11 15:36:10,150 INFO [default] #total unique sv = 4
2018-05-11 15:36:10,150 INFO [default] evaluating training score
2018-05-11 15:36:10,160 INFO [default] SVC::predict_label
2018-05-11 15:36:10,160 INFO [default] Accuracy = 0.142857

>>> y,x=svm.svm_read_problem("/tmp/test_kernel.out")
>>> svm.svm_predict(y,x,"train_kernel.out.model","predictions.txt")
Segmentation fault (core dumped)

My data looks like this:
train_kernel.out:

1 0:1 1:1.0 2:7.963494e-02 3:3.325665e-01 4:2.397191e-01 5:3.135345e-01 6:7.399337e-02 7:1.665817e-01 8:2.210360e-01 9:2.850396e-01 10:2.655067e-01 11:8.429855e-02 12:1.382558e-01 13:4.368207e-01 14:3.220871e-01
1 0:2 1:7.963494e-02 2:1.0 3:9.836425e-02 4:2.354587e-01 5:1.784186e-01 6:5.793398e-01 7:2.235396e-01 8:2.659173e-01 9:1.812363e-01 10:1.225234e-01 11:9.808508e-02 12:2.184586e-02 13:1.274673e-01 14:1.816464e-01
1 0:3 1:3.325665e-01 2:9.836425e-02 3:1.0 4:2.387480e-01 5:3.546404e-01 6:7.172984e-02 7:6.795441e-02 8:1.233178e-01 9:2.349564e-01 10:2.161432e-01 11:6.885562e-02 12:1.789989e-01 13:6.059155e-01 14:3.945151e-01
1 0:4 1:2.397191e-01 2:2.354587e-01 3:2.387480e-01 4:1.0 5:2.901807e-01 6:1.974833e-01 7:2.415136e-01 8:3.229411e-01 9:2.156197e-01 10:1.794023e-01 11:3.367458e-02 12:7.756815e-02 13:3.578091e-01 14:4.601892e-01
1 0:5 1:3.135345e-01 2:1.784186e-01 3:3.546404e-01 4:2.901807e-01 5:1.0 6:1.911636e-01 7:1.441595e-01 8:2.800171e-01 9:2.736416e-01 10:2.058720e-01 11:7.576426e-02 12:1.654463e-01 13:4.857011e-01 14:3.976108e-01
1 0:6 1:7.399337e-02 2:5.793398e-01 3:7.172984e-02 4:1.974833e-01 5:1.911636e-01 6:1.0 7:2.434326e-01 8:3.355066e-01 9:2.396896e-01 10:1.564234e-01 11:1.060408e-01 12:5.298542e-02 13:1.395370e-01 14:2.225568e-01
1 0:7 1:1.665817e-01 2:2.235396e-01 3:6.795441e-02 4:2.415136e-01 5:1.441595e-01 6:2.434326e-01 7:1.0 8:1.936384e-01 9:2.378984e-01 10:1.098631e-01 11:8.117840e-02 12:1.818148e-01 13:1.642263e-01 14:2.194416e-01
1 0:8 1:2.210360e-01 2:2.659173e-01 3:1.233178e-01 4:3.229411e-01 5:2.800171e-01 6:3.355066e-01 7:1.936384e-01 8:1.0 9:2.441430e-01 10:1.446756e-01 11:1.171163e-01 12:1.005228e-01 13:3.164326e-01 14:2.763877e-01
1 0:9 1:2.850396e-01 2:1.812363e-01 3:2.349564e-01 4:2.156197e-01 5:2.736416e-01 6:2.396896e-01 7:2.378984e-01 8:2.441430e-01 9:1.0 10:2.312299e-01 11:6.747934e-02 12:1.459097e-01 13:3.401782e-01 14:3.229424e-01
1 0:10 1:2.655067e-01 2:1.225234e-01 3:2.161432e-01 4:1.794023e-01 5:2.058720e-01 6:1.564234e-01 7:1.098631e-01 8:1.446756e-01 9:2.312299e-01 10:1.0 11:1.391822e-01 12:8.440796e-02 13:2.577245e-01 14:2.511043e-01
1 0:11 1:8.429855e-02 2:9.808508e-02 3:6.885562e-02 4:3.367458e-02 5:7.576426e-02 6:1.060408e-01 7:8.117840e-02 8:1.171163e-01 9:6.747934e-02 10:1.391822e-01 11:1.0 12:3.511793e-02 13:5.367907e-02 14:1.007229e-01
1 0:12 1:1.382558e-01 2:2.184586e-02 3:1.789989e-01 4:7.756815e-02 5:1.654463e-01 6:5.298542e-02 7:1.818148e-01 8:1.005228e-01 9:1.459097e-01 10:8.440796e-02 11:3.511793e-02 12:1.0 13:1.261742e-01 14:1.568662e-01
0 0:13 1:4.368207e-01 2:1.274673e-01 3:6.059155e-01 4:3.578091e-01 5:4.857011e-01 6:1.395370e-01 7:1.642263e-01 8:3.164326e-01 9:3.401782e-01 10:2.577245e-01 11:5.367907e-02 12:1.261742e-01 13:1.0 14:5.602320e-01
0 0:14 1:3.220871e-01 2:1.816464e-01 3:3.945151e-01 4:4.601892e-01 5:3.976108e-01 6:2.225568e-01 7:2.194416e-01 8:2.763877e-01 9:3.229424e-01 10:2.511043e-01 11:1.007229e-01 12:1.568662e-01 13:5.602320e-01 14:1.0

test_kernel.out:

1 0:1 1:1.0 2:3.886128e-01 3:3.005489e-02 4:6.381688e-01 5:6.182784e-01 6:6.466103e-03 7:0.000000e+00
1 0:2 1:3.886128e-01 2:1.0 3:3.515368e-02 4:4.655570e-01 5:6.892350e-01 6:1.685364e-02 7:0.000000e+00
1 0:3 1:3.005489e-02 2:3.515368e-02 3:1.0 4:0.000000e+00 5:1.245842e-01 6:3.947336e-01 7:0.000000e+00
1 0:4 1:6.381688e-01 2:4.655570e-01 3:0.000000e+00 4:1.0 5:7.107565e-01 6:0.000000e+00 7:0.000000e+00
1 0:5 1:6.182784e-01 2:6.892350e-01 3:1.245842e-01 4:7.107565e-01 5:1.0 6:5.534643e-02 7:0.000000e+00
1 0:6 1:6.466103e-03 2:1.685364e-02 3:3.947336e-01 4:0.000000e+00 5:5.534643e-02 6:1.0 7:0.000000e+00
0 0:7 1:0.000000e+00 2:0.000000e+00 3:0.000000e+00 4:0.000000e+00 5:0.000000e+00 6:0.000000e+00 7:1.0

[internal testing issue] can't progress in cross-validation and training

Datasets are in p100 server: /data/DATA/zeyi

It seems this issue is due to negative feature values and large C value.

  1. command
./thundersvm-train -s 0 -t 2 -g 0.0125 -c 100 -v 10 hdl_scaled.libsvm

Last output

2017-11-05 08:21:55,933 INFO [default] rho=-25.0388
2017-11-05 08:21:55,933 INFO [default] #SV=33667
2017-11-05 08:21:57,465 INFO [default] 10 fold cross-validation(6/10)
2017-11-05 08:21:58,364 INFO [default] training start
....................

  1. command
./thundersvm-train -s 0 -t 2 -g 0.0125 -c 100 -v 10 svm_fs.txt

Last output

2017-11-05 08:17:27,901 INFO [default] 10 fold cross-validation(1/10)
2017-11-05 08:17:29,467 INFO [default] training start

  1. command
./thundersvm-train -s 0 -t 2 -g 0.125 -c 100 hdl_scaled.libsvm

Last output

2017-11-05 08:39:37,702 INFO [default] training start
......................

  1. command
./thundersvm-train -s 1 -t 2 -g 0.021 -c 10 -n 0.9 hdl_scaled.libsvm

Output

2017-11-05 10:19:44,272 FATAL [default] Check failed: [error == cudaSuccess] out of memory
2017-11-05 10:19:44,272 WARNING [default] Aborting application. Reason: Fatal log at [/home/zeyi/projects/multismo/src/thundersvm/syncmem.cpp:71]
[1] 13569 abort ./thundersvm-train -s 1 -t 2 -g 0.021 -c 10 -n 0.9 hdl_scaled.libsvm

mascot does not compile

current mascot does not seem to compile. there are several errors--
initially i get

$ make
/usr/local/cuda/bin/nvcc -O2 -arch=sm_20 -lrt -o classificationKernel_cu.o -c src/classificationKernel.cu
In file included from src/classificationKernel.cu:2:0:
src/classificationKernel.h:13:32: fatal error: gpu_global_utility.h: No such file or directory
compilation terminated.
Makefile:19: recipe for target 'classificationKernel_cu.o' failed
make: *** [classificationKernel_cu.o] Error 1

when i fix the path, i get "deviceHessian unknown". this i can fix by changing the IFDEF in deviceHessian.h. but then i get gnNumOfThreads not known. i can fix this by removing it by setting it to 8. then i still get path-errors. etc

is the current source code the latest, compiling one?

accuracy problem

situation: train gpu-svm with "-o 2 -g 0.015625 -c 8 dataset/dna.scale "
error: when use our gpu-svm, the test accuracy is 52.05%, but when use libsvm , the test accuracy is 95.447% with the same parameters.
details of gpu-svm are in the following figure

2017-09-09 12 05 21

Is it safe to wrap thundersvm call in parfor of Matlab if there is only one GPU?

For example, a code like this:
parfor i=1:50
svm_train_matlab(option(i)); //option may contains grid search parameters
end

Would it safe to call thundersvm functions like this, i.e., GPU-thread-safe, in Matlab? If a thundersvm function call in a thread tries to make full use of the computational power of the single GPU installed, how about other threads running at the same time? Or, to go one step further, does thundersvm provide any scheduling mechanism or policy about how simultaneous thundersvm calls are running on a single GPU? If not, even it is safe, it makes no sense to warp the calls in parfor. If this issue is not addressed, should we avoid using parfor when calling thundersvm functions? Thanks for a reply.

multidimensional output

Hello, I would like to use Thunder SVM for multidimensional regression, namely, my predicted values are 2 dimensional rather than 1 dimensional. LibSVM supports multidimensional regression. I was wondering, can I do the same with thunder svm? I already tried but it did not work. Thank you very much.

ThunderSVM for Windows

in windows, I use cmake to generate thundersvm Visual Studio Project, but some errors appeared. so does the thundersvm support the training in windows?

seg fault (possible issue using thundersvm in conjunction with Pytorch)

I'm getting a seg fault when I run thundersvm as part of a script that uses Pytorch (as part of a larger machine learning experiment).

[1]    8546 segmentation fault (core dumped)

The logs don't seem too informative:

2018-04-28 10:30:24,614 INFO [default] #instances = 9252, #features = 64
2018-04-28 10:37:28,374 INFO [default] #instances = 9252, #features = 64

Are there known issues with using thundersvm with deep learning libraries that use GPU, such as Pytorch or Tensorflow?

User Error 1001: omp_set_num_threads

Running the windows build and during training/predicting on the latest push:

User Error 1001: omp_set_num_threads must be called with a positive integer
2018-05-14 14:35:02,451 INFO [default] #instances = 7136, #features = 4096
2018-05-14 14:35:03,938 INFO [default] #classes = 2
2018-05-14 14:36:02,830 INFO [default] working set size = 1024
2018-05-14 14:36:02,837 INFO [default] training start
2018-05-14 14:36:03,336 INFO [default] global iter = 0, total local iter = 512, diff = 2
2018-05-14 14:36:07,721 INFO [default] global iter = 48, total local iter = 16874, diff = 0.000993791
2018-05-14 14:36:07,728 INFO [default] rho = -0.00517282
2018-05-14 14:36:07,730 INFO [default] #sv = 7105
2018-05-14 14:36:10,845 INFO [default] #total unique sv = 7105
2018-05-14 14:36:10,912 INFO [default] training finished

Seem training program seems to be ignoring the OMP_NUM_THREADS set in my environmental variables, any idea how to resolve?

Option to disable prediction of train examples after training

Other than sanity testing the training procedure there is no reason to predict the entire training sample after training. It may take a long time and serves no real purpose (in most machine learning applications).

I'd like to suggest a command line option that disables predicting the training samples after training is done. The default may even be "on" to avoid breaking scripts that need to parse that information.

Thanks!

Call for contribution

We are looking for collaborations and contributions on some future features of ThunderSVM.

  • Handling various sparse formats more efficiently
  • ThunderSVM on other architectures such as Arm and FPGAs.
  • An OpenCL version of ThunderSVM
  • Distributed version of ThunderSVM
  • Structured SVMs
  • LIBLINEAR on GPUs
  • Support custom kernels

Matlab, Error using calllib Library was not found

After building, failed to test Matlab examples in Matlab R2017a. The error is "Matlab, Error using calllib Library was not found" for line 15 "calllib('libthundersvm', 'thundersvm_train', length(str2), str2)" in file "svm_train_matlab.m" of \Matlab subdirectory.

Couple of errors while training

Hi,

I am seeing a crash sometimes while using thundersvm with matlab, the stack trace is as follows.

Stack Trace (from fault):
[ 0] 0x00007f500d700428 /lib/x86_64-linux-gnu/libc.so.6+00218152 gsignal+00000056
[ 1] 0x00007f500d70202a /lib/x86_64-linux-gnu/libc.so.6+00225322 abort+00000362
[ 2] 0x00007f4c0e7baac1 /home/aditya/thundersvm/build/lib/libthundersvm.so+00277185 _ZN2el4base6Writer15triggerDispatchEv+00001265
[ 3] 0x00007f4c0e7ba571 /home/aditya/thundersvm/build/lib/libthundersvm.so+00275825 _ZN2el4base6Writer15processDispatchEv+00000641
[ 4] 0x00007f4c0e7c44a2 /home/aditya/thundersvm/build/lib/libthundersvm.so+00316578
[ 5] 0x00007f4ff7f75ab3 /home/aditya/Matlab/bin/glnxa64/../../sys/os/glnxa64/libiomp5.so+00658099 __kmp_invoke_microtask+00000147
[ 6] 0x00007f4ff7f4a9d7 /home/aditya/Matlab/bin/glnxa64/../../sys/os/glnxa64/libiomp5.so+00481751
[ 7] 0x00007f4ff7f4a0da /home/aditya/Matlab/bin/glnxa64/../../sys/os/glnxa64/libiomp5.so+00479450
[ 8] 0x00007f4ff7f75dad /home/aditya/Matlab/bin/glnxa64/../../sys/os/glnxa64/libiomp5.so+00658861
[ 9] 0x00007f500da9c6ba /lib/x86_64-linux-gnu/libpthread.so.0+00030394
[ 10] 0x00007f500d7d241d /lib/x86_64-linux-gnu/libc.so.6+01078301 clone+00000109
[ 11] 0x0000000000000000 +00000000

Randomly, I observe that sometimes model file gets corrupted and I see 2 float values before the support vector instead of one
example:
SV
0.001 0.001 1:0.0069778599 2:0.0189685 3:0.035114001 4:0.0102248

Please let me know if you have seen these issues before.
Thanks for your time.

Regards,
Aditya

OSerror access violation writing when training

I'm using the scikit-learn python wrapper. I think I successfully built thundersvm because VisualStudio didn't report any errors. Using Windows 10 and the winpython distribution.

I can successfully run this command:
clf = SVC(cost = 1,gamma = .1, kernel = 2)

Then I call:
clf.fit(trainData, trainLabels), and I get the following error/trace:

File "C:/Users/Andres/Desktop/getthisright/GPU_SVMwithPermutation.py", line 302, in InnerCV_Angle
clf.fit(inphaseTrainingData, inphaseTrainingLabels)

File "C:\Users\Andres\Desktop\getthisright\thundersvmScikit.py", line 67, in fit
thundersvm.model_free(c_void_p(self.model))

OSError: exception: access violation writing 0x0000000066222618

Do you know what is happening here?

I should mention that just after I built thundersvm, I tried the command "from thundersvmScikit import *" and got an error message saying it couldn't find thundersvmScikit.py. So, I moved thundersvmScikit.py to the same directory as my real script, and this time I was
I moved the thundersvm root folder into the folder with my python script. This time, when I tried to import thundersvmScikit.py, it outputted "please build the library first!" even though everything was built. So, I also moved the thundersvm root folder into the folder containing my script and changed the thundersvmScikit.py script so that it would look for thundersvm in the new location (lines 18-22). I hope those changes didn't lead to this issue. But if they did, then I don't know how else to solve the other issues in this paragraph.

Thank you so much for your help. thundersvm seems like an amazing project that I want to use.

If it's useful, the full trace is this:

Traceback (most recent call last):

File "", line 1, in
runfile('C:/Users/Andres/Desktop/getthisright/GPU_SVMwithPermutation.py', wdir='C:/Users/Andres/Desktop/getthisright')

File "C:\Users\Andres\Desktop\WinPython-64bit-3.6.3.0Qt5\python-3.6.3.amd64\lib\site-packages\spyder\utils\site\sitecustomize.py", line 710, in runfile
execfile(filename, namespace)

File "C:\Users\Andres\Desktop\WinPython-64bit-3.6.3.0Qt5\python-3.6.3.amd64\lib\site-packages\spyder\utils\site\sitecustomize.py", line 101, in execfile
exec(compile(f.read(), filename, 'exec'), namespace)

File "C:/Users/Andres/Desktop/getthisright/GPU_SVMwithPermutation.py", line 621, in
allPerformanceAngle,allFoldsBestParametersAngle, allFoldsParameterInfosAngle = OuterCV_Angle(subjectDataset)

File "C:/Users/Andres/Desktop/getthisright/GPU_SVMwithPermutation.py", line 447, in OuterCV_Angle
nmotionTrainingData, nmotionTrainingLabels, nmotionTrainingLabelsPermuted, nmotionTrainingRuns) #send data to inner loop for parameter selection

File "C:/Users/Andres/Desktop/getthisright/GPU_SVMwithPermutation.py", line 302, in InnerCV_Angle
clf.fit(inphaseTrainingData, inphaseTrainingLabels)

File "C:\Users\Andres\Desktop\getthisright\thundersvmScikit.py", line 67, in fit
thundersvm.model_free(c_void_p(self.model))

OSError: exception: access violation writing 0x0000000066222618

Error with "make -j"

cse@ubuntu:~/thundersvm/build$ sudo cmake -DUSE_CUDA=ON -DUSE_EIGEN=OFF ..

-- The C compiler identification is GNU 4.9.3
-- The CXX compiler identification is GNU 4.9.3
-- 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
-- Try OpenMP C flag = [-fopenmp]
-- Performing Test OpenMP_FLAG_DETECTED
-- Performing Test OpenMP_FLAG_DETECTED - Success
-- Try OpenMP CXX flag = [-fopenmp]
-- Performing Test OpenMP_FLAG_DETECTED
-- Performing Test OpenMP_FLAG_DETECTED - Success
-- Found OpenMP: -fopenmp
Compile with CUDA
-- Configuring done
-- Generating done
-- Build files have been written to: /home/cse/thundersvm/build

cse@ubuntu:~/thundersvm/build$ sudo make -j

[ 1%] Building NVCC (Device) object src/thundersvm/CMakeFiles/thundersvm-train.dir/kernel/thundersvm-train_generated_smo_kernel.cu.o
Scanning dependencies of target googletest
[ 2%] Building NVCC (Device) object src/thundersvm/CMakeFiles/thundersvm.dir/kernel/thundersvm_generated_kernelmatrix_kernel.cu.o
[ 3%] Building NVCC (Device) object src/thundersvm/CMakeFiles/thundersvm.dir/kernel/thundersvm_generated_smo_kernel.cu.o
[ 5%] Building NVCC (Device) object src/thundersvm/CMakeFiles/thundersvm.dir/kernel/thundersvm_generated_kernelmatrix_kernel.cu.o
[ 6%] Building NVCC (Device) object src/thundersvm/CMakeFiles/thundersvm.dir/kernel/thundersvm_generated_smo_kernel.cu.o
[ 7%] Building NVCC (Device) object src/thundersvm/CMakeFiles/thundersvm.dir/kernel/thundersvm_generated_kernelmatrix_kernel.cu.o
[ 8%] Building NVCC (Device) object src/thundersvm/CMakeFiles/thundersvm-predict.dir/kernel/thundersvm-predict_generated_kernelmatrix_kernel.cu.o
[ 10%] Building NVCC (Device) object src/thundersvm/CMakeFiles/thundersvm-train.dir/kernel/thundersvm-train_generated_kernelmatrix_kernel.cu.o
[ 11%] Building NVCC (Device) object src/thundersvm/CMakeFiles/thundersvm-predict.dir/kernel/thundersvm-predict_generated_smo_kernel.cu.o
[ 12%] Building NVCC (Device) object src/thundersvm/CMakeFiles/thundersvm.dir/kernel/thundersvm_generated_smo_kernel.cu.o
[ 13%] Creating directories for 'googletest'
[ 15%] Performing download step (git clone) for 'googletest'
Cloning into 'googletest'...
Error copying file (if different) from "/home/cse/thundersvm/build/src/thundersvm/CMakeFiles/thundersvm.dir/kernel/thundersvm_generated_kernelmatrix_kernel.cu.o.depend.tmp" to "/home/cse/thundersvm/build/src/thundersvm/CMakeFiles/thundersvm.dir/kernel/thundersvm_generated_kernelmatrix_kernel.cu.o.depend".
CMake Error at thundersvm_generated_kernelmatrix_kernel.cu.o.cmake:232 (message):
Error generating
/home/cse/thundersvm/build/src/thundersvm/CMakeFiles/thundersvm.dir/kernel/./thundersvm_generated_kernelmatrix_kernel.cu.o

src/thundersvm/CMakeFiles/thundersvm.dir/build.make:70: recipe for target 'src/thundersvm/CMakeFiles/thundersvm.dir/kernel/thundersvm_generated_kernelmatrix_kernel.cu.o' failed
make[2]: *** [src/thundersvm/CMakeFiles/thundersvm.dir/kernel/thundersvm_generated_kernelmatrix_kernel.cu.o] Error 1
make[2]: *** Waiting for unfinished jobs....
/home/cse/thundersvm/include/thundersvm/util/log.h(1323): warning: call of pure virtual function

/home/cse/thundersvm/include/thundersvm/util/log.h(1323): warning: call of pure virtual function

/home/cse/thundersvm/include/thundersvm/util/log.h(1323): warning: call of pure virtual function

/home/cse/thundersvm/include/thundersvm/util/log.h(1323): warning: call of pure virtual function

/usr/include/string.h: In function ‘void* __mempcpy_inline(void*, const void*, size_t)’:
/usr/include/string.h:652:42: error: ‘memcpy’ was not declared in this scope
return (char ) memcpy (__dest, __src, __n) + __n;
^
/usr/include/string.h: In function ‘void
__mempcpy_inline(void*, const void*, size_t)’:
/usr/include/string.h:652:42: error: ‘memcpy’ was not declared in this scope
return (char ) memcpy (__dest, __src, __n) + __n;
^
/usr/include/string.h: In function ‘void
__mempcpy_inline(void*, const void*, size_t)’:
/usr/include/string.h:652:42: error: ‘memcpy’ was not declared in this scope
return (char ) memcpy (__dest, __src, __n) + __n;
^
/usr/include/string.h: In function ‘void
__mempcpy_inline(void*, const void*, size_t)’:
/usr/include/string.h:652:42: error: ‘memcpy’ was not declared in this scope
return (char *) memcpy (__dest, __src, __n) + __n;
^
Already on 'master'
Your branch is up-to-date with 'origin/master'.
[ 16%] No patch step for 'googletest'
[ 17%] Performing update step for 'googletest'
CMake Error at thundersvm_generated_kernelmatrix_kernel.cu.o.cmake:266 (message):
Error generating file
/home/cse/thundersvm/build/src/thundersvm/CMakeFiles/thundersvm.dir/kernel/./thundersvm_generated_kernelmatrix_kernel.cu.o

src/thundersvm/CMakeFiles/thundersvm-predict.dir/build.make:70: recipe for target 'src/thundersvm/CMakeFiles/thundersvm.dir/kernel/thundersvm_generated_kernelmatrix_kernel.cu.o' failed
make[2]: *** [src/thundersvm/CMakeFiles/thundersvm.dir/kernel/thundersvm_generated_kernelmatrix_kernel.cu.o] Error 1
make[2]: *** Waiting for unfinished jobs....
/home/cse/thundersvm/include/thundersvm/util/log.h(1323): warning: call of pure virtual function

/home/cse/thundersvm/include/thundersvm/util/log.h(1323): warning: call of pure virtual function

/home/cse/thundersvm/include/thundersvm/util/log.h(1323): warning: call of pure virtual function

/home/cse/thundersvm/include/thundersvm/util/log.h(1323): warning: call of pure virtual function

/home/cse/thundersvm/include/thundersvm/util/log.h(1323): warning: call of pure virtual function

CMake Error at thundersvm_generated_kernelmatrix_kernel.cu.o.cmake:266 (message):
Error generating file
/home/cse/thundersvm/build/src/thundersvm/CMakeFiles/thundersvm.dir/kernel/./thundersvm_generated_kernelmatrix_kernel.cu.o

src/thundersvm/CMakeFiles/thundersvm-train.dir/build.make:70: recipe for target 'src/thundersvm/CMakeFiles/thundersvm.dir/kernel/thundersvm_generated_kernelmatrix_kernel.cu.o' failed
make[2]: *** [src/thundersvm/CMakeFiles/thundersvm.dir/kernel/thundersvm_generated_kernelmatrix_kernel.cu.o] Error 1
make[2]: *** Waiting for unfinished jobs....
CMake Error at thundersvm-predict_generated_kernelmatrix_kernel.cu.o.cmake:266 (message):
Error generating file
/home/cse/thundersvm/build/src/thundersvm/CMakeFiles/thundersvm-predict.dir/kernel/./thundersvm-predict_generated_kernelmatrix_kernel.cu.o

src/thundersvm/CMakeFiles/thundersvm-predict.dir/build.make:84: recipe for target 'src/thundersvm/CMakeFiles/thundersvm-predict.dir/kernel/thundersvm-predict_generated_kernelmatrix_kernel.cu.o' failed
make[2]: *** [src/thundersvm/CMakeFiles/thundersvm-predict.dir/kernel/thundersvm-predict_generated_kernelmatrix_kernel.cu.o] Error 1
CMake Error at thundersvm-train_generated_kernelmatrix_kernel.cu.o.cmake:266 (message):
Error generating file
/home/cse/thundersvm/build/src/thundersvm/CMakeFiles/thundersvm-train.dir/kernel/./thundersvm-train_generated_kernelmatrix_kernel.cu.o

src/thundersvm/CMakeFiles/thundersvm-train.dir/build.make:84: recipe for target 'src/thundersvm/CMakeFiles/thundersvm-train.dir/kernel/thundersvm-train_generated_kernelmatrix_kernel.cu.o' failed
make[2]: *** [src/thundersvm/CMakeFiles/thundersvm-train.dir/kernel/thundersvm-train_generated_kernelmatrix_kernel.cu.o] Error 1
Current branch master is up to date.
[ 18%] Performing configure step for 'googletest'
-- The C compiler identification is GNU 4.9.3
-- The CXX compiler identification is GNU 4.9.3
-- 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
-- Found PythonInterp: /usr/bin/python (found version "2.7.12")
-- Looking for pthread.h
-- Looking for pthread.h - found
-- Looking for pthread_create
-- Looking for pthread_create - not found
-- Check if compiler accepts -pthread
-- Check if compiler accepts -pthread - yes
-- Found Threads: TRUE
-- Configuring done
-- Generating done
CMake Warning:
Manually-specified variables were not used by the project:

CMAKE_ARCHIVE_OUTPUT_DIRECTORY_DEBUG
CMAKE_ARCHIVE_OUTPUT_DIRECTORY_RELEASE
CMAKE_C_COMPILIER

-- Build files have been written to: /home/cse/thundersvm/build/src/test/gtest/src/googletest-build
[ 20%] Performing build step for 'googletest'
Scanning dependencies of target gmock
Scanning dependencies of target gtest
Scanning dependencies of target gmock_main
[ 9%] Building CXX object googlemock/gtest/CMakeFiles/gtest.dir/src/gtest-all.cc.o
[ 18%] Building CXX object googlemock/CMakeFiles/gmock.dir/src/gmock-all.cc.o
[ 27%] Building CXX object googlemock/CMakeFiles/gmock.dir//googletest/src/gtest-all.cc.o
[ 36%] Building CXX object googlemock/CMakeFiles/gmock_main.dir/src/gmock_main.cc.o
[ 54%] Building CXX object googlemock/CMakeFiles/gmock_main.dir/
/googletest/src/gtest-all.cc.o
[ 54%] Building CXX object googlemock/CMakeFiles/gmock_main.dir/src/gmock-all.cc.o
/usr/include/string.h: In function ‘void* __mempcpy_inline(void*, const void*, size_t)’:
/usr/include/string.h:652:42: error: ‘memcpy’ was not declared in this scope
return (char ) memcpy (__dest, __src, __n) + __n;
^
/usr/include/string.h: In function ‘void
__mempcpy_inline(void*, const void*, size_t)’:
/usr/include/string.h:652:42: error: ‘memcpy’ was not declared in this scope
return (char ) memcpy (__dest, __src, __n) + __n;
^
/usr/include/string.h: In function ‘void
__mempcpy_inline(void*, const void*, size_t)’:
/usr/include/string.h:652:42: error: ‘memcpy’ was not declared in this scope
return (char ) memcpy (__dest, __src, __n) + __n;
^
/usr/include/string.h: In function ‘void
__mempcpy_inline(void*, const void*, size_t)’:
/usr/include/string.h:652:42: error: ‘memcpy’ was not declared in this scope
return (char ) memcpy (__dest, __src, __n) + __n;
^
/usr/include/string.h: In function ‘void
__mempcpy_inline(void*, const void*, size_t)’:
/usr/include/string.h:652:42: error: ‘memcpy’ was not declared in this scope
return (char *) memcpy (__dest, __src, __n) + __n;
^
[ 63%] Linking CXX static library libgmock.a
[ 72%] Linking CXX static library libgtest.a
[ 72%] Built target gmock
[ 81%] Linking CXX static library libgmock_main.a
[ 81%] Built target gtest
Scanning dependencies of target gtest_main
[ 90%] Building CXX object googlemock/gtest/CMakeFiles/gtest_main.dir/src/gtest_main.cc.o
[ 90%] Built target gmock_main
CMake Error at thundersvm-train_generated_smo_kernel.cu.o.cmake:266 (message):
Error generating file
/home/cse/thundersvm/build/src/thundersvm/CMakeFiles/thundersvm-train.dir/kernel/./thundersvm-train_generated_smo_kernel.cu.o

src/thundersvm/CMakeFiles/thundersvm-train.dir/build.make:77: recipe for target 'src/thundersvm/CMakeFiles/thundersvm-train.dir/kernel/thundersvm-train_generated_smo_kernel.cu.o' failed
make[2]: *** [src/thundersvm/CMakeFiles/thundersvm-train.dir/kernel/thundersvm-train_generated_smo_kernel.cu.o] Error 1
[100%] Linking CXX static library libgtest_main.a
[100%] Built target gtest_main
[ 21%] No install step for 'googletest'
[ 22%] Completed 'googletest'
[ 22%] Built target googletest
CMake Error at thundersvm_generated_smo_kernel.cu.o.cmake:266 (message):
Error generating file
/home/cse/thundersvm/build/src/thundersvm/CMakeFiles/thundersvm.dir/kernel/./thundersvm_generated_smo_kernel.cu.o

src/thundersvm/CMakeFiles/thundersvm-predict.dir/build.make:63: recipe for target 'src/thundersvm/CMakeFiles/thundersvm.dir/kernel/thundersvm_generated_smo_kernel.cu.o' failed
make[2]: *** [src/thundersvm/CMakeFiles/thundersvm.dir/kernel/thundersvm_generated_smo_kernel.cu.o] Error 1
CMake Error at thundersvm_generated_smo_kernel.cu.o.cmake:266 (message):
Error generating file
/home/cse/thundersvm/build/src/thundersvm/CMakeFiles/thundersvm.dir/kernel/./thundersvm_generated_smo_kernel.cu.o

src/thundersvm/CMakeFiles/thundersvm-train.dir/build.make:63: recipe for target 'src/thundersvm/CMakeFiles/thundersvm.dir/kernel/thundersvm_generated_smo_kernel.cu.o' failed
make[2]: *** [src/thundersvm/CMakeFiles/thundersvm.dir/kernel/thundersvm_generated_smo_kernel.cu.o] Error 1
CMakeFiles/Makefile2:158: recipe for target 'src/thundersvm/CMakeFiles/thundersvm-train.dir/all' failed
make[1]: *** [src/thundersvm/CMakeFiles/thundersvm-train.dir/all] Error 2
make[1]: *** Waiting for unfinished jobs....
CMake Error at thundersvm-predict_generated_smo_kernel.cu.o.cmake:266 (message):
Error generating file
/home/cse/thundersvm/build/src/thundersvm/CMakeFiles/thundersvm-predict.dir/kernel/./thundersvm-predict_generated_smo_kernel.cu.o

src/thundersvm/CMakeFiles/thundersvm-predict.dir/build.make:77: recipe for target 'src/thundersvm/CMakeFiles/thundersvm-predict.dir/kernel/thundersvm-predict_generated_smo_kernel.cu.o' failed
make[2]: *** [src/thundersvm/CMakeFiles/thundersvm-predict.dir/kernel/thundersvm-predict_generated_smo_kernel.cu.o] Error 1
CMakeFiles/Makefile2:195: recipe for target 'src/thundersvm/CMakeFiles/thundersvm-predict.dir/all' failed
make[1]: *** [src/thundersvm/CMakeFiles/thundersvm-predict.dir/all] Error 2
CMake Error at thundersvm_generated_smo_kernel.cu.o.cmake:266 (message):
Error generating file
/home/cse/thundersvm/build/src/thundersvm/CMakeFiles/thundersvm.dir/kernel/./thundersvm_generated_smo_kernel.cu.o

src/thundersvm/CMakeFiles/thundersvm.dir/build.make:63: recipe for target 'src/thundersvm/CMakeFiles/thundersvm.dir/kernel/thundersvm_generated_smo_kernel.cu.o' failed
make[2]: *** [src/thundersvm/CMakeFiles/thundersvm.dir/kernel/thundersvm_generated_smo_kernel.cu.o] Error 1
CMakeFiles/Makefile2:121: recipe for target 'src/thundersvm/CMakeFiles/thundersvm.dir/all' failed
make[1]: *** [src/thundersvm/CMakeFiles/thundersvm.dir/all] Error 2
Makefile:83: recipe for target 'all' failed
make: *** [all] Error 2

error appears when assign some specific value to gamma or C

Situation: train "scene" dataset with taskType=5 (i.e. train OVA SVM), with gamma=0.5, C=10
Error: While evaluate the bianry classifier (in function: evaluate() ) in file "trainClassifier.cu", segmentation cudaError appears (see the following figure)
image

Situation: train "mnist" dataset in OVO scheme, with C<1, gamma as default
Error: segmentation fault appears ( see the following figure) .
image

Build error Windows Visual studio 2017

windows 10, visual studio 2017, cuda 9.1

git clone https://github.com/zeyiwen/thundersvm.git cd thundersvm mkdir build cd build cmake .. -DCMAKE_WINDOWS_EXPORT_ALL_SYMBOLS=TRUE -DBUILD_SHARED_LIBS=TRUE -G "Visual Studio 15 2017 Win64"

-- The C compiler identification is MSVC 19.13.26131.1 -- The CXX compiler identification is MSVC 19.13.26131.1 -- Check for working C compiler: C:/Program Files (x86)/Microsoft Visual Studio/2017/Community/VC/Tools/MSVC/14.13.26128/bin/Hostx86/x64/cl.exe -- Check for working C compiler: C:/Program Files (x86)/Microsoft Visual Studio/2017/Community/VC/Tools/MSVC/14.13.26128/bin/Hostx86/x64/cl.exe -- works -- Detecting C compiler ABI info -- Detecting C compiler ABI info - done -- Check for working CXX compiler: C:/Program Files (x86)/Microsoft Visual Studio/2017/Community/VC/Tools/MSVC/14.13.26128/bin/Hostx86/x64/cl.exe -- Check for working CXX compiler: C:/Program Files (x86)/Microsoft Visual Studio/2017/Community/VC/Tools/MSVC/14.13.26128/bin/Hostx86/x64/cl.exe -- works -- Detecting CXX compiler ABI info -- Detecting CXX compiler ABI info - done -- Detecting CXX compile features -- Detecting CXX compile features - done Compile with CUDA -- Configuring done -- Generating done -- Build files have been written to: C:/Users/Eric/source/repos/thundersvm/build

then I open the solution with Visual studio, select the "Release" and build it, the following output it generated:

1>------ Build started: Project: ZERO_CHECK, Configuration: Release x64 ------ 1>Checking Build System 1>CMake does not need to re-run because C:/Users/Me/source/repos/thundersvm/build/CMakeFiles/generate.stamp is up-to-date. 1>CMake does not need to re-run because C:/Users/Me/source/repos/thundersvm/build/src/thundersvm/CMakeFiles/generate.stamp is up-to-date. 2>------ Build started: Project: thundersvm, Configuration: Release x64 ------ 2>Building NVCC (Device) object src/thundersvm/CMakeFiles/thundersvm.dir/kernel/Release/thundersvm_generated_kernelmatrix_kernel.cu.obj 2>kernelmatrix_kernel.cu 2>CUSTOMBUILD : nvcc warning : The -std=c++11 flag is not supported with the configured host compiler. Flag will be ignored. 2>C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.13.26128\include\type_traits(506): error : expression must have a constant value 2> 2>C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.13.26128\include\type_traits(507): error : expression must have a constant value 2> 2>C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.13.26128\include\type_traits(508): error : expression must have a constant value 2> 2>C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.13.26128\include\type_traits(540): error : expression must have a constant value 2> 2>C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.13.26128\include\type_traits(1045): error : expression must have a constant value 2> 2>C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.13.26128\include\type_traits(1560): error : expression must have a constant value 2> 2>C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.13.26128\include\type_traits(2375): error : expression must have a constant value 2> 2>C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.13.26128\include\type_traits(2375): error : expression must have a constant value 2> 2>C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.13.26128\include\xutility(543): error : expression must have a constant value 2> 2>C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.13.26128\include\xtr1common(58): error : class "std::enable_if<<error-constant>, int>" has no member "type" 2> detected during instantiation of type "std::enable_if_t<<error-constant>, int>" 2>C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.13.26128\include\xutility(543): here 2> 2>C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.13.26128\include\xmemory0(363): error : expression must have a constant value 2> 2>C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.13.26128\include\xmemory0(981): error : expression must have a constant value 2> 2>C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.13.26128\include\xmemory0(1302): error : expression must have a constant value 2> 2>C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.13.26128\include\xstring(1891): error : expression must have a constant value 2> 2>C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.13.26128\include\xtr1common(58): error : class "std::enable_if<<error-constant>, void>" has no member "type" 2> detected during instantiation of type "std::enable_if_t<<error-constant>, void>" 2>C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.13.26128\include\xstring(1891): here 2> 2>C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.13.26128\include\xutility(298): error : expression must have a constant value 2> 2>C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.13.26128\include\vector(474): error : expression must have a constant value 2> 2>C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.13.26128\include\tuple(88): error : expression must have a constant value 2> 2>C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.13.26128\include\tuple(89): error : expression must have a constant value 2> 2>C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.13.26128\include\tuple(90): error : expression must have a constant value 2> 2>C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.13.26128\include\tuple(109): error : expression must have a constant value 2> 2>C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.13.26128\include\tuple(110): error : expression must have a constant value 2> 2>C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.13.26128\include\tuple(111): error : expression must have a constant value 2> 2>C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.13.26128\include\tuple(163): error : expression must have a constant value 2> 2>C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.13.26128\include\tuple(182): error : expression must have a constant value 2> 2>C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.13.26128\include\tuple(184): error : invalid redeclaration of member function template "std::_Tuple_val<_Ty>::_Tuple_val(const _Alloc &, std::allocator_arg_t, _Other &&...)" 2>(164): here 2> 2>C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.13.26128\include\tuple(864): error : no instance of overloaded function "std::tuple<_This, _Rest...>::tuple" matches the specified type 2> 2>C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.13.26128\include\tuple(876): error : no instance of overloaded function "std::tuple<_This, _Rest...>::tuple" matches the specified type 2> 2>C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.13.26128\include\xtree(589): error : expression must have a constant value 2> 2>C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.13.26128\include\xtree(1345): error : expression must have a constant value 2> 2>C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.13.26128\include\functional(401): error : expression must have a constant value 2> 2>C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.13.26128\include\memory(1540): error : expression must have a constant value 2> 2>C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.13.26128\include\memory(1547): error : expression must have a constant value 2> 2>C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.13.26128\include\memory(2496): error : constant value is not known 2> 2>C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.13.26128\include\memory(2596): error : expression must have a constant value 2> 2>c:\users\me\source\repos\thundersvm\include\thundersvm\util/log.h(1361): warning : exception specification for virtual function "el::base::utils::AbstractRegistry<T_Ptr, Container>::~AbstractRegistry [with T_Ptr=T_Ptr, Container=std::map<T_Key, T_Ptr *, std::less<T_Key>, std::allocator<std::pair<const T_Key, T_Ptr *>>>]" is incompatible with that of overridden function "el::base::threading::ThreadSafe::~ThreadSafe" 2> 2>c:\users\me\source\repos\thundersvm\include\thundersvm\util/log.h(1361): warning : exception specification for virtual function "el::base::utils::AbstractRegistry<T_Ptr, Container>::~AbstractRegistry [with T_Ptr=T_Ptr, Container=std::vector<T_Ptr *, std::allocator<T_Ptr *>>]" is incompatible with that of overridden function "el::base::threading::ThreadSafe::~ThreadSafe" 2> 2>0x00007FF7F5CF40C5 (0x0000000000000000 0x00000274703B2908 0x0000027468432428 0x0000000000000000) 2>0x00007FF7F5CF0E48 (0x0000000000000000 0x0000027400000000 0x0000000000000000 0x0000000000000000) 2>0x00007FF7F5CF1BA2 (0x00000274703D17E0 0x0000000000000000 0x0000000000000000 0x0000000000000000) 2>0x00007FF7F5D25B45 (0x00000274703AFC07 0x0000000000000001 0x0000027400000001 0x0000000000000001) 2>0x00007FF7F5D20083 (0x0000027400000001 0x0000009C3B9FC608 0x0000009C3B9FCCB0 0x0000000000000001) 2>0x00007FF7F5BA40A7 (0x0000009C00000000 0x0000000000000000 0x0000009C3B9FC6F0 0x00000274703B2878) 2>0x00007FF7F5BA9461 (0x0000000000000001 0x000000003892A7CC 0x0000000000000000 0x00007FF7F5D16B30) 2>0x00007FF7F5BA9160 (0x0000000000000800 0x0000000000000001 0x0000027400000000 0x0000000000000000) 2>0x00007FF7F5C0B8AD (0x000002747038F668 0x00000274703B27A0 0x000002747037C6D0 0x000002746624E5F8) 2>0x00007FF7F5C0C869 (0x000002746624E5F8 0x0000009C3B9FD5C0 0x000002747037C6D0 0x00007FF7F5C04D0D) 2>0x00007FF7F5C0B6D8 (0x000002746624E5F8 0x00000274703B2830 0x0000000000000000 0x00000274702F5780) 2>0x00007FF7F5D315CD (0x0000027470367C38 0x0000009C3B9FD230 0x000002747038F0C8 0x00000274681A5340) 2>0x00007FF7F5D18F40 (0x00000274681A5D78 0x000002747038F0C8 0x00000274681A5340 0x00007FF700000000) 2>0x00007FF7F5D189E2 (0x0000000000000000 0x0000009C3B9FD331 0x0000009C3B9FD5C0 0x0000000000000000) 2>0x00007FF7F5D1996D (0x0000000000000000 0x00000274703B27A0 0x000002747037C6D0 0x000002747037E220) 2>0x00007FF7F5D199E6 (0x0000000000000000 0x00000274703B27A0 0x000002747037C6D0 0x000002747037E220) 2>0x00007FF7F5D313E9 (0x0000000000000000 0x0000009C3B9FD700 0x00000274703B27A0 0x0000000000000001) 2>0x00007FF7F5D125A8 (0x00000274703B27A0 0x000002747037E1F0 0x0000009C00000000 0x000002747037E1F0) 2>0x00007FF7F5D36E1A (0x0000009C3B9FD7A8 0x0000000000000000 0x0000027470390228 0x0000000000000000) 2>0x00007FF7F5D36CD8 (0x000002747037E1F0 0x000002747037E268 0x0000000000000000 0x0000027470367EE0) 2>0x00007FF7F5CD1BA6 (0x0000000000000000 0x0000027468E37A68 0x00000274700AB910 0x0000000000000000) 2>0x00007FF7F5CCF11D (0x000002747037E1F0 0x000002747037C320 0x0000000000000000 0x000002747037E1F0) 2>0x00007FF7F5CDED0F (0x0000000000000000 0x00007FF700000000 0x0000000000000000 0x00000274700AB910) 2>0x00007FF7F5CDB62E (0x000002747037C320 0x0000009C00000000 0x0000000000000000 0x0000000000000001) 2>0x00007FF7F5BB31AF (0x000002747037C320 0x0000009C3B9FE050 0x0000027470367EE0 0x0000000000000000) 2>0x00007FF7F5BAF41E (0x0000027470367EE0 0x0000009C3B9FDEF0 0x0000000000000000 0x0000009C3B9FE050) 2>0x00007FF7F5B69289 (0x0000003F0007A5B7 0x0000000000124E44 0x00000274703C0A98 0x00000274703C0A50) 2>0x00007FF7F5B63938 (0x0000027470368AD8 0x0000000000000001 0x0000027470368A09 0x0000027400000000) 2>0x00007FF7F5BFCFE8 (0x0000027470368AD8 0x00000274702C7A00 0x0000027467BC865B 0x00000274702C7A00) 2>0x00007FF7F5B3781B (0x00000274661DDA08 0x0000027400000000 0x0000000000000000 0x0000000000000000) 2>0x00007FF7F5B3CA91 (0x0000009C3B9FEA10 0x0000009C3B9FE4F0 0x0000027470368068 0x00000274703741F8) 2>0x00007FF7F5B3CC16 (0x0000009C3B9FE4F0 0x0000009C3B9FEA10 0x0000000000000000 0x0000027470368068) 2>0x00007FF7F5B82DFE (0x000000000000000A 0x0000000000000000 0x0000000000000000 0x00007FF7F5D57E90) 2>0x00007FF7F5B857B7 (0x0000000008A008B3 0x0000000000000000 0x0000009C3B9FE940 0x0000009C00000000) 2>0x00007FF7F5B7BF52 (0x0000009C3B9FEB00 0x000015318DC1A4E1 0x0000000000000000 0x0000009C3B9FEB40) 2>0x00007FF7F5B73FE0 (0x0000000E0007A0F8 0x0000009C3B9FEC89 0x0000027470077E78 0x0000009C3B9FEC89) 2>0x00007FF7F5B78B51 (0x0000009C3B9FED80 0x0000027400000000 0x0000009C3B9FEF40 0x0000009C3B9FED60) 2>0x00007FF7F5B6CC8B (0x0000000000000000 0x0000000000000000 0x0000000000000000 0x0000009C3B9FEE50) 2>0x00007FF7F5B7BE9C (0x00000274662527C0 0x0000027400000000 0x0000000000000000 0x0000000000000006) 2>0x00007FF7F5B7D65A (0x0000000000000000 0x0000027400000000 0x0000000000000000 0x0000000000000000) 2>0x00007FF7F5D45C84 (0x000002746617C750 0x0000027466190960 0x0000000000000000 0x0000000000000000) 2>0x00007FF7F5B0ECA1 (0x0000000000000000 0x000002746617C750 0x0000000000000000 0x000000000000000F) 2>CUSTOMBUILD : nvcc warning : The -std=c++11 flag is not supported with the configured host compiler. Flag will be ignored. 2>kernelmatrix_kernel.cu 2>CUSTOMBUILD : nvcc error : 'cicc' died with status 0xC0000005 (ACCESS_VIOLATION) 2>0x00007FF7F5B0EE09 (0xCMake Error at thundersvm_generated_kernelmatrix_kernel.cu.obj.Release.cmake:279 (message): 2> Error generating file 2> C:/Users/Me/source/repos/thundersvm/build/src/thundersvm/CMakeFiles/thundersvm.dir/kernel/Release/thundersvm_generated_kernelmatrix_kernel.cu.obj 2> 2> 2>Done building project "thundersvm.vcxproj" -- FAILED. 3>------ Build started: Project: thundersvm-predict, Configuration: Release x64 ------ 4>------ Build started: Project: thundersvm-train, Configuration: Release x64 ------ 3>Building Custom Rule C:/Users/Me/source/repos/thundersvm/src/thundersvm/CMakeLists.txt 3>CMake is re-running because C:/Users/Me/source/repos/thundersvm/build/src/thundersvm/CMakeFiles/generate.stamp is out-of-date. 3> the file 'C:/Users/Me/source/repos/thundersvm/build/src/thundersvm/CMakeFiles/thundersvm.dir/kernel/thundersvm_generated_kernelmatrix_kernel.cu.obj.depend' 3> is newer than 'C:/Users/Me/source/repos/thundersvm/build/src/thundersvm/CMakeFiles/generate.stamp.depend' 3> result='-1' 3>Compile with CUDA 3>-- Configuring done 4>Building Custom Rule C:/Users/Me/source/repos/thundersvm/src/thundersvm/CMakeLists.txt 4>CMake is re-running because C:/Users/Me/source/repos/thundersvm/build/src/thundersvm/CMakeFiles/generate.stamp is out-of-date. 4> the file 'C:/Users/Me/source/repos/thundersvm/build/src/thundersvm/CMakeFiles/thundersvm.dir/kernel/thundersvm_generated_kernelmatrix_kernel.cu.obj.depend' 4> is newer than 'C:/Users/Me/source/repos/thundersvm/build/src/thundersvm/CMakeFiles/generate.stamp.depend' 4> result='-1' 3>-- Generating done 4>Compile with CUDA 3>-- Build files have been written to: C:/Users/Me/source/repos/thundersvm/build 4>-- Configuring done 3>thundersvm-predict.cpp 4>-- Generating done 4>-- Build files have been written to: C:/Users/Me/source/repos/thundersvm/build 4>thundersvm-train.cpp 3>LINK : fatal error LNK1181: cannot open input file '..\..\lib\Release\thundersvm.lib' 3>Done building project "thundersvm-predict.vcxproj" -- FAILED. 4>LINK : fatal error LNK1181: cannot open input file '..\..\lib\Release\thundersvm.lib' 4>Done building project "thundersvm-train.vcxproj" -- FAILED. 5>------ Skipped Build: Project: ALL_BUILD, Configuration: Release x64 ------ 5>Project not selected to build for this solution configuration ========== Build: 1 succeeded, 3 failed, 0 up-to-date, 1 skipped ==========

I tried to force the language setting to /std:c++14 in visual studio to no effect. I guess it needs to be changed somewhere else.

Query regarding linear kernel

Hi,

I am using a linear kernel with '-t 0' option. In order to compute the weight vector, I am reading the model file line by line and adding coefficient*support_vector to my global weight vector. Once I go through all the support vectors, I will have my final weight vector. This was the equivalent of the approach described in libsvm FAQ.

As I am reading my model file line by line, it is taking some extra time for this computation. Is there a simpler way of getting the weight vector for thundersvm.

Thanks for your time.

Regards,
Aditya

Unable to build on MacOS 10.12.6

Hello,
I would like to use ThunderSVM! However, I'm unable to build under Mac OS 10.12.6 with Xcode 9.2. The OpenMP configuration fails as below.

The contents of CMakeError.log (also below) suggest it is due to Apple Clang not supporting OpenMP. I see in the git log that you support MacOS....How do you work around this OpenMP issue?
Thanks!
-Ramy

========================================================================

❯ mkdir build && cd build && cmake .. && make -j
-- The C compiler identification is AppleClang 9.0.0.9000039
-- The CXX compiler identification is AppleClang 9.0.0.9000039
-- Check for working C compiler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/cc
-- Check for working C compiler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/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: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/c++
-- Check for working CXX compiler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/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 - found
-- Found Threads: TRUE
-- Try OpenMP C flag = [-fopenmp=libomp]
-- Performing Test OpenMP_FLAG_DETECTED
-- Performing Test OpenMP_FLAG_DETECTED - Failed
-- Try OpenMP C flag = [ ]
-- Performing Test OpenMP_FLAG_DETECTED
-- Performing Test OpenMP_FLAG_DETECTED - Failed
-- Try OpenMP C flag = [-fopenmp]
-- Performing Test OpenMP_FLAG_DETECTED
-- Performing Test OpenMP_FLAG_DETECTED - Failed
-- Try OpenMP C flag = [/openmp]
-- Performing Test OpenMP_FLAG_DETECTED
-- Performing Test OpenMP_FLAG_DETECTED - Failed
-- Try OpenMP C flag = [-Qopenmp]
-- Performing Test OpenMP_FLAG_DETECTED
-- Performing Test OpenMP_FLAG_DETECTED - Failed
-- Try OpenMP C flag = [-openmp]
-- Performing Test OpenMP_FLAG_DETECTED
-- Performing Test OpenMP_FLAG_DETECTED - Failed
-- Try OpenMP C flag = [-xopenmp]
-- Performing Test OpenMP_FLAG_DETECTED
-- Performing Test OpenMP_FLAG_DETECTED - Failed
-- Try OpenMP C flag = [+Oopenmp]
-- Performing Test OpenMP_FLAG_DETECTED
-- Performing Test OpenMP_FLAG_DETECTED - Failed
-- Try OpenMP C flag = [-qsmp]
-- Performing Test OpenMP_FLAG_DETECTED
-- Performing Test OpenMP_FLAG_DETECTED - Failed
-- Try OpenMP C flag = [-mp]
-- Performing Test OpenMP_FLAG_DETECTED
-- Performing Test OpenMP_FLAG_DETECTED - Failed
-- Try OpenMP CXX flag = [-fopenmp=libomp]
-- Performing Test OpenMP_FLAG_DETECTED
-- Performing Test OpenMP_FLAG_DETECTED - Failed
-- Try OpenMP CXX flag = [ ]
-- Performing Test OpenMP_FLAG_DETECTED
-- Performing Test OpenMP_FLAG_DETECTED - Failed
-- Try OpenMP CXX flag = [-fopenmp]
-- Performing Test OpenMP_FLAG_DETECTED
-- Performing Test OpenMP_FLAG_DETECTED - Failed
-- Try OpenMP CXX flag = [/openmp]
-- Performing Test OpenMP_FLAG_DETECTED
-- Performing Test OpenMP_FLAG_DETECTED - Failed
-- Try OpenMP CXX flag = [-Qopenmp]
-- Performing Test OpenMP_FLAG_DETECTED
-- Performing Test OpenMP_FLAG_DETECTED - Failed
-- Try OpenMP CXX flag = [-openmp]
-- Performing Test OpenMP_FLAG_DETECTED
-- Performing Test OpenMP_FLAG_DETECTED - Failed
-- Try OpenMP CXX flag = [-xopenmp]
-- Performing Test OpenMP_FLAG_DETECTED
-- Performing Test OpenMP_FLAG_DETECTED - Failed
-- Try OpenMP CXX flag = [+Oopenmp]
-- Performing Test OpenMP_FLAG_DETECTED
-- Performing Test OpenMP_FLAG_DETECTED - Failed
-- Try OpenMP CXX flag = [-qsmp]
-- Performing Test OpenMP_FLAG_DETECTED
-- Performing Test OpenMP_FLAG_DETECTED - Failed
-- Try OpenMP CXX flag = [-mp]
-- Performing Test OpenMP_FLAG_DETECTED
-- Performing Test OpenMP_FLAG_DETECTED - Failed
CMake Error at /usr/local/Cellar/cmake/3.8.2/share/cmake/Modules/FindPackageHandleStandardArgs.cmake:137 (message):
Could NOT find OpenMP (missing: OpenMP_C_FLAGS OpenMP_CXX_FLAGS)
Call Stack (most recent call first):
/usr/local/Cellar/cmake/3.8.2/share/cmake/Modules/FindPackageHandleStandardArgs.cmake:377 (_FPHSA_FAILURE_MESSAGE)
/usr/local/Cellar/cmake/3.8.2/share/cmake/Modules/FindOpenMP.cmake:316 (find_package_handle_standard_args)
CMakeLists.txt:16 (find_package)

========================================================================
Contents of Error log below

========================================================================

Run Build Command:"/usr/bin/make" "cmTC_6c95c/fast"
/Applications/Xcode.app/Contents/Developer/usr/bin/make -f CMakeFiles/cmTC_6c95c.dir/build.make CMakeFiles/cmTC_6c95c.dir/build
Building C object CMakeFiles/cmTC_6c95c.dir/src.c.o
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/cc -DOpenMP_FLAG_DETECTED -fopenmp=libomp -o CMakeFiles/cmTC_6c95c.dir/src.c.o -c /Users/sadekrs1/work/virga/training/thundersvm/build/CMakeFiles/CMakeTmp/src.c
clang: error: unsupported argument 'libomp' to option 'fopenmp='
make[1]: *** [CMakeFiles/cmTC_6c95c.dir/src.c.o] Error 1
make: *** [cmTC_6c95c/fast] Error 2

Source file was:

#include <omp.h>
int main() {
#ifdef _OPENMP
return 0;
#else
breaks_on_purpose
#endif
}

Performing C SOURCE FILE Test OpenMP_FLAG_DETECTED failed with the following output:
Change Dir: /Users/sadekrs1/work/virga/training/thundersvm/build/CMakeFiles/CMakeTmp

Run Build Command:"/usr/bin/make" "cmTC_3c8dd/fast"
/Applications/Xcode.app/Contents/Developer/usr/bin/make -f CMakeFiles/cmTC_3c8dd.dir/build.make CMakeFiles/cmTC_3c8dd.dir/build
Building C object CMakeFiles/cmTC_3c8dd.dir/src.c.o
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/cc -DOpenMP_FLAG_DETECTED -o CMakeFiles/cmTC_3c8dd.dir/src.c.o -c /Users/sadekrs1/work/virga/training/thundersvm/build/CMakeFiles/CMakeTmp/src.c
/Users/sadekrs1/work/virga/training/thundersvm/build/CMakeFiles/CMakeTmp/src.c:2:10: fatal error: 'omp.h' file not found
#include <omp.h>
^~~~~~~
1 error generated.
make[1]: *** [CMakeFiles/cmTC_3c8dd.dir/src.c.o] Error 1
make: *** [cmTC_3c8dd/fast] Error 2

Source file was:

#include <omp.h>
int main() {
#ifdef _OPENMP
return 0;
#else
breaks_on_purpose
#endif
}

Performing C SOURCE FILE Test OpenMP_FLAG_DETECTED failed with the following output:
Change Dir: /Users/sadekrs1/work/virga/training/thundersvm/build/CMakeFiles/CMakeTmp

Run Build Command:"/usr/bin/make" "cmTC_9977f/fast"
/Applications/Xcode.app/Contents/Developer/usr/bin/make -f CMakeFiles/cmTC_9977f.dir/build.make CMakeFiles/cmTC_9977f.dir/build
Building C object CMakeFiles/cmTC_9977f.dir/src.c.o
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/cc -DOpenMP_FLAG_DETECTED -fopenmp -o CMakeFiles/cmTC_9977f.dir/src.c.o -c /Users/sadekrs1/work/virga/training/thundersvm/build/CMakeFiles/CMakeTmp/src.c
clang: error: unsupported option '-fopenmp'
make[1]: *** [CMakeFiles/cmTC_9977f.dir/src.c.o] Error 1
make: *** [cmTC_9977f/fast] Error 2

Source file was:

#include <omp.h>
int main() {
#ifdef _OPENMP
return 0;
#else
breaks_on_purpose
#endif
}

Performing C SOURCE FILE Test OpenMP_FLAG_DETECTED failed with the following output:
Change Dir: /Users/sadekrs1/work/virga/training/thundersvm/build/CMakeFiles/CMakeTmp

Run Build Command:"/usr/bin/make" "cmTC_8402c/fast"
/Applications/Xcode.app/Contents/Developer/usr/bin/make -f CMakeFiles/cmTC_8402c.dir/build.make CMakeFiles/cmTC_8402c.dir/build
Building C object CMakeFiles/cmTC_8402c.dir/src.c.o
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/cc -DOpenMP_FLAG_DETECTED /openmp -o CMakeFiles/cmTC_8402c.dir/src.c.o -c /Users/sadekrs1/work/virga/training/thundersvm/build/CMakeFiles/CMakeTmp/src.c
clang: error: no such file or directory: '/openmp'
make[1]: *** [CMakeFiles/cmTC_8402c.dir/src.c.o] Error 1
make: *** [cmTC_8402c/fast] Error 2

Source file was:

#include <omp.h>
int main() {
#ifdef _OPENMP
return 0;
#else
breaks_on_purpose
#endif
}

Performing C SOURCE FILE Test OpenMP_FLAG_DETECTED failed with the following output:
Change Dir: /Users/sadekrs1/work/virga/training/thundersvm/build/CMakeFiles/CMakeTmp

Run Build Command:"/usr/bin/make" "cmTC_02058/fast"
/Applications/Xcode.app/Contents/Developer/usr/bin/make -f CMakeFiles/cmTC_02058.dir/build.make CMakeFiles/cmTC_02058.dir/build
Building C object CMakeFiles/cmTC_02058.dir/src.c.o
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/cc -DOpenMP_FLAG_DETECTED -Qopenmp -o CMakeFiles/cmTC_02058.dir/src.c.o -c /Users/sadekrs1/work/virga/training/thundersvm/build/CMakeFiles/CMakeTmp/src.c
clang: error: unknown argument: '-Qopenmp'
make[1]: *** [CMakeFiles/cmTC_02058.dir/src.c.o] Error 1
make: *** [cmTC_02058/fast] Error 2

Source file was:

#include <omp.h>
int main() {
#ifdef _OPENMP
return 0;
#else
breaks_on_purpose
#endif
}

Performing C SOURCE FILE Test OpenMP_FLAG_DETECTED failed with the following output:
Change Dir: /Users/sadekrs1/work/virga/training/thundersvm/build/CMakeFiles/CMakeTmp

Run Build Command:"/usr/bin/make" "cmTC_42a97/fast"
/Applications/Xcode.app/Contents/Developer/usr/bin/make -f CMakeFiles/cmTC_42a97.dir/build.make CMakeFiles/cmTC_42a97.dir/build
Building C object CMakeFiles/cmTC_42a97.dir/src.c.o
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/cc -DOpenMP_FLAG_DETECTED -openmp -o CMakeFiles/cmTC_42a97.dir/src.c.o -c /Users/sadekrs1/work/virga/training/thundersvm/build/CMakeFiles/CMakeTmp/src.c
/Users/sadekrs1/work/virga/training/thundersvm/build/CMakeFiles/CMakeTmp/src.c:2:10: fatal error: 'omp.h' file not found
#include <omp.h>
^~~~~~~
1 error generated.
make[1]: *** [CMakeFiles/cmTC_42a97.dir/src.c.o] Error 1
make: *** [cmTC_42a97/fast] Error 2

Source file was:

#include <omp.h>
int main() {
#ifdef _OPENMP
return 0;
#else
breaks_on_purpose
#endif
}

Performing C SOURCE FILE Test OpenMP_FLAG_DETECTED failed with the following output:
Change Dir: /Users/sadekrs1/work/virga/training/thundersvm/build/CMakeFiles/CMakeTmp

Run Build Command:"/usr/bin/make" "cmTC_40796/fast"
/Applications/Xcode.app/Contents/Developer/usr/bin/make -f CMakeFiles/cmTC_40796.dir/build.make CMakeFiles/cmTC_40796.dir/build
Building C object CMakeFiles/cmTC_40796.dir/src.c.o
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/cc -DOpenMP_FLAG_DETECTED -xopenmp -o CMakeFiles/cmTC_40796.dir/src.c.o -c /Users/sadekrs1/work/virga/training/thundersvm/build/CMakeFiles/CMakeTmp/src.c
clang: error: language not recognized: 'openmp'
clang: warning: /Users/sadekrs1/work/virga/training/thundersvm/build/CMakeFiles/CMakeTmp/src.c: 'linker' input unused [-Wunused-command-line-argument]
make[1]: *** [CMakeFiles/cmTC_40796.dir/src.c.o] Error 1
make: *** [cmTC_40796/fast] Error 2

Source file was:

#include <omp.h>
int main() {
#ifdef _OPENMP
return 0;
#else
breaks_on_purpose
#endif
}

Performing C SOURCE FILE Test OpenMP_FLAG_DETECTED failed with the following output:
Change Dir: /Users/sadekrs1/work/virga/training/thundersvm/build/CMakeFiles/CMakeTmp

Run Build Command:"/usr/bin/make" "cmTC_0f4a9/fast"
/Applications/Xcode.app/Contents/Developer/usr/bin/make -f CMakeFiles/cmTC_0f4a9.dir/build.make CMakeFiles/cmTC_0f4a9.dir/build
Building C object CMakeFiles/cmTC_0f4a9.dir/src.c.o
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/cc -DOpenMP_FLAG_DETECTED +Oopenmp -o CMakeFiles/cmTC_0f4a9.dir/src.c.o -c /Users/sadekrs1/work/virga/training/thundersvm/build/CMakeFiles/CMakeTmp/src.c
clang: error: no such file or directory: '+Oopenmp'
make[1]: *** [CMakeFiles/cmTC_0f4a9.dir/src.c.o] Error 1
make: *** [cmTC_0f4a9/fast] Error 2

Source file was:

#include <omp.h>
int main() {
#ifdef _OPENMP
return 0;
#else
breaks_on_purpose
#endif
}

Performing C SOURCE FILE Test OpenMP_FLAG_DETECTED failed with the following output:
Change Dir: /Users/sadekrs1/work/virga/training/thundersvm/build/CMakeFiles/CMakeTmp

Run Build Command:"/usr/bin/make" "cmTC_1cdb0/fast"
/Applications/Xcode.app/Contents/Developer/usr/bin/make -f CMakeFiles/cmTC_1cdb0.dir/build.make CMakeFiles/cmTC_1cdb0.dir/build
Building C object CMakeFiles/cmTC_1cdb0.dir/src.c.o
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/cc -DOpenMP_FLAG_DETECTED -qsmp -o CMakeFiles/cmTC_1cdb0.dir/src.c.o -c /Users/sadekrs1/work/virga/training/thundersvm/build/CMakeFiles/CMakeTmp/src.c
clang: error: unknown argument: '-qsmp'
make[1]: *** [CMakeFiles/cmTC_1cdb0.dir/src.c.o] Error 1
make: *** [cmTC_1cdb0/fast] Error 2

Source file was:

#include <omp.h>
int main() {
#ifdef _OPENMP
return 0;
#else
breaks_on_purpose
#endif
}

Performing C SOURCE FILE Test OpenMP_FLAG_DETECTED failed with the following output:
Change Dir: /Users/sadekrs1/work/virga/training/thundersvm/build/CMakeFiles/CMakeTmp

Run Build Command:"/usr/bin/make" "cmTC_973e0/fast"
/Applications/Xcode.app/Contents/Developer/usr/bin/make -f CMakeFiles/cmTC_973e0.dir/build.make CMakeFiles/cmTC_973e0.dir/build
Building C object CMakeFiles/cmTC_973e0.dir/src.c.o
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/cc -DOpenMP_FLAG_DETECTED -mp -o CMakeFiles/cmTC_973e0.dir/src.c.o -c /Users/sadekrs1/work/virga/training/thundersvm/build/CMakeFiles/CMakeTmp/src.c
clang: error: unknown argument: '-mp'
make[1]: *** [CMakeFiles/cmTC_973e0.dir/src.c.o] Error 1
make: *** [cmTC_973e0/fast] Error 2

Source file was:

#include <omp.h>
int main() {
#ifdef _OPENMP
return 0;
#else
breaks_on_purpose
#endif
}

Performing C++ SOURCE FILE Test OpenMP_FLAG_DETECTED failed with the following output:
Change Dir: /Users/sadekrs1/work/virga/training/thundersvm/build/CMakeFiles/CMakeTmp

Run Build Command:"/usr/bin/make" "cmTC_a9fef/fast"
/Applications/Xcode.app/Contents/Developer/usr/bin/make -f CMakeFiles/cmTC_a9fef.dir/build.make CMakeFiles/cmTC_a9fef.dir/build
Building CXX object CMakeFiles/cmTC_a9fef.dir/src.cxx.o
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/c++ -DOpenMP_FLAG_DETECTED -fopenmp=libomp -o CMakeFiles/cmTC_a9fef.dir/src.cxx.o -c /Users/sadekrs1/work/virga/training/thundersvm/build/CMakeFiles/CMakeTmp/src.cxx
clang: error: unsupported argument 'libomp' to option 'fopenmp='
make[1]: *** [CMakeFiles/cmTC_a9fef.dir/src.cxx.o] Error 1
make: *** [cmTC_a9fef/fast] Error 2

Source file was:

#include <omp.h>
int main() {
#ifdef _OPENMP
return 0;
#else
breaks_on_purpose
#endif
}

Performing C++ SOURCE FILE Test OpenMP_FLAG_DETECTED failed with the following output:
Change Dir: /Users/sadekrs1/work/virga/training/thundersvm/build/CMakeFiles/CMakeTmp

Run Build Command:"/usr/bin/make" "cmTC_8ca43/fast"
/Applications/Xcode.app/Contents/Developer/usr/bin/make -f CMakeFiles/cmTC_8ca43.dir/build.make CMakeFiles/cmTC_8ca43.dir/build
Building CXX object CMakeFiles/cmTC_8ca43.dir/src.cxx.o
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/c++ -DOpenMP_FLAG_DETECTED -o CMakeFiles/cmTC_8ca43.dir/src.cxx.o -c /Users/sadekrs1/work/virga/training/thundersvm/build/CMakeFiles/CMakeTmp/src.cxx
/Users/sadekrs1/work/virga/training/thundersvm/build/CMakeFiles/CMakeTmp/src.cxx:2:10: fatal error: 'omp.h' file not found
#include <omp.h>
^~~~~~~
1 error generated.
make[1]: *** [CMakeFiles/cmTC_8ca43.dir/src.cxx.o] Error 1
make: *** [cmTC_8ca43/fast] Error 2

Source file was:

#include <omp.h>
int main() {
#ifdef _OPENMP
return 0;
#else
breaks_on_purpose
#endif
}

Performing C++ SOURCE FILE Test OpenMP_FLAG_DETECTED failed with the following output:
Change Dir: /Users/sadekrs1/work/virga/training/thundersvm/build/CMakeFiles/CMakeTmp

Run Build Command:"/usr/bin/make" "cmTC_4b958/fast"
/Applications/Xcode.app/Contents/Developer/usr/bin/make -f CMakeFiles/cmTC_4b958.dir/build.make CMakeFiles/cmTC_4b958.dir/build
Building CXX object CMakeFiles/cmTC_4b958.dir/src.cxx.o
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/c++ -DOpenMP_FLAG_DETECTED -fopenmp -o CMakeFiles/cmTC_4b958.dir/src.cxx.o -c /Users/sadekrs1/work/virga/training/thundersvm/build/CMakeFiles/CMakeTmp/src.cxx
clang: error: unsupported option '-fopenmp'
make[1]: *** [CMakeFiles/cmTC_4b958.dir/src.cxx.o] Error 1
make: *** [cmTC_4b958/fast] Error 2

Source file was:

#include <omp.h>
int main() {
#ifdef _OPENMP
return 0;
#else
breaks_on_purpose
#endif
}

Performing C++ SOURCE FILE Test OpenMP_FLAG_DETECTED failed with the following output:
Change Dir: /Users/sadekrs1/work/virga/training/thundersvm/build/CMakeFiles/CMakeTmp

Run Build Command:"/usr/bin/make" "cmTC_f1381/fast"
/Applications/Xcode.app/Contents/Developer/usr/bin/make -f CMakeFiles/cmTC_f1381.dir/build.make CMakeFiles/cmTC_f1381.dir/build
Building CXX object CMakeFiles/cmTC_f1381.dir/src.cxx.o
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/c++ -DOpenMP_FLAG_DETECTED /openmp -o CMakeFiles/cmTC_f1381.dir/src.cxx.o -c /Users/sadekrs1/work/virga/training/thundersvm/build/CMakeFiles/CMakeTmp/src.cxx
clang: error: no such file or directory: '/openmp'
make[1]: *** [CMakeFiles/cmTC_f1381.dir/src.cxx.o] Error 1
make: *** [cmTC_f1381/fast] Error 2

Source file was:

#include <omp.h>
int main() {
#ifdef _OPENMP
return 0;
#else
breaks_on_purpose
#endif
}

Performing C++ SOURCE FILE Test OpenMP_FLAG_DETECTED failed with the following output:
Change Dir: /Users/sadekrs1/work/virga/training/thundersvm/build/CMakeFiles/CMakeTmp

Run Build Command:"/usr/bin/make" "cmTC_f1059/fast"
/Applications/Xcode.app/Contents/Developer/usr/bin/make -f CMakeFiles/cmTC_f1059.dir/build.make CMakeFiles/cmTC_f1059.dir/build
Building CXX object CMakeFiles/cmTC_f1059.dir/src.cxx.o
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/c++ -DOpenMP_FLAG_DETECTED -Qopenmp -o CMakeFiles/cmTC_f1059.dir/src.cxx.o -c /Users/sadekrs1/work/virga/training/thundersvm/build/CMakeFiles/CMakeTmp/src.cxx
clang: error: unknown argument: '-Qopenmp'
make[1]: *** [CMakeFiles/cmTC_f1059.dir/src.cxx.o] Error 1
make: *** [cmTC_f1059/fast] Error 2

Source file was:

#include <omp.h>
int main() {
#ifdef _OPENMP
return 0;
#else
breaks_on_purpose
#endif
}

Performing C++ SOURCE FILE Test OpenMP_FLAG_DETECTED failed with the following output:
Change Dir: /Users/sadekrs1/work/virga/training/thundersvm/build/CMakeFiles/CMakeTmp

Run Build Command:"/usr/bin/make" "cmTC_797d3/fast"
/Applications/Xcode.app/Contents/Developer/usr/bin/make -f CMakeFiles/cmTC_797d3.dir/build.make CMakeFiles/cmTC_797d3.dir/build
Building CXX object CMakeFiles/cmTC_797d3.dir/src.cxx.o
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/c++ -DOpenMP_FLAG_DETECTED -openmp -o CMakeFiles/cmTC_797d3.dir/src.cxx.o -c /Users/sadekrs1/work/virga/training/thundersvm/build/CMakeFiles/CMakeTmp/src.cxx
/Users/sadekrs1/work/virga/training/thundersvm/build/CMakeFiles/CMakeTmp/src.cxx:2:10: fatal error: 'omp.h' file not found
#include <omp.h>
^~~~~~~
1 error generated.
make[1]: *** [CMakeFiles/cmTC_797d3.dir/src.cxx.o] Error 1
make: *** [cmTC_797d3/fast] Error 2

Source file was:

#include <omp.h>
int main() {
#ifdef _OPENMP
return 0;
#else
breaks_on_purpose
#endif
}

Performing C++ SOURCE FILE Test OpenMP_FLAG_DETECTED failed with the following output:
Change Dir: /Users/sadekrs1/work/virga/training/thundersvm/build/CMakeFiles/CMakeTmp

Run Build Command:"/usr/bin/make" "cmTC_eeec0/fast"
/Applications/Xcode.app/Contents/Developer/usr/bin/make -f CMakeFiles/cmTC_eeec0.dir/build.make CMakeFiles/cmTC_eeec0.dir/build
Building CXX object CMakeFiles/cmTC_eeec0.dir/src.cxx.o
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/c++ -DOpenMP_FLAG_DETECTED -xopenmp -o CMakeFiles/cmTC_eeec0.dir/src.cxx.o -c /Users/sadekrs1/work/virga/training/thundersvm/build/CMakeFiles/CMakeTmp/src.cxx
clang: error: language not recognized: 'openmp'
clang: warning: /Users/sadekrs1/work/virga/training/thundersvm/build/CMakeFiles/CMakeTmp/src.cxx: 'linker' input unused [-Wunused-command-line-argument]
make[1]: *** [CMakeFiles/cmTC_eeec0.dir/src.cxx.o] Error 1
make: *** [cmTC_eeec0/fast] Error 2

Source file was:

#include <omp.h>
int main() {
#ifdef _OPENMP
return 0;
#else
breaks_on_purpose
#endif
}

Performing C++ SOURCE FILE Test OpenMP_FLAG_DETECTED failed with the following output:
Change Dir: /Users/sadekrs1/work/virga/training/thundersvm/build/CMakeFiles/CMakeTmp

Run Build Command:"/usr/bin/make" "cmTC_1b278/fast"
/Applications/Xcode.app/Contents/Developer/usr/bin/make -f CMakeFiles/cmTC_1b278.dir/build.make CMakeFiles/cmTC_1b278.dir/build
Building CXX object CMakeFiles/cmTC_1b278.dir/src.cxx.o
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/c++ -DOpenMP_FLAG_DETECTED +Oopenmp -o CMakeFiles/cmTC_1b278.dir/src.cxx.o -c /Users/sadekrs1/work/virga/training/thundersvm/build/CMakeFiles/CMakeTmp/src.cxx
clang: error: no such file or directory: '+Oopenmp'
make[1]: *** [CMakeFiles/cmTC_1b278.dir/src.cxx.o] Error 1
make: *** [cmTC_1b278/fast] Error 2

Source file was:

#include <omp.h>
int main() {
#ifdef _OPENMP
return 0;
#else
breaks_on_purpose
#endif
}

Performing C++ SOURCE FILE Test OpenMP_FLAG_DETECTED failed with the following output:
Change Dir: /Users/sadekrs1/work/virga/training/thundersvm/build/CMakeFiles/CMakeTmp

Run Build Command:"/usr/bin/make" "cmTC_e6b58/fast"
/Applications/Xcode.app/Contents/Developer/usr/bin/make -f CMakeFiles/cmTC_e6b58.dir/build.make CMakeFiles/cmTC_e6b58.dir/build
Building CXX object CMakeFiles/cmTC_e6b58.dir/src.cxx.o
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/c++ -DOpenMP_FLAG_DETECTED -qsmp -o CMakeFiles/cmTC_e6b58.dir/src.cxx.o -c /Users/sadekrs1/work/virga/training/thundersvm/build/CMakeFiles/CMakeTmp/src.cxx
clang: error: unknown argument: '-qsmp'
make[1]: *** [CMakeFiles/cmTC_e6b58.dir/src.cxx.o] Error 1
make: *** [cmTC_e6b58/fast] Error 2

Source file was:

#include <omp.h>
int main() {
#ifdef _OPENMP
return 0;
#else
breaks_on_purpose
#endif
}

Performing C++ SOURCE FILE Test OpenMP_FLAG_DETECTED failed with the following output:
Change Dir: /Users/sadekrs1/work/virga/training/thundersvm/build/CMakeFiles/CMakeTmp

Run Build Command:"/usr/bin/make" "cmTC_f04ef/fast"
/Applications/Xcode.app/Contents/Developer/usr/bin/make -f CMakeFiles/cmTC_f04ef.dir/build.make CMakeFiles/cmTC_f04ef.dir/build
Building CXX object CMakeFiles/cmTC_f04ef.dir/src.cxx.o
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/c++ -DOpenMP_FLAG_DETECTED -mp -o CMakeFiles/cmTC_f04ef.dir/src.cxx.o -c /Users/sadekrs1/work/virga/training/thundersvm/build/CMakeFiles/CMakeTmp/src.cxx
clang: error: unknown argument: '-mp'
make[1]: *** [CMakeFiles/cmTC_f04ef.dir/src.cxx.o] Error 1
make: *** [cmTC_f04ef/fast] Error 2

Source file was:

#include <omp.h>
int main() {
#ifdef _OPENMP
return 0;
#else
breaks_on_purpose
#endif
}

One-Class SVM showed out of host memory error

Hi,

I used the CPU-only version to train a one-class svm with linear kernel using a very large, high-dimensional dataset (around 170GB with 3000 dimensions).

I ran my experiment on a 488GB ram, 64 cores AWS machine, with the following command:

./thundersvm-train -s 2 -t 0 -n 0.5 largedataset.libsvm largedataset.model

After half an hour, it showed

FATAL [default] out of host memory

How to make it work? Can limiting the number of cores solve the problem?

Taking too long to train a relatively small model

I'm trying to train a 156d model with 36k examples. Sklearn does it in 180s. However, thundersvm is already running it for 90 hours.

Here is my system:

GTX 780, 4GB
log: logfile

nvcc --version
Built on Tue_Jan_10_13:22:03_CST_2017
Cuda compilation tools, release 8.0, V8.0.61

gcc --version
gcc (Ubuntu 4.9.3-13ubuntu2) 4.9.3

I'm not sure what to try next.

Thanks!

Compilation fails with gcc 5.x

Compilation with gcc 5.4.0 gives the following:

usr/lib/gcc/x86_64-linux-gnu/5/include/mwaitxintrin.h(36): error: identifier "__builtin_ia32_monitorx" is undefined

/usr/lib/gcc/x86_64-linux-gnu/5/include/mwaitxintrin.h(42): error: identifier "__builtin_ia32_mwaitx" is undefined

/usr/lib/gcc/x86_64-linux-gnu/5/include/mwaitxintrin.h(36): error: identifier "__builtin_ia32_monitorx" is undefined

/usr/lib/gcc/x86_64-linux-gnu/5/include/mwaitxintrin.h(42): error: identifier "__builtin_ia32_mwaitx" is undefined

Adding the following to CMakeLists.txt fixes the problem:

SET ( CMAKE_CXX_FLAGS "-D_MWAITXINTRIN_H_INCLUDED -D_FORCE_INLINES" CACHE STRING "compile flags" FORCE)

Crash on Windows + Matlab + Visual Studio

Environment:

  • Windows 10
  • Matlab R2017a
  • Visual Studio 2015
  • nVidia GeForce GTX 1050 Ti with newest driver installed
  • CUDA 9.1

I compiled thundersvm on Windows using steps described in the online doc, i.e., cmake and then compile in VS2015. The output directory of executibles is "......\thundersvm-master\build\bin\Release" and the shared library is called "thundersvm.dll" on Windows. I am using the MNIST data set which is uncompressed to E:\mnist.scale. The output executible "thundersvm-train.exe" works fine on command line (accuracy is about 94%):
thundersvm-train E:\mnist.scale E:\mnist.model
so I think the compiling step should be correct. But it crashes in Matlab. The Matlab testing code is:

n = ["-c", "10", "-g", "0.125", "E:\mnist.scale", "E:\mnist.model"];
m = cellstr(n);
svm_train_matlab(m)

Since the directory and filenames are different on Windows, I changed svm_train_matlab.m to:

function svm_train_matlab(a)
    if not(libisloaded('thundersvm'))
        loadlibrary('......\thundersvm-master\build\bin\Release\thundersvm.dll', ...
            '......\thundersvm-master\include\thundersvm\svm_matlab_interface.h')
    end
	str = {'thundersvm-train'};
	str2 = [str a]
	calllib('thundersvm', 'thundersvm_train_matlab', length(str2), str2)
end

In all above codes, ...... in the path is the leading directory before thundersvm's root which is omitted. When I debugged my Matlab code, everything works fine until the last line calllib(...). Once I step over or into it, Matlab crashes, saying "MATLAB R2017a has stopped working. A problem caused the program to stop working correctly. Windows will close the program and notify you if a solution is available." Since I can run the training code correctly on Windows command line, I guess the problem might be parameter values or parameter passing for calllib. I am not very familiar with this part of Matlab code, so could you please help me with this crash problem? Or can you tell me how to put a printf-like code in the interface code so that I can check the parameters passed myself (I know it's in thundersvm_train_matlab function of src\svm_matlab_interface.cpp)? Please let me know if you need more info. Thank you for your help.

Sklearn Interface

Are there any plans for making an sklearn interface for thunder svm?

Build error in CUDA 9.1 and Visual C++ 2017

I get the following errors when building Microsoft Visual Studio Solution

Severity	Code	Description	Project	File	Line	Suppression State
Error	MSB6006	"cmd.exe" exited with code 1.	thundersvm	C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\Common7\IDE\VC\VCTargets\Microsoft.CppCommon.targets	171	
Severity	Code	Description	Project	File	Line	Suppression State
Error	MSB6006	"cmd.exe" exited with code 1.	thundersvm-predict	C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\Common7\IDE\VC\VCTargets\Microsoft.CppCommon.targets	171	

Severity	Code	Description	Project	File	Line	Suppression State
Error	MSB6006	"cmd.exe" exited with code 1.	thundersvm-train	C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\Common7\IDE\VC\VCTargets\Microsoft.CppCommon.targets	171	

Build system is Windows 10 Home 1709, MS Visual Studio 2017 Community, CUDA 9.1 Development Environment.
CMAKE is bundled from Visual Studio install:

cmake --version
cmake version 3.9.2-MSVC_2

CMake suite maintained and supported by Kitware (kitware.com/cmake).

CMAKE was invoked as:

> cd thundersvm\build
> cmake -G "Visual Studio 15 2017 Win64" ..
-- The C compiler identification is MSVC 19.12.25835.0
-- The CXX compiler identification is MSVC 19.12.25835.0
......
-- Build files have been written to: C:/thundersvm/build

Complete build message as follows:

1>------ Build started: Project: ZERO_CHECK, Configuration: Debug x64 ------
1>Checking Build System
1>CMake does not need to re-run because C:/thundersvm/build/CMakeFiles/generate.stamp is up-to-date.
1>CMake does not need to re-run because C:/thundersvm/build/src/thundersvm/CMakeFiles/generate.stamp is up-to-date.
1>CMake does not need to re-run because C:/thundersvm/build/src/test/CMakeFiles/generate.stamp is up-to-date.
.......
5>
5>C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\Common7\IDE\VC\VCTargets\Microsoft.CppCommon.targets(171,5): error MSB6006: "cmd.exe" exited with code 1.
5>Done building project "thundersvm-train.vcxproj" -- FAILED.
2>Your branch is up-to-date with 'origin/master'.
2>Already on 'master'
2>Performing update step for 'googletest'
2>Current branch master is up to date.
2>No patch step for 'googletest'
2>Performing configure step for 'googletest'
2>-- The C compiler identification is MSVC 19.12.25835.0
2>-- The CXX compiler identification is MSVC 19.12.25835.0
......
2>
2>Build succeeded.
2>    0 Warning(s)
2>    0 Error(s)
2>
2>Time Elapsed 00:00:11.22
2>No install step for 'googletest'
2>Completed 'googletest'
6>------ Build started: Project: ALL_BUILD, Configuration: Debug x64 ------
6>Building Custom Rule C:/thundersvm/CMakeLists.txt
6>CMake does not need to re-run because C:/thundersvm/build/CMakeFiles/generate.stamp is up-to-date.
========== Build: 3 succeeded, 3 failed, 0 up-to-date, 0 skipped ==========

thundersvm-predict crashes with "out of host memory" error due to hard-coded value

thundersvm-predict crashes when #instances or #features is too large.

2018-04-24 13:10:01,033 INFO [default] loading dataset from file "../dataset/test_features_exballroom-ds_linspace-fs_40-nfeats_1-f_libsvm.txt"
2018-04-24 13:10:02,081 INFO [default] #instances = 16720, #features = 156
2018-04-24 13:10:02,920 FATAL [default] out of host memory
2018-04-24 13:10:02,920 WARNING [default] Aborting application. Reason: Fatal log at [/home/juliano/thundersvm/src/thundersvm/thundersvm-predict.cpp:68]

This is due to the hard-coded value of 10000 batch_size parameter in a call to model->predict in thundersvm-predict.cpp:

vector<float_type> predict_y;
predict_y = model->predict(predict_dataset.instances(), 10000);

Changing 10000 to 1000 fixes the crash on my GTX780 with 3GB. Maybe letting this as a command-line parameter will help.

In a related problem, the prediction after the training takes a VERY LONG TIME (when executing thundersvm-train + SVC + large training set). When looking at the code for prediction in thunder-svm-train.cpp:

        vector<float_type> predict_y;
        if (parser.do_cross_validation) {
            predict_y = model->cross_validation(train_dataset, parser.param_cmd, parser.nr_fold);
        } else {
            model->train(train_dataset, parser.param_cmd);
            LOG(INFO) << "training finished";
            model->save_to_file(parser.model_file_name);
            LOG(INFO) << "evaluating training score";
            predict_y = model->predict(train_dataset.instances(), 100);
        }

batch_size for predict is only 100.. I understand why the default is lower here, since the training set is usually much larger than the validation/test set. However, i believe that leaving this as a command-line parameter allows the user to tweak it according to the available GPU memory.

Thanks!

thundersvm_predict with nonexistent model file core dumps

If I run prediction with a model file which does not exist, the program core dumps:

kira@blah:~/Software/thundersvm/build$ ./bin/thundersvm-predict /tmp/test_kernel.out doesnotexist.model predictions.txt
2018-05-14 09:45:08,742 FATAL [default] Check failed: [feature == "svm_type"]
2018-05-14 09:45:08,742 WARNING [default] Aborting application. Reason: Fatal log at [/Software/thundersvm/src/thundersvm/thundersvm-predict.cpp:26]
Aborted (core dumped)

(I don't intend to run with a non-existent model file, but if it happens by accident it is easier to recover from it if the program exits gracefully rather than core dumping.)

Disable output to terminal

2018-01-27 02:11:38,063 INFO [default] training start
.......
......
.......
2018-01-27 02:11:55,070 INFO [default] rho = 0.229
2018-01-27 02:11:55,070 INFO [default] #sv = 9588
2018-01-27 02:11:55,090 INFO [default] training start
.......
2018-01-27 02:11:55,482 INFO [default] rho = 0.359464
2018-01-27 02:11:55,482 INFO [default] #sv = 8859
2018-01-27 02:11:55,523 INFO [default] #total unique sv = 45625
2018-01-27 02:12:08,703 INFO [default] Accuracy = 1

Thundersvm display a lot of thing on terminal. How to quit that? Just I want to display accuracy.
Like MATLAB uses -q to quit extra display.

thundersvmScikit.SVC `verbose=False` doesn't seem to work

Running

clf   = SVC(kernel=2, n_cores=30, max_iter=20, verbose=False).fit(X, y)

logs

2018-05-02 22:38:14,898 INFO [default] #instances = 71829, #features = 2
2018-05-02 22:38:14,905 INFO [default] #classes = 2
2018-05-02 22:38:14,925 INFO [default] working set size = 1024
2018-05-02 22:38:14,929 INFO [default] training start
2018-05-02 22:38:14,938 INFO [default] global iter = 0, total local iter = 74, diff = 2

Is there some way to turn off the logging?

Thanks
~ Ben

CUDA Error, too many resources requested for launch

I think there are something needs to be fixed on working set size. I use a Window 10 machine with a NVIDIA Quadro 4000 and CUDA 8.0.

When I tried to train a set with more features, I got following errors. The data set "a9a"used here is from LibSVM site:https://www.csie.ntu.edu.tw/~cjlin/libsvmtools/datasets/binary.html

PS O:\thundersvm\thundersvm\build\bin\Release> ./thundersvm-train -g 0.125 -c 10 a9a.txt svm.model
2018-05-09 14:06:59,499 INFO [default] loading dataset from file "a9a.txt"
2018-05-09 14:07:00,168 INFO [default] #instances = 32561, #features = 123
2018-05-09 14:07:00,171 INFO [default] training C-SVC
2018-05-09 14:07:00,174 INFO [default] C = 10
2018-05-09 14:07:00,176 INFO [default] gamma = 0.125
2018-05-09 14:07:00,228 INFO [default] #classes = 2
2018-05-09 14:07:00,347 INFO [default] working set size = 1024
2018-05-09 14:07:00,374 INFO [default] training start
2018-05-09 14:07:00,773 FATAL [default] Check failed: [error == cudaSuccess] too many resources requested for launch
2018-05-09 14:07:00,778 WARNING [default] Aborting application. Reason: Fatal log at [O:/thundersvm/thundersvm/src/thundersvm/kernel/smo_kernel.cu:309]

Kernel dies when using weighted C-SVC

I am trying to train an SVM model from python with the following parameters -s 0 -t 0 -c 1 -b 1 -u 0 -w1 10 -w-1 1 and my Jupyter kernel dies. If I train with -s 0 -t 0 -c 1 -b 1 -u 0 it trains fine. I am importing the functions from svm.py and running them inside a jupyter notebook on a Python 3.5.2 conda environment on a Ubuntu Linux VM.

High CPU usage

I noticed that while thundersvm is running, it usually keeps a cpu core at 100%. Why is this?

Is there any busy waiting for the GPU? Calculations that cannot be done directly in the GPU? Data transfer?

Thanks!

Cross Validation issue

Hi,

I am trying to do cross-validation in matlab in order to find the right parameters. It finishes doing CV successfully, but I don't get any score representing how good the parameters are.

My command is as follows,
svm_train_matlab({'-v', '5', '-c', num2str(2^log2c), '-g', num2str(2^log2g), 'feat.train', 'cv_new'})

And while actual training, is there a way to store the model in matlab structure format like we do with libsvm.

Thanks for this framework. And thanks for your time.

Regards,
Aditya

Core dump due to "out of host memory"

Hi,

I just ran ./thundersvm-train /tmp2/b03902086/data/news20.binary on a workstation machine, and resulted in the following:

2017-12-31 02:14:28,273 INFO [default] training start
.
2017-12-31 02:14:51,947 INFO [default] rho = -0
2017-12-31 02:14:51,947 INFO [default] #sv = 1024
2017-12-31 02:14:52,008 INFO [default] #total unique sv = 1024
2017-12-31 02:15:06,078 FATAL [default] out of host memory
2017-12-31 02:15:06,079 WARNING [default] Aborting application. Reason: Fatal log at [/home/student/03/b03902086/thundersvm/src/thundersvm/thundersvm-train.cpp:90]
Aborted (core dumped)

The machine has 70G memory, and the dataset news20 is just 134M large.
Is there anything I miss?
Thanks in advance!

Running run.sh fails with segfault

Hi, I tested run.sh with 2 trainingssets: a9a and one of my own. Both fail with this error message and a segfault:

terminate called after throwing an instance of 'thrust::system::system_error'
what(): after cub_::DeviceRadixSort::SortPairs(0): invalid device function

I am using CUDA 8 and g++ 6.3.1.

thundersvmScikit Windows: Debug Assertion Failed

I have a large(ish) dataset I'd like to run through ThunderSVM with 100k samples at the max described by 4096 features. I converted some of my training and evaluation data over to the format for LIBSVM, but I get an error when running my data through the example code.

from thundersvmScikit import *
from sklearn.datasets import *

x,y = load_svmlight_file("../dataset/train.txt")
clf = SVC(verbose=True, gamma=0.5, cost=100)
clf.fit(x,y)

x2,y2=load_svmlight_file("../dataset/test.txt")
y_predict=clf.predict(x2)
score=clf.score(x2,y2)

print "test score is ", score

The output I am seeing is:

2018-05-13 19:44:21,657 INFO [default] #instances = 10208, #features = 4096
2018-05-13 19:44:23,824 INFO [default] #classes = 2
2018-05-13 19:45:48,808 INFO [default] working set size = 1024
2018-05-13 19:45:48,816 INFO [default] training start
2018-05-13 19:45:49,366 INFO [default] global iter = 0, total local iter = 512, diff = 2
2018-05-13 19:46:01,138 INFO [default] global iter = 93, total local iter = 33607, diff = 0.000996124
2018-05-13 19:46:01,144 INFO [default] rho = -0.305637
2018-05-13 19:46:01,146 INFO [default] #sv = 10179
2018-05-13 19:46:05,729 INFO [default] #total unique sv = 10179
2018-05-13 19:46:05,840 INFO [default] training finished
2018-05-13 19:47:10,357 INFO [default] #instances = 2904, #features = 4096

Then I seem to get this error:

image

Oddly I seem to be able to run the default code and data through so I am note sure why everything seems to break when I run my data through it.

Segmentation fault(core dumped)? Could you give a example for how to use the source code?

I use the git clone the source code and under the gpu-svm directory make the code. Then I download the iris data from libsvm site, put it under the directory dataset/. Then according to the run.sh, use the command ./run.sh iris. Then it raise a error ./run.sh line 86 # segmentation fault (core dumped) I hope there is a tutorial for how to using the source code.

Python error when using Anaconda

#########################################################
Issues 1:
#########################################################
In [5]: clf.fit(x,y)
2018-03-13 22:49:53,831 INFO [default] #instances = 150, #features = 4
2018-03-13 22:49:53,979 INFO [default] training start
2018-03-13 22:49:54,135 INFO [default] global iter = 0, total local iter = 0
2018-03-13 22:49:54,136 INFO [default] global iter = 3, total local iter = 0
2018-03-13 22:49:54,136 INFO [default] rho = -0.062077
2018-03-13 22:49:54,136 INFO [default] #sv = 11
2018-03-13 22:49:54,138 INFO [default] training start
2018-03-13 22:49:54,139 INFO [default] global iter = 0, total local iter = 0
2018-03-13 22:49:54,140 INFO [default] global iter = 4, total local iter = 0
2018-03-13 22:49:54,140 INFO [default] rho = 0.0158995
2018-03-13 22:49:54,140 INFO [default] #sv = 8
2018-03-13 22:49:54,141 INFO [default] training start
2018-03-13 22:49:54,142 INFO [default] global iter = 0, total local iter = 0
2018-03-13 22:49:54,143 INFO [default] global iter = 4, total local iter = 0
2018-03-13 22:49:54,143 INFO [default] rho = 0.0521937
2018-03-13 22:49:54,143 INFO [default] #sv = 47
2018-03-13 22:49:54,144 INFO [default] #total unique sv = 59
2018-03-13 22:49:54,144 INFO [default] training finished
Segmentation fault (core dumped)
###################################################
When I use clf = SVC() and clf.fit(x,y), it crashed after training.
Ubuntu16.04, cuda8.0.
IF I use ./bin/thunder_svmtrain its ok.
###########################################################

###########################################################
Issues 2:
###########################################################
Just found from svm import * output errors (when I update today after it is fixed some bugs of windows
In [4]: from svm import *

NameError Traceback (most recent call last)
in ()
----> 1 from svm import *

~/Documents/Python/svmsets/thundersvm/python/svm.py in ()
8
9 dirname = path.dirname(path.abspath(file))
---> 10 if platform == "linux" or platform == "linux2":
11 lib_path = path.join(dirname, '../build/lib/libthundersvm.so')
12 elif platform == "win32":

NameError: name 'platform' is not defined
############################################################

#############################################################
Just wonder if you like to add clf.decision_function() method just as sklearn.svm.SVC does?
Thanks!
#############################################################

Policy "CMP0048" is not known to this version of CMake

I follow Working without GPUs
# in thundersvm root directory
git submodule init eigen && git submodule update
mkdir build && cd build && cmake -DUSE_CUDA=OFF -DUSE_EIGEN=ON .. && make -j

I got this

CMake Error at CMakeLists.txt:3 (cmake_policy):
  Policy "CMP0048" is not known to this version of CMake.
CMake Error: Error required internal CMake variable not set, cmake may be not be built correctly.
Missing variable is:
CMAKE_VERSION_COMPILER_ENV_VAR
CMake Error: Error required internal CMake variable not set, cmake may be not be built correctly.
Missing variable is:
CMAKE_VERSION_COMPILER
...

So I had a quick google and found that

The project() command manages VERSION variables.

CMake version 3.0 introduced the VERSION option of the project() command to specify a project version as well as the name. ...

So maybe it's not working under cmake version 2.8 which is my case.

my environment

cmake version 2.8.12.2
gcc version 4.8.4

Using weighted C-SVC

I am trying to train an SVM model from python with the following parameters -s 0 -t 0 -c 1 -b 1 -u 0 -w1 100

I have tried different values for -w1 but the SVM fails to learn anything I am guessing because the classes are heavily imbalance and the weighting isn't being applied?

My train_y is a list that contains 1 and -1. I am importing the functions from svm.py and running them inside a jupyter notebook on a Python 3.5.2 conda environment on a Ubuntu Linux VM.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.