Caffe performance depends on platform CentOS/RHEL and driver version
Hi,
I tried to use caffe to train an imagenet model. But the training speed is 2~3 times slower than the benchmark. I am using Cent OS 6.5, Tesla K40m. I have faced the same problem with a Black TITAN on Ubuntu 12.04, which can be addressed by changing the Nvidia driver.
The speed for training MNIST and CIFAR10 demo is normal. Is there anyone who are able to get the benchmark speed for imagenet with CentOS 6.5 and K40?
Any help will be appreciated. Dennis
Please follow the performance and hardware configuration advice: http://caffe.berkeleyvision.org/performance_hardware.html
@shelhamer Thanks for the quick reply. The benchmark speed with K40 and ECC off is: ECC off, default speed: training 31 secs / 20 iterations, test 118 secs / validation set What I got is 160secs / 20 iterations, test 124 secs / validation set using 331.67. and 70 secs / 20 iterations, test 120 secs / validation set using 331.49.
For the test part, it is comparable to the benchmark speed. I guess the problem is in the backward part. While it is testing, the GPU Util is always above 90% but when training, the GPU Util varies from 10% to 100%.
I have also tried to use 875 CLOCK. It improves but still quite slower than the benchmark.
Plus, I think this is similar to #388 I have tried 331.20. It works for Ubuntu12.04 but not for CentOS 6.5. By far, I have tried 331.20, 331.49, 331.67, 331.75, 334.21. None of them works.
@shelhamer Can you tell me the configuration(OS, cuda toolkit version, driver version) you use for the benchmark of K40? Thanks.
Maybe benchmark the net speed to see if there are some other bottlenecks, such as reading data from disk? GPU util being low indicates that other parts (CPU code) are not feeding things fast enough to the gpu.
Yangqing
On Sun, Jun 8, 2014 at 9:12 PM, dennis910130 [email protected] wrote:
@shelhamer https://github.com/shelhamer Thanks for the quick reply. The benchmark speed with K40 and ECC off is: ECC off, default speed: training 31 secs / 20 iterations, test 118 secs / validation set What I got is 160secs / 20 iterations, test 124 secs / validation set using 331.67. and 70 secs / 20 iterations, test 120 secs / validation set using 331.49.
For the test part, it is comparable to the benchmark speed. I guess the problem is in the backward part. While it is testing, the GPU Util is always above 90% but when training, the GPU Util varies from 10% to 100%.
I have also tried to use 875 CLOCK. It improves but still quite slower than the benchmark.
Reply to this email directly or view it on GitHub https://github.com/BVLC/caffe/issues/483#issuecomment-45459881.
Check the number of files opened, leveldb tend to open to many and could be causing the conflicts. It seems that changing the driver makes a big difference.
On Monday, June 9, 2014, Yangqing Jia [email protected] wrote:
Maybe benchmark the net speed to see if there are some other bottlenecks, such as reading data from disk? GPU util being low indicates that other parts (CPU code) are not feeding things fast enough to the gpu.
Yangqing
On Sun, Jun 8, 2014 at 9:12 PM, dennis910130 <[email protected] javascript:_e(%7B%7D,'cvml','[email protected]');> wrote:
@shelhamer https://github.com/shelhamer Thanks for the quick reply. The benchmark speed with K40 and ECC off is: ECC off, default speed: training 31 secs / 20 iterations, test 118 secs / validation set What I got is 160secs / 20 iterations, test 124 secs / validation set using 331.67. and 70 secs / 20 iterations, test 120 secs / validation set using 331.49.
For the test part, it is comparable to the benchmark speed. I guess the problem is in the backward part. While it is testing, the GPU Util is always above 90% but when training, the GPU Util varies from 10% to 100%.
I have also tried to use 875 CLOCK. It improves but still quite slower than the benchmark.
Reply to this email directly or view it on GitHub https://github.com/BVLC/caffe/issues/483#issuecomment-45459881.
— Reply to this email directly or view it on GitHub https://github.com/BVLC/caffe/issues/483#issuecomment-45554301.
Sergio
Here are a few known good configurations:
- ubuntu 12.04, CUDA 5.5, driver 319.82, K40
- ubuntu 12.04, CUDA 5.5, driver 319.37 or driver 319.76, Titan
- ubuntu 14.04, CUDA 6.0, driver 331.62, GTX 770
- ubuntu 12.04, CUDA 5.0, driver 319.82, K20Xm (thanks @mkudelski )
On Sun, Jun 8, 2014 at 9:52 PM, dennis910130 [email protected] wrote:
@shelhamer https://github.com/shelhamer Can you tell me the configuration(OS, cuda toolkit version, driver version) you use for the benchmark of K40? Thanks.
— Reply to this email directly or view it on GitHub https://github.com/BVLC/caffe/issues/483#issuecomment-45461144.
I have the same problem. Caffe works well on Titan. But for Titan Black and K40c, it runs very slow. I am using RHEL 6.5, and don't know what drivers work for it.
I ran the net_speed_benchmark. The only bottleneck is the back-propagation of convolutional layer. It is very weird that the GPU usage is almost 0% for the back-propagation of convolutional layer. I use RHEL 6.5. I tried both cuda5.5 and 6.0. Neither works.
Hi all,
Thanks for all the suggestions. I think one thing I am pretty sure about is that Caffe only works on some certain configurations. Good configurations depend not only on the OS but also on the driver. For me, I tried all drivers that support K40 on CentOS but none works.
I just solved this problem by changing from CentOS to Ubuntu12.04 with the driver 319.82(thanks to the information shared by @shelhamer ). The speed is comparable to that listed on the website.
@YutingZhang My suggestion would be to change the OS and try the good configurations provided above if it is convenient. Before anyone figures out why this happens, it seems to be the only solution.
@shelhamer Should I close this issue?
Please close -- this let's us know it is resolved (or out of our power if there are OS difficulties) and it will still show up in search results for issues still.
Thanks for posting what worked for you.
Le mardi 17 juin 2014, dennis910130 [email protected] a écrit :
Hi all,
Thanks for all the suggestions. I think one thing I am pretty sure about is that Caffe only works on some certain configurations. Good configurations depend not only on the OS but also on the driver. For me, I tried all drivers that support K40 on CentOS but none works.
I just solved this problem by changing from CentOS to Ubuntu12.04 with the driver 319.82(thanks to the information shared by @shelhamer https://github.com/shelhamer ). The speed is comparable to that listed on the website.
@YutingZhang https://github.com/YutingZhang My suggestion would be to change the OS and try the good configurations provided above if it is convenient. Before anyone figures out why this happens, it seems to be the only solution.
@shelhamer https://github.com/shelhamer Should I close this issue?
— Reply to this email directly or view it on GitHub https://github.com/BVLC/caffe/issues/483#issuecomment-46278820.
I have the same problem when training imaganet useing caffe width CentOS release 6.3 (Final) and Cuda-6.0, K20. The speed is slow than the website. It's about 65 secs / 20 iterations (5,120 images). How should solve this problem?
@dennis910130 Thanks for your advice. @Dcocoa It seems currently no solution for CentOS/RHEL 6.x .
Another good configuration:
- ubuntu 12.04, CUDA 5.0, driver 319.82, K20Xm
It seems that ubuntu + driver 319.82 is the correct choice for K20/K40...
A bad configuration: Ubuntu 14.04, CUDA 6.0.37, driver 331.75, Titan GPU.
The ImageNet test / validation time was 100 s, the same as previously reported, but the training time for 20 iterations was 3.4x slower at 90 s compared to 26.26 s!
@shelhamer Same NG report for Ubuntu 14.04 + CUDA6.0 + GTX Titan. Actually we were trying several configurations for Ubuntu 14.04 with GTX Titan card, however, no luck. If you figure this out, please notify me. Thank you.
Good configuration: Ubuntu 12.04, CUDA 5.5, driver 319.76, Titan GPU.
CUDA 6 with 331.* and 337.* series drivers stalled in the backward pass on convolution layers and gave horribly slow performance.
@niuzhiheng I downgraded to Ubuntu 12.04, CUDA 5.5 and 319 driver series. Only 319.* drivers seem capable of giving good Titan performance and the most recent CUDA library compatible with these drivers is 5.5. 14.04 does not seem to be an option with Titan for now, although 770s work on 14.04 just fine.