clab / dynet

DyNet: The Dynamic Neural Network Toolkit
Apache License 2.0
3.43k stars 703 forks source link

Feature Request: Add MKL-DNN to speed up dynet conv2d on CPU #1337

Open zjcerwin opened 6 years ago

zjcerwin commented 6 years ago

Dynet is a great deep learning framework. However, it's conv2d implementation is very slow on CPU, about 6 times slower than PyTorch on a 6700K-CPU machine. Recently Intel released the MKL-DNN library which can significantly improve Conv2d, Relu, BatchNorm etc performance on Intel CPU platform. For those of us who don`t have GPU, it will be a good News to have it in Dynet.

neubig commented 6 years ago

Thanks for the suggestion! Yeah, we should definitely try to do this (cc: @zhisbug )

zjcerwin commented 6 years ago

Glad to hear that :)

xunzhang commented 6 years ago

It's nice to have MKL-DNN integrated! Does DyNet still need to accelerate native CPU implementation of conv2d without MKL?

neubig commented 6 years ago

No. I think we can ask people to install MKL-DNN if they want good performance convolutions on CPU (just like we ask them to do CuDNN for convolutions on GPU).

xunzhang commented 6 years ago

Make sense to me.