why use gpu training the performance is worse than cpu

2 Ansichten (letzte 30 Tage)
Yunyu Hu
Yunyu Hu am 1 Mär. 2020
Beantwortet: Sai Bhargav Avula am 26 Mär. 2020
Hi,
I tried the following options for training a fitnet:
trainedNet=train(net,X_',Y'); %59 Iterations,Performance 115, 100s
trainedNet=train(net,X_',Y','useParallel','yes');%59 Iterations ,Performance:115,158s
trainedNet=train(net,gpuArray(X_'),gpuArray(Y')); %628 Iterations,Performance:649, 14s
trainedNet=train(net,X_',Y','useGPU','yes');%628 Iterations,Performance:679, 12.6s
trainedNet=train(net,X_',Y','useGPU','only');% 628 Iterations,Performance:679, 12.6s
I fixed the random seed.
I want to know why using GPU it took much more iterations but achieve worse performance?
Thanks
  1 Kommentar
Yunyu Hu
Yunyu Hu am 2 Mär. 2020
Bearbeitet: Yunyu Hu am 2 Mär. 2020
I found the major reason, because I used the trainfcn "trainlm", which is not supported by GPU and when use GPU matlab will change it automatically to "trainscg".
But then it comes the next question: when I use " trainscg" for bothe CPU and GPU, the Performances are different:
trainedNet=train(net,X_',Y','useGPU','only‘) --> 5000Itr,Performance 192, 232s
trainedNet=train(net,X_',Y‘); --> 5000Itr, Performance 154, 186s
What is the reason for this?

Melden Sie sich an, um zu kommentieren.

Akzeptierte Antwort

Sai Bhargav Avula
Sai Bhargav Avula am 26 Mär. 2020
Hi,
First I would like to mention that GPU's are faster for large matrices.
I would also like to suggest two answers that explains GPU performance
Hope this helps!

Weitere Antworten (0)

Kategorien

Mehr zu Deep Learning Toolbox finden Sie in Help Center und File Exchange

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by