mxnet icon indicating copy to clipboard operation
mxnet copied to clipboard

Let MxNet Support CuDNN v2.

Open starimpact opened this issue 10 years ago • 20 comments

HI, guys, I am going to make MxNet support CuDNNv2. Do you have any good suggestions? @tqchen @piiswrong

starimpact avatar Feb 01 '16 08:02 starimpact

Why should we support cuDNN v2? Is there any benefit from that?

On Mon, Feb 1, 2016 at 4:25 PM, Zhang Ming [email protected] wrote:

HI, guys, I am going to make MxNet support CuDNNv2. Do you have any good suggestions? @tqchen https://github.com/tqchen @piiswrong https://github.com/piiswrong

— Reply to this email directly or view it on GitHub https://github.com/dmlc/mxnet/issues/1392.

HONG Chuntao System Research Group Microsoft Research Asia

hjk41 avatar Feb 01 '16 08:02 hjk41

TK1 only support CuDNNv2.

starimpact avatar Feb 01 '16 08:02 starimpact

I see. 😅

On Mon, Feb 1, 2016 at 4:46 PM, Zhang Ming [email protected] wrote:

TK1 only support CuDNNv2.

— Reply to this email directly or view it on GitHub https://github.com/dmlc/mxnet/issues/1392#issuecomment-177855174.

HONG Chuntao System Research Group Microsoft Research Asia

hjk41 avatar Feb 01 '16 08:02 hjk41

Look into cudnn_covlution-inl.h. It shows how to use CUDNN_MAJOR to determine cudnn version and activate different code.

piiswrong avatar Feb 03 '16 08:02 piiswrong

thanks @piiswrong do you have any further suggestion?

starimpact avatar Feb 04 '16 02:02 starimpact

if do not consider the backward operation, it is easy to make mxnet use cudnn_v2.

starimpact avatar Feb 15 '16 03:02 starimpact

Have you make it to support cudadnn v2?

dangweili avatar Feb 24 '16 16:02 dangweili

yes, but only for prediction.

starimpact avatar Feb 26 '16 03:02 starimpact

While compiling with cudnn v2, I got the error: /mxnet/mshadow/mshadow/./base.h:276:45: error: 'CUDNN_DATA_HALF' was not declared in this scope static const cudnnDataType_t kCudnnFlag = CUDNN_DATA_HALF; ^

horsepurve avatar May 19 '16 03:05 horsepurve

@starimpact Have you managed to make mxnet support cudnn v2? I have two TK1 lying around and I would like to use them to train small sets for screening models and it would be great if you already did that :)

el-oso avatar May 29 '16 11:05 el-oso

@el-oso I am sorry, I just did the prediction on TK1.

starimpact avatar Jun 01 '16 02:06 starimpact

@starimpact Well, that is a start :). Could you share your code? Maybe I can manage to also update the training part.

el-oso avatar Jun 01 '16 11:06 el-oso

@starimpact Could you please share your Cudnnv2 version? a fork or a gist file would be really appreciated by the community :)

marcociccone avatar Oct 13 '16 14:10 marcociccone

no problem.i will share it tomorrow.

starimpact avatar Oct 13 '16 14:10 starimpact

@marcociccone https://github.com/starimpact/mxnet_tk1.git you need to remove the -msse2 and -msse3 which should be in dmlc-core and mshadow by yourself. there are just two places. if there is any problem , you can ask me for help.

starimpact avatar Oct 14 '16 03:10 starimpact

Thank you! I’ll let you know if I have some troubles

Il giorno 14 ott 2016, alle ore 05:27, Zhang Ming [email protected] ha scritto:

@marcociccone https://github.com/marcociccone [email protected] mailto:[email protected]:starimpact/mxnet_tk1.git you need to remove the -msse2 and -msse3 which should be in dmlc-core and mshadow by yourself. if there is any problem , you can ask me for help.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/dmlc/mxnet/issues/1392#issuecomment-253700680, or mute the thread https://github.com/notifications/unsubscribe-auth/ABECRHMl452YrwviTPuYc4ej88PocGhUks5qzvaugaJpZM4HQWDc.

marcociccone avatar Oct 19 '16 15:10 marcociccone

@marcociccone @starimpact Could you succeed in compiling mxnet for cuDNN? I couldn't compile it. In fact, I've noticed GPUs which I may access have compute capability less than 3. So they do not support cuDNN. However, I feel it may require sometime :)

mcxkarakoc avatar Oct 30 '16 13:10 mcxkarakoc

@horsepurve Just missing CUDNN_DATA_HALF definition, modify your cudnn.h. cd /usr/local/cuda/include; find the cudnn.h file, edit it find this code block: /*

  • CUDNN data type */ typedef enum { CUDNN_DATA_FLOAT = 0, CUDNN_DATA_DOUBLE = 1 } cudnnDataType_t;

Add CUDNN_DATA_HALF = 2

After changes:

typedef enum { CUDNN_DATA_FLOAT = 0, CUDNN_DATA_DOUBLE = 1, CUDNN_DATA_HALF = 2 } cudnnDataType_t;

good luck hhhhhh

crabriver avatar Feb 10 '17 08:02 crabriver

No, I still get an error :(. I can build MXNet without CUDA support, but then I don't use the full potential of the board, i.e. no GPU. I just want to build it for prediction with CUDA 6.5/CUDNN v2 (max available in the TK1 afaik), is there a way to do that?

@crabriver did you try your fix yourself? I tried it and compilation goes further but then it gets stuck in

In file included from src/operator/cudnn_convolution.cc:7:0: src/operator/./cudnn_convolution-inl.h:36:13: error: ‘cudnnConvolutionBwdDataAlgo_t’ has not been declared cudnnConvolutionBwdDataAlgo_t *bwd,

el-oso avatar Feb 23 '17 02:02 el-oso

This issue is closed due to lack of activity in the last 90 days. Feel free to reopen if this is still an active issue. Thanks!

phunterlau avatar Sep 28 '17 23:09 phunterlau