BVLC / caffe

Caffe: a fast open framework for deep learning.
http://caffe.berkeleyvision.org/
Other
34.13k stars 18.68k forks source link

the speed of forward, caffe with cudnn slower than without cudnn? #7017

Open BigPuns opened 3 years ago

BigPuns commented 3 years ago

test model: Alexnet, Vgg16, Resnet50, Restnet101, CUDA version: cuda-9.0, CUDNN version: cudnn7.6 Operating system: v100, 1080ti

use caffe time to test speed ./build/tools/caffe time --model alexnet.prototxt --weights alexnet.caffemodel --gpu 1

I use two modes: with cudnn and without cudnn;

when batch = 1: with cudnn is slower than without cudnn, for example,

resnet101: forward use time: with cudnn : 34ms without cudnn: 18ms

when batch = 10: with cudnn is quicker than with cudnn, for example

resnet101:

forward us time: with cudnn: 60ms without cudnn: 48ms

so my question is why batch=1, with cudnn is slower? how do cudnn for conv speed up?

BigPuns commented 3 years ago

v100

IMG_20210918_160135_edit_469795324265813

batch = 1

with cudnn IMG_20210918_154134

without cudnn

![Uploading IMG_20210918_154127.jpg…]()

batch = 10

with cudnn IMG_20210918_155138

without cudnn

IMG_20210918_155132