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

[new-exec] fit mkldnn #41058

Merged
merged 4 commits into from
Mar 31, 2022
Merged

[new-exec] fit mkldnn #41058

merged 4 commits into from
Mar 31, 2022

Conversation

zhiqiu
Copy link
Contributor

@zhiqiu zhiqiu commented Mar 29, 2022

PR types

New features

PR changes

Others

Describe

fit mkldnn for new executor

@paddle-bot-old
Copy link

你的PR提交成功,感谢你对开源项目的贡献!
请关注后续CI自动化测试结果,详情请参考Paddle-CI手册
Your PR has been submitted. Thanks for your contribution!
Please wait for the result of CI firstly. See Paddle CI Manual for details.

// NOTE(zhiqiu): hot fix, follow the same logic in DataCopy() in fetch_op.cc
if (in_layout == framework::DataLayout::kMKLDNN &&
var_name == framework::GradVarName("Filter") && is_fetch_v2) {
out_layout = framework::DataLayout::kNCHW;
Copy link
Contributor

Choose a reason for hiding this comment

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

Why out_layout is set to kNCHW ?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I don't really understand the tricky, just follow DataCopy() in fetch_op.cc

Copy link
Contributor

Choose a reason for hiding this comment

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

Ok. Thanks I understand now.

VLOG(4) << in_layout << "->" << out_layout << " " << in_tensor.layout();
if (!in_tensor.IsInitialized() && in_layout == DataLayout::kMKLDNN &&
out_layout == DataLayout::kNHWC) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Recently DataLayout was extended with 5D NHWC layout e.g. kNDHWC for which also MatchShapeToLayout() should be called

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ok, I think this can be refined in the future, here just follow the same logic in executor.cc

Copy link
Contributor

Choose a reason for hiding this comment

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

ok

@jczaja
Copy link
Contributor

jczaja commented Mar 30, 2022

@zhiqiu We just started our own tests on this PR just to see functional and performance impact of changes . We will come back to you when we have results (this week) so please wait with merging

@zhiqiu
Copy link
Contributor Author

zhiqiu commented Mar 30, 2022

@zhiqiu We just started our own tests on this PR just to see functional and performance impact of changes . We will come back to you when we have results (this week) so please wait with merging

@jczaja Thanks. Since paddle is approaching release-2.3, and there are some works depending on this PR, can we merge it first? If any problems are found, we can fix them in the next PR.

@jczaja
Copy link
Contributor

jczaja commented Mar 31, 2022

@zhiqiu Yes. we just finished light testing and this PR passed our C++ workloads . So should be fine. It can be merged.

Copy link
Contributor

@jczaja jczaja left a comment

Choose a reason for hiding this comment

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

LGTM

@zhiqiu
Copy link
Contributor Author

zhiqiu commented Mar 31, 2022

@zhiqiu Yes. we just finished light testing and this PR passed our C++ workloads . So should be fine. It can be merged.

Thanks.

@zhiqiu zhiqiu merged commit 02cf676 into PaddlePaddle:develop Mar 31, 2022
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