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

mkldnn s8 conv API change for master #13903

Merged
merged 1 commit into from
Jan 25, 2019
Merged

Conversation

ZhennanQin
Copy link
Contributor

@ZhennanQin ZhennanQin commented Jan 16, 2019

Description

This is extracted from #13697, to make API change for master.

@KellenSunderland @pengzhao-intel

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

@ZhennanQin ZhennanQin changed the title API change for 1.4.x branch mkldnn s8 conv API change for master Jan 16, 2019
@stu1130
Copy link
Contributor

stu1130 commented Jan 16, 2019

@mxnet-label-bot add [pr-awaiting-review, MKLDNN]
Thanks for your contribtuion @ZhennanQin

@marcoabreu marcoabreu added MKLDNN pr-awaiting-review PR is waiting for code review labels Jan 16, 2019
Copy link
Contributor

@pengzhao-intel pengzhao-intel left a comment

Choose a reason for hiding this comment

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

LGTM

Aligned with #13905 which has been merged into 1.4.x

@@ -168,16 +168,28 @@ nnvm::Symbol NDArray::get_autograd_symbol() const {

#if MXNET_USE_MKLDNN == 1

NDArray::NDArray(const mkldnn::memory *mkldnn_mem, bool static_data)
Copy link
Contributor

Choose a reason for hiding this comment

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

it seems the old impl is incorrect. what if static_data=false?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

If static_data=false, then NDArray will take responsible to free this memory at deconstruction. But it has a double free risk that if mkldnn_mem be freed outside. I agreed that it's not a good design, so I changed it to std::shared_ptrmkldnn::memory to avoid the chance of double free.

@zheng-da
Copy link
Contributor

LGTM

@KellenSunderland KellenSunderland merged commit 5dc138d into apache:master Jan 25, 2019
jessr92 pushed a commit to jessr92/incubator-mxnet that referenced this pull request Jan 27, 2019
jessr92 pushed a commit to jessr92/incubator-mxnet that referenced this pull request Jan 27, 2019
stephenrawls pushed a commit to stephenrawls/incubator-mxnet that referenced this pull request Feb 16, 2019
haohuanw pushed a commit to haohuanw/incubator-mxnet that referenced this pull request Jun 23, 2019
@ZhennanQin ZhennanQin deleted the api branch September 16, 2019 07:01
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
MKLDNN pr-awaiting-review PR is waiting for code review
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants