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

[INTEL MKL] Refactor the implementation of forward conv ops w MKL-DNN v1.0 integration - #35757

Merged

Conversation

@gzmkl
Copy link
Contributor

gzmkl commented Jan 10, 2020

This PR is intended to refactor the current implementation of forward conv ops with MKL-DNN
v1.0 integration:
(1) Abstract macro definitions from individual source files to a common header file (mkl_types)
for better code reuse (in coming PR's)
(2) Refactor based on Google coding style. For instance, replace CHECK_NOTNULL to DCHECK.

Background:
We (Intel) will submit a sequence of PR's with MKL-DNN v1.0 integration (around 24 MKL ops).
And this PR will be fundamental for the near future PR's.

Reference of previously merged PR:
#30549

@tensorflow-bot tensorflow-bot bot added the size:L label Jan 10, 2020
@googlebot

This comment has been minimized.

Copy link

googlebot commented Jan 10, 2020

Thanks for your pull request. It looks like this may be your first contribution to a Google open source project (if not, look below for help). Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

📝 Please visit https://cla.developers.google.com/ to sign.

Once you've signed (or fixed any issues), please reply here with @googlebot I signed it! and we'll verify it.


What to do if you already signed the CLA

Individual signers
Corporate signers

ℹ️ Googlers: Go here for more info.

@googlebot googlebot added the cla: no label Jan 10, 2020
@gbaned gbaned self-assigned this Jan 13, 2020
@gbaned

This comment has been minimized.

Copy link
Contributor

gbaned commented Jan 13, 2020

@gzmkl thank you for your contribution, please sign CLA.

@gzmkl

This comment has been minimized.

Copy link
Contributor Author

gzmkl commented Jan 15, 2020

I am having CLA problem and will ask teammate to create a new one and close this one

@gzmkl

This comment has been minimized.

Copy link
Contributor Author

gzmkl commented Jan 15, 2020

Will create a new one

@gzmkl gzmkl closed this Jan 15, 2020
@gzmkl

This comment has been minimized.

Copy link
Contributor Author

gzmkl commented Jan 15, 2020

Reopen to test CLA access

@gzmkl gzmkl reopened this Jan 15, 2020
@gzmkl

This comment has been minimized.

Copy link
Contributor Author

gzmkl commented Jan 15, 2020

Hi there,
I should have CLA access now with the test of https://cla.developers.google.com/clas
Please help to check this.
Many thanks!

@mdfaijul

This comment has been minimized.

Copy link
Contributor

mdfaijul commented Jan 17, 2020

@gzmkl

This comment has been minimized.

Copy link
Contributor Author

gzmkl commented Jan 17, 2020

@googlebot I signed it!

@googlebot

This comment has been minimized.

Copy link

googlebot commented Jan 17, 2020

CLAs look good, thanks!

ℹ️ Googlers: Go here for more info.

@googlebot googlebot added cla: yes and removed cla: no labels Jan 17, 2020
@gbaned gbaned added this to Assigned Reviewer in PR Queue via automation Jan 20, 2020
@gbaned gbaned added the comp:mkl label Jan 20, 2020
@gbaned gbaned requested a review from penpornk Jan 20, 2020
@gbaned

This comment has been minimized.

Copy link
Contributor

gbaned commented Jan 20, 2020

@gzmkl Can you please resolve conflicts? Thanks!

@gzmkl

This comment has been minimized.

Copy link
Contributor Author

gzmkl commented Jan 21, 2020

Thanks for the reminder. I have addressed the merge conflict.

By the way, Amin (@mdfaijul) will cover me during my vacation (next two weeks).

@Jianhui-Li

This comment has been minimized.

Copy link

Jianhui-Li commented Jan 22, 2020

@penporn We are preparing a series of PRs for DNNL1.0 upgrade, which all depends on this PR. Merging of this PR will immensely help with other PRs. Thanks!

@penpornk

This comment has been minimized.

Copy link
Member

penpornk commented Jan 22, 2020

@Jianhui-Li @gzmkl Sorry for the delay! I'll review this later today.

@mdfaijul

This comment has been minimized.

Copy link
Contributor

mdfaijul commented Jan 22, 2020

@penpornk you can tag me for any comments. I will be addressing the comments. The author of this PR is currently on vacation.

Copy link
Member

penpornk left a comment

Thank you for the PR. This is great! I have two very minor formatting nits.

@mdfaijul Got it!
@gzmkl Hope you have a great vacation!

@@ -1313,8 +1222,8 @@ class MklConvOp : public OpKernel {
*cached_filter_md_ptensor_.AccessTensor(context);

// Check if the memory descriptor of the cached weights is same as
// filter_md. If so, we can use the cached weights; otherwise
// return NULL.
// filter_md. If so, we can used the cached weights; otherwise

This comment has been minimized.

Copy link
@penpornk

penpornk Jan 23, 2020

Member

Nit: typo

Suggested change
// filter_md. If so, we can used the cached weights; otherwise
// filter_md. If so, we can use the cached weights; otherwise

This comment has been minimized.

Copy link
@mdfaijul

mdfaijul Jan 23, 2020

Contributor

Done.

} else if (port::TestCPUFeature(port::CPUFeature::AVX2) &&
(channel % 8) == 0) {
fmt_desired = is_2d ? MEMORY_FORMAT::nChw8c
: MEMORY_FORMAT::ncdhw; // no avx2 support for 3d yet.

This comment has been minimized.

Copy link
@penpornk

penpornk Jan 23, 2020

Member

Nit:

Suggested change
: MEMORY_FORMAT::ncdhw; // no avx2 support for 3d yet.
: MEMORY_FORMAT::ncdhw; // No AVX2 support for 3D yet.

This comment has been minimized.

Copy link
@mdfaijul

mdfaijul Jan 23, 2020

Contributor

Done.

PR Queue automation moved this from Assigned Reviewer to Reviewer Requested Changes Jan 23, 2020
@googlebot

This comment has been minimized.

Copy link

googlebot commented Jan 23, 2020

All (the pull request submitter and all commit authors) CLAs are signed, but one or more commits were authored or co-authored by someone other than the pull request submitter.

We need to confirm that all authors are ok with their commits being contributed to this project. Please have them confirm that by leaving a comment that contains only @googlebot I consent. in this pull request.

Note to project maintainer: There may be cases where the author cannot leave a comment, or the comment is not properly detected as consent. In those cases, you can manually confirm consent of the commit author(s), and set the cla label to yes (if enabled on your project).

ℹ️ Googlers: Go here for more info.

@googlebot googlebot added cla: no and removed cla: yes labels Jan 23, 2020
@mdfaijul

This comment has been minimized.

Copy link
Contributor

mdfaijul commented Jan 23, 2020

@googlebot I consent.

@googlebot

This comment has been minimized.

Copy link

googlebot commented Jan 23, 2020

CLAs look good, thanks!

ℹ️ Googlers: Go here for more info.

@googlebot googlebot added cla: yes and removed cla: no labels Jan 23, 2020
@mdfaijul

This comment has been minimized.

Copy link
Contributor

mdfaijul commented Jan 23, 2020

@penpornk Fixed typos in comments. Please check.

@mdfaijul

This comment has been minimized.

Copy link
Contributor

mdfaijul commented Jan 26, 2020

@penpornk I removed some unoptimized code in tensorflow/core/util/mkl_util.h and minor changes in other files. Please check. Also addressed your earlier comments.

PR Queue automation moved this from Reviewer Requested Changes to Approved by Reviewer Jan 26, 2020
Copy link
Member

penpornk left a comment

Sorry for the delay and thank you for the fixes!

@mdfaijul

This comment has been minimized.

Copy link
Contributor

mdfaijul commented Jan 27, 2020

@gbaned Our subsequent PRs for integrating MKLDNN 1.x version depends on this current PR. We can submit those PR once this PR is merged. Can we expect this PR to be merged soon?

tensorflow-copybara pushed a commit that referenced this pull request Jan 28, 2020
PiperOrigin-RevId: 291962219
Change-Id: Id4e71dad6589cec7e291f7bddb44c01878eae58e
@tensorflow-copybara tensorflow-copybara merged commit b7e570b into tensorflow:master Jan 28, 2020
10 checks passed
10 checks passed
Android Demo App Internal CI build successful
Details
Linux GPU Internal CI build successful
Details
MacOS CPU Python3 Internal CI build successful
Details
MacOS Python2 and CC Internal CI build successful
Details
Ubuntu CPU Internal CI build successful
Details
Ubuntu Sanity Internal CI build successful
Details
Windows Bazel Internal CI build successful
Details
Windows Bazel GPU Internal CI build successful
Details
cla/google All necessary CLAs are signed
import/copybara Change imported to the internal review system
Details
PR Queue automation moved this from Approved by Reviewer to Merged Jan 28, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
PR Queue
  
Merged
9 participants
You can’t perform that action at this time.