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

Fix InferStorage for sparse fallback in FullyConnected #11498

Merged
merged 2 commits into from
Jul 12, 2018

Conversation

haojin2
Copy link
Contributor

@haojin2 haojin2 commented Jun 29, 2018

Description

#11448

Checklist

Essentials

  • 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:https://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

  • Fix storage fallback in backward

Comments

@haojin2
Copy link
Contributor Author

haojin2 commented Jun 29, 2018

@eric-haibin-lin

Copy link
Member

@eric-haibin-lin eric-haibin-lin left a comment

Choose a reason for hiding this comment

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

can we add test that will actually fail without this patch? (e.g rowsparse weight)

@@ -210,17 +210,17 @@ inline static bool BackwardFCStorageType(const nnvm::NodeAttrs& attrs,
CHECK_EQ(in_attrs->size(), 3U);
CHECK_EQ(out_attrs->size(), out_expected);

DispatchMode wanted_mode;
#if 0
bool dispatched = false;
// TODO(zhengda) let's disable MKLDNN for FullyConnected for now.
Copy link
Member

Choose a reason for hiding this comment

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

@zheng-da @azai91 is there a plan to enable FC with MKLDNN, or at least test it out? If there's a bug reveal by this test, this will also help stabilize mxnet-MKLDNN.

Copy link
Contributor

Choose a reason for hiding this comment

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

ideally we should enable it. i forgot the case that it fails. i don't think MKLDNN FC backward is much faster than our native implementation. so it's not very urgent.
@pengzhao-intel @TaoLv did you check if MKLDNN FC backward works in all cases?

Copy link
Contributor

Choose a reason for hiding this comment

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

We have enabled this in the #11301 and it passed all unit tests and coverage test in our local.
So, I think MKLDNN FC backward works fine.

@zheng-da
Copy link
Contributor

zheng-da commented Jul 3, 2018

@haojin2 could you write a unit test?

@haojin2
Copy link
Contributor Author

haojin2 commented Jul 10, 2018

@zheng-da unit test added.

@haojin2
Copy link
Contributor Author

haojin2 commented Jul 11, 2018

@eric-haibin-lin @zheng-da

@eric-haibin-lin eric-haibin-lin merged commit 7dbbe59 into apache:master Jul 12, 2018
@haojin2 haojin2 deleted the fix_fc_mkldnn branch July 19, 2018 20:11
XinYao1994 pushed a commit to XinYao1994/incubator-mxnet that referenced this pull request Aug 29, 2018
* fix inferstorage for sparse in FullyConnected

* test for the new infer storage
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants