Paddle icon indicating copy to clipboard operation
Paddle copied to clipboard

Some findings about testing MKL_DNN on laptop

Open kuke opened this issue 9 years ago • 3 comments

We run the mkl_dnn benchmark test in Docker container on the laptop Dell XPS 15 , and find that:

  1. The batch size of training samples is limited by the memory (8G) of the laptop, up to 48, which is smaller than the minimum batch size of the benchmark test on server.

  2. When batch size is too small (<=8), the training cost will yield nan. Maybe need to modify the test script to avoid such nan cost.

kuke avatar Nov 08 '17 03:11 kuke

Thanks kuke

  1. I highly recommend expand the memory for benchmark, since 8G is even smaller than some GPU(12G memory). And for some typologies which are very deep like resnet, we can only choose very small batchsize. It can not show the best performance of MKL-DNN or MKLML.

  2. When change batchsize to smaller, we should change the learning rate smaller too, since vgg do not have batch norm layer, it's very easy to nan

tensor-tang avatar Nov 08 '17 05:11 tensor-tang

since 8G is even smaller than some GPU(12G memory)

我们选择内存不大的笔记本和台式机来做性能测试,主要原因是:笔记本和台式机属于民用市场:考虑到大多数学习场景,GPU都是过剩的,而且学习过程如果用GPU对学生来说也是不小的升级成本。如果MKLDNN能在当前资源下可以跑通大多数模型,对初级用户可能是个特别大的福音。

since vgg do not have batch norm layer, it's very easy to nan

如果在小的bs情况下,vgg容易出现NAN,是否可以考虑测试别的网络?

luotao1 avatar Nov 08 '17 06:11 luotao1

减小learning rate之后就不会nan了。

tensor-tang avatar Nov 08 '17 06:11 tensor-tang