Why are training results different between CPU and GPU?
Hi, I managed to run my LSTM-style network and noticed that when run on CPU (compiled with MKL) the results (TrainLossPerSample) tend to be lower (quite a bit, like 20%) than running on GPU. Why?
Regards, Slawek
I'm seeing the same thing. I believe there are some bugs in the GPU implementation that are being sorted out (unfortunately I don't know more details).. At least it's known and should be addressed soon
This is likely because of the random initialization since GPU and CPU random algorithms are different. You can force NDL to initialize models always on CPU.
Yes, this is the first thing to check. To do so, wherever you define your LearnableParameters, please add an optional parameter
initOnCPUOnly=true
In normal configurations, randomization should not make such a huge difference. However, if you only run tiny debug setups for a few minibatches for purposes of debugging or regression testing, it can cause huge variation.
Frank has the correct answer, this should take care of most differences.
We have several work items to minimize differences between the different build flavors (gpu/cpu as well as Linux/windows). We have improved quiet a bit here, more to come, but there are more functional and reliability/ test requirements we are also trying to solve ...
no eta, but it will come ;)
Wolfgang