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

Enable slice embedding concat split fuse #14491

Open
wants to merge 37 commits into
base: master
Choose a base branch
from

Conversation

JustForFun099
Copy link

Description

As title, fuse Slice Split Embedding Concat for Wide & Deep Model

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

@pinaraws
Copy link

Thank you for your contribution @JustForFun099 !
@mxnet-label-bot add[pr-awaiting-review]

@marcoabreu marcoabreu added the pr-awaiting-review PR is waiting for code review label Mar 25, 2019
Copy link
Contributor

@apeforest apeforest left a comment

Choose a reason for hiding this comment

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

Please add unit tests

@JustForFun099
Copy link
Author

@apeforest, testcase are added now, please help review again, ths.

@piyushghai
Copy link
Contributor

@apeforest Ping for review...

aux_array = [mx.nd.random.uniform(shape=shape) for shape in aux_shapes]
exe = sym.bind(ctx=mx.current_context(), args=arg_array, aux_states=aux_array, grad_req='null')
exe.forward()
os.environ['MXNET_SUBGRAPH_BACKEND'] = 'MKLDNN_WIDE_AND_DEEP_INPUT_FUSE'
Copy link
Contributor

Choose a reason for hiding this comment

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

is this environment variable newly introduced? where is the documentation?

Copy link
Contributor

Choose a reason for hiding this comment

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

I didn' see anything about MKLDNN primitive and API in the code.
I suggest removing the keyword of MKLDNN to make the thing clear.

Copy link
Contributor

@apeforest apeforest left a comment

Choose a reason for hiding this comment

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

@pengzhao-intel This PR is related to MKLDNN. Please help review. Thanks!

@apeforest
Copy link
Contributor

@JustForFun099 Can you provide more context in the PR description: (1) why do we need this? (2) who is the customer? (3) any workaround today without this (4) who will maintain this. Thanks!

@pengzhao-intel
Copy link
Contributor

@pengzhao-intel This PR is related to MKLDNN. Please help review. Thanks!

The PR belongs to operator improvement rather than MKLDNN implementation.
cc @szha for the review for the interface change.

@JustForFun099
Copy link
Author

JustForFun099 commented Apr 11, 2019

Thanks for @apeforest 's review. below are answers to your questions:

  1. why do we need this? [Generic optimization for CPU]
  2. who is the customer? [Generic optimization for CPU]
  3. any workaround today without this ? [NO]
  4. who will maintain this? [Apache community]

@pengzhao-intel
Copy link
Contributor

Please retrigger the CI

@anirudhacharya
Copy link
Member

@apeforest can you review this PR again. Thanks

using namespace mshadow;
CHECK_EQ(in_shape->size(), 1U);
mxnet::TShape dshape = in_shape->at(slice_enum::kData);
mxnet::TShape ishape = in_shape->at(slice_enum::kData);
Copy link
Contributor

Choose a reason for hiding this comment

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

does in_shape->at have to accessed twice? can we do it once and reuse?

// The Assumption is only base on W&D which all
// embedding occur at the beginning and output to 1 concat node
if (op_name == EMBEDDING_NODE_NAME) {
emb_nodes.push_back(node);
Copy link
Contributor

Choose a reason for hiding this comment

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

can push_back be replaced by emplace_back wherever applicable?

@karan6181
Copy link
Contributor

@JustForFun099 Could you address the review comments? Thanks!

@abhinavs95
Copy link
Contributor

@JustForFun099 Ping for an update! Thanks.

@piyushghai
Copy link
Contributor

@JustForFun099 Gentle ping...

@vandanavk
Copy link
Contributor

@mxnet-label-bot update [pr-awaiting-response]

@marcoabreu marcoabreu added pr-awaiting-response PR is reviewed and waiting for contributor to respond and removed pr-awaiting-review PR is waiting for code review labels Jun 16, 2019
@karan6181
Copy link
Contributor

@JustForFun099 Thank you for you contribution. Could you please provide an update on the PR? There is no activity since 90+ days and we can close it if you don't have a bandwidth to work right now.

@piyushghai
Copy link
Contributor

@JustForFun099 Can you give an update on this PR ?

@roywei
Copy link
Member

roywei commented Aug 19, 2019

@JustForFun099 gentle ping to rebase and update, thanks!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
pr-awaiting-response PR is reviewed and waiting for contributor to respond
Projects
None yet
Development

Successfully merging this pull request may close these issues.