Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

enable benchmark resnet with MKLDNN #5422

Merged
merged 6 commits into from
Nov 8, 2017
Merged

Conversation

tensor-tang
Copy link
Contributor

No description provided.

@tensor-tang tensor-tang requested a review from luotao1 November 7, 2017 04:04
train vgg 128 True
train vgg 256 True
total_cores=`ls -l /sys/devices/system/cpu/ | grep "cpu[0-9]*$" | wc -l`
online_cores=`cat /sys/devices/system/cpu/cpu*/online | grep -o '1' | wc -l`
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

我在服务器Intel(R) Xeon(R) CPU E5-2620 v2 @ 2.10GHz 上运行42和43行:

  • 42行是12
  • 43行是11

这样说明是关了超线程?
上次的测试中,超线程的影响不是很大。

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

上次的测试是因为还有操作系统的因素在里面。并且,在后面高端处理器中这个配置还是会有一定影响的。

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这两个命令,对docker和mac都适用么

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

docker我试了是可以的,但是我这边没有mac,没有测试过。

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

mac上面测试会报错/sys/devices/system/cpu/: No such file or directory

Copy link
Contributor Author

@tensor-tang tensor-tang Nov 7, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

谢谢,那请问下,这几个命令有效吗?
grep 'physical id' /proc/cpuinfo |sort -u|wc -l
grep "cpu cores" /proc/cpuinfo|uniq
grep -c processor /proc/cpuinfo

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

上面这个命令也是不行的,都会报错:/proc/cpuinfo: No such file or directory

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

嗯,是的,我后来也查到了,所以我还是删除了这里HT的判断,免得把事情弄麻烦了。谢谢

# resnet-50, 101 and 152
train resnet 50 $batchsize $use_mkldnn
train resnet 101 $batchsize $use_mkldnn
train resnet 152 $batchsize $use_mkldnn
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • 这里需要测那么多?那这一个脚本跑下来太久了。vgg和resnet各选一个就够了。
  • 个人觉得原来全部写开比较好,方便选择和测试,因为还有一个openblas版本要测。

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

可以各选一个。
另外关于openblas的测试,只需要第一个for那里去掉True就好了,这样改动也挺少的。不然你还是要删除好几行。
并且加一个topology,每个batchsize需要写一行,这样省code。

@tensor-tang
Copy link
Contributor Author

tensor-tang commented Nov 7, 2017

@luotao1 对于HT的判断,由于在Mac上比较麻烦做到兼容,也有点得不偿失,所以还是去掉了自动判断,保留了以前的做法。

Copy link
Contributor

@luotao1 luotao1 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@luotao1 luotao1 merged commit ce08645 into PaddlePaddle:develop Nov 8, 2017
@tensor-tang tensor-tang deleted the resnet branch November 8, 2017 05:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants