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

[MXNET-399] Elemwise_mul between dense and csr on CPU & GPU #10894

Merged
merged 2 commits into from
May 31, 2018

Conversation

haojin2
Copy link
Contributor

@haojin2 haojin2 commented May 10, 2018

Description

As title

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

  • Elemwise_mul between default and csr
  • Corresponding unit tests

Comments

@haojin2 haojin2 force-pushed the elemwise_mul_dns_csr branch from 98c3bd3 to 178173d Compare May 10, 2018 23:00
@eric-haibin-lin eric-haibin-lin self-assigned this May 12, 2018
@haojin2 haojin2 force-pushed the elemwise_mul_dns_csr branch 2 times, most recently from 98b0d93 to 5e91b94 Compare May 19, 2018 07:00
@haojin2 haojin2 changed the title [MXNET-399] [WIP] Elemwise_mul between dense and csr on CPU & GPU [MXNET-399] Elemwise_mul between dense and csr on CPU & GPU May 19, 2018
CHECK_EQ(req, kWriteTo) << "elemwise(dns, csr) = csr only supports kWriteTo";
CHECK(req != kNullOp);
const bool supported_op = std::is_same<OP, mshadow_op::mul>::value ||
std::is_same<OP, mshadow_op::div>::value;
Copy link
Member

Choose a reason for hiding this comment

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

Remove div

CHECK(req != kNullOp);
const bool supported_op = std::is_same<OP, mshadow_op::mul>::value ||
std::is_same<OP, mshadow_op::div>::value;
CHECK(supported_op == true) << "elemwise(dns, csr) = csr only supports mul/div";
Copy link
Member

Choose a reason for hiding this comment

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

remove div

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.

CHECK_EQ(dns.storage_type(), kDefaultStorage);
CHECK_EQ(csr.storage_type(), kCSRStorage);
CHECK_EQ(req, kWriteTo) << "elemwise(dns, csr) = csr only supports kWriteTo";
CHECK(req != kNullOp);
Copy link
Member

Choose a reason for hiding this comment

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

if (req == kNullOp) return

@haojin2 haojin2 force-pushed the elemwise_mul_dns_csr branch 4 times, most recently from 9a6e9cd to 72ed037 Compare May 24, 2018 17:52
CHECK_EQ(req, kWriteTo) << "elemwise(dns, csr) = csr only supports kWriteTo";
if (req == kNullOp) return;
const bool supported_op = std::is_same<OP, mshadow_op::mul>::value;
CHECK(supported_op == true) << "elemwise(dns, csr) = csr only supports mul/div";
Copy link
Member

Choose a reason for hiding this comment

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

remove div?

const std::vector<NDArray> &outputs) {
const bool supported_ops = std::is_same<mshadow_op::right, LOP>::value &&
std::is_same<mshadow_op::left, ROP>::value;
CHECK(supported_ops);
Copy link
Member

Choose a reason for hiding this comment

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

err msg is missing

@haojin2 haojin2 force-pushed the elemwise_mul_dns_csr branch from 72ed037 to 406210d Compare May 30, 2018 17:59
@eric-haibin-lin eric-haibin-lin merged commit 9feecce into apache:master May 31, 2018
@haojin2 haojin2 deleted the elemwise_mul_dns_csr branch June 1, 2018 05:37
rahul003 pushed a commit to rahul003/mxnet that referenced this pull request Jun 4, 2018
…0894)

* support elemwise_mul between dns and csr

* address reviews and support for backward when ograd is dns
zheng-da pushed a commit to zheng-da/incubator-mxnet that referenced this pull request Jun 28, 2018
…0894)

* support elemwise_mul between dns and csr

* address reviews and support for backward when ograd is dns
@haojin2 haojin2 added the Sparse label Aug 12, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants