-
Notifications
You must be signed in to change notification settings - Fork 5.6k
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
enable MKLDNN inference test #10701
Conversation
for (auto* op : block->AllOps()) { | ||
if (op->HasAttr("use_mkldnn")) { | ||
op->SetAttr("use_mkldnn", true); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这段代码不适合放在test_helper.h
里, @Superjomn 请问放在哪个目录下比较好呢?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
作为目前的inference的测试enable,目前放在这里我觉得是可以的,后期确实可以放到某个API的地方,@Xreki 你觉得呢
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
我觉得可以先放在单测里面,验证功能和方便测试。后期肯定需要将这些内容放到paddle代码里面。
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
没有解决 #10682 的第二种情况。
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
我们可以下一步来解决这个问题
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这个函数这里可以加一个comment,说明这个函数以后将会移到Paddle主干代码里面去,临时放在这里为了测试。
There was a problem hiding this 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); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这个函数这里可以加一个comment,说明这个函数以后将会移到Paddle主干代码里面去,临时放在这里为了测试。
好的,没问题 |
enable MKLDNN test on AVX
fix C++ part of #10682
Steps to run
Take resnet of image_classification as an example:
make test ARGS="-R test_image_classification -V"
to generate the CPU model../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