cjlin1 / libsvm

LIBSVM -- A Library for Support Vector Machines
https://www.csie.ntu.edu.tw/~cjlin/libsvm/
BSD 3-Clause "New" or "Revised" License
4.54k stars 1.64k forks source link

SVM with OpenMP is not faster at all #134

Open log69 opened 5 years ago

log69 commented 5 years ago

Hi, I compiled libsvm with OpenMP support based on FAQ and it compiled fine, "ldd svm-train" shows that libgomp has been linked to it and it runs fine on data as well. However the training is not faster at all. Providing OMP_NUM_THREADS=4 or with other number does not help it. Could you kindly help me track down what the issue is? Could it be the training dataset? I generated it with a function to use it for nu-SVR. Prediction works nicely, but training does not get any faster, it doesn't matter how many samples I have. The number of features is 5. Training takes around 45 seconds on my i5 CPU with and without OpenMP. Thanks.

log69 commented 5 years ago

Additional info: It is using 4 CPU cores though when compiling it with OpenMP, however there is no decrease in training time.