Skip to content
This repository has been archived by the owner on Nov 17, 2023. It is now read-only.

MKLDNN Forward FullyConnected op cache #11611

Merged
merged 5 commits into from
Aug 26, 2018
Merged

MKLDNN Forward FullyConnected op cache #11611

merged 5 commits into from
Aug 26, 2018

Conversation

huangzhiyuan
Copy link
Contributor

@huangzhiyuan huangzhiyuan commented Jul 9, 2018

Description

Enable primitive allocation cache for FullyConnected, separate from PR #11301

@zheng-da , @pengzhao-intel, @ZhennanQin

Checklist

Essentials

Please feel free to remove inapplicable items for your PR.

  • The PR title starts with [MXNET-$JIRA_ID], where $JIRA_ID refers to the relevant JIRA issue created (except PRs with tiny changes)
  • Changes are complete (i.e. I finished coding on this PR)
  • All changes have test coverage:
  • Unit tests are added for small changes to verify correctness (e.g. adding a new operator)
  • Nightly tests are added for complicated/long-running ones (e.g. changing distributed kvstore)
  • Build tests will be added for build configuration changes (e.g. adding a new build option with NCCL)
  • Code is well-documented:
  • For user-facing API changes, API doc string has been updated.
  • For new C++ functions in header files, their functionalities and arguments are documented.
  • For new examples, README.md is added to explain the what the example does, the source of the dataset, expected performance on test set and reference to the original paper if applicable
  • Check the API doc at http://mxnet-ci-doc.s3-accelerate.dualstack.amazonaws.com/PR-$PR_ID/$BUILD_ID/index.html
  • To the my best knowledge, examples are either not affected by this change, or have been fixed to be compatible with this change

Changes

  • Feature1, tests, (and when applicable, API doc)
  • Feature2, tests, (and when applicable, API doc)

Comments

  • If this change is a backward incompatible change, why must this change be made.
  • Interesting edge cases to note here

@marcoabreu
Copy link
Contributor

Hi, please add a test to ensure the caching works as expected

@BiranLi
Copy link

BiranLi commented Jul 11, 2018

Which version of mkldnn is suitable for this PR?
Is the 1.4 version working?

@huangzhiyuan
Copy link
Contributor Author

The PR is based on release v0.14 version. Thanks.

@eric-haibin-lin
Copy link
Member

@azai91 could you help review

@sandeep-krishnamurthy sandeep-krishnamurthy added MKLDNN Backend Issues related to the backend of MXNet pr-awaiting-review PR is waiting for code review labels Aug 8, 2018
@lupesko
Copy link
Contributor

lupesko commented Aug 21, 2018

@azai91 @mseth10 can you guys help review please? thanks!

ipFwd_pd.bias_primitive_desc(), bias->get_data_handle()));
else
this->bias->set_data_handle(bias->get_data_handle());
if (this->ipFwd == nullptr)
Copy link
Contributor

Choose a reason for hiding this comment

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

fix indent here?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Have fixed.

if (param.no_bias) {
MKLDNNStream::Get()->RegisterPrim(mkldnn::inner_product_forward(
ipFwd_pd, *data_mem, *weight_mem, *out_mem.second));
FCFwd.ipFwd_pd.dst_primitive_desc(), req[fullc::kOut]);
Copy link
Contributor

Choose a reason for hiding this comment

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

pass in_data as last argument for CreateMKLDNNMem in case req is WriteInPlace

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done.

@azai91
Copy link
Contributor

azai91 commented Aug 21, 2018

approve conditional on adding that param to CreateMKLDNNMem so we can support kWriteInPlace.

@eric-haibin-lin eric-haibin-lin merged commit 7230bb9 into apache:master Aug 26, 2018
anirudh2290 pushed a commit to anirudh2290/mxnet that referenced this pull request Sep 19, 2018
* Enable primitive allocation cache for FullyConnected

* Enable primitive allocation cache for FullyConnected

* fix indent and pass in_data as last argument for CreateMKLDNNMem

* fix indent and pass in_data as last argument for CreateMKLDNNMem
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Backend Issues related to the backend of MXNet MKLDNN pr-awaiting-review PR is waiting for code review
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

7 participants