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 MKLDNN inference test #10701

Merged
merged 2 commits into from
May 22, 2018
Merged

Conversation

tensor-tang
Copy link
Contributor

@tensor-tang tensor-tang commented May 16, 2018

enable MKLDNN test on AVX
fix C++ part of #10682

Steps to run

Take resnet of image_classification as an example:

  1. make test ARGS="-R test_image_classification -V" to generate the CPU model.

  2. ./build/paddle/fluid/inference/tests/book/test_inference_image_classification_resnet --dirname=./build/python/paddle/fluid/tests/book/image_classification_resnet.inference.model --batch_size=2 --repeat=10 --use_mkldnn=True

for (auto* op : block->AllOps()) {
if (op->HasAttr("use_mkldnn")) {
op->SetAttr("use_mkldnn", true);
}
Copy link
Contributor

Choose a reason for hiding this comment

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

这段代码不适合放在test_helper.h里, @Superjomn 请问放在哪个目录下比较好呢?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

作为目前的inference的测试enable,目前放在这里我觉得是可以的,后期确实可以放到某个API的地方,@Xreki 你觉得呢

Copy link
Contributor

Choose a reason for hiding this comment

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

我觉得可以先放在单测里面,验证功能和方便测试。后期肯定需要将这些内容放到paddle代码里面。

Copy link
Contributor

Choose a reason for hiding this comment

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

没有解决 #10682 的第二种情况。

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.

这个函数这里可以加一个comment,说明这个函数以后将会移到Paddle主干代码里面去,临时放在这里为了测试。

@Xreki Xreki added the 预测 原名Inference,包含Capi预测问题等 label May 16, 2018
@tensor-tang tensor-tang requested review from luotao1 and Xreki May 16, 2018 11:19
Copy link
Contributor

@Xreki Xreki left a comment

Choose a reason for hiding this comment

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

LGTM. 我觉得可以先merge,短期内可以方便测试。

for (auto* op : block->AllOps()) {
if (op->HasAttr("use_mkldnn")) {
op->SetAttr("use_mkldnn", true);
}
Copy link
Contributor

Choose a reason for hiding this comment

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

这个函数这里可以加一个comment,说明这个函数以后将会移到Paddle主干代码里面去,临时放在这里为了测试。

@tensor-tang
Copy link
Contributor Author

好的,没问题

@tensor-tang tensor-tang merged commit 406c1dd into PaddlePaddle:develop May 22, 2018
@tensor-tang tensor-tang deleted the usemkldnn branch May 22, 2018 05:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
预测 原名Inference,包含Capi预测问题等
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants