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

Optimize cached op static memory allocation #11658

Closed
wants to merge 5 commits into from

Conversation

piiswrong
Copy link
Contributor

Description

(Brief description on what this PR is about)

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

@piiswrong piiswrong requested a review from anirudh2290 as a code owner July 11, 2018 22:50
@piiswrong
Copy link
Contributor Author

what API doc?

@@ -513,6 +515,7 @@ class NDArray {
// We can't reuse memory in a view.
CHECK(!IsView());
NDArray ret = *this;
ret.byte_offset_ = byte_offset_ + byte_offset;
Copy link
Contributor

Choose a reason for hiding this comment

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

this might be problematic. The way of testing if an array is a view uses both reuse_ and byte_offset_. /~https://github.com/apache/incubator-mxnet/blob/master/include/mxnet/ndarray.h#L147
if reuse_ is true, the array can't be a view. I wonder if setting byte_offset_ to non-zero can cause problems.

@zheng-da
Copy link
Contributor

I think you should test on models with static memory alloc when mkldnn is enabled.

@sandeep-krishnamurthy sandeep-krishnamurthy added Backend Issues related to the backend of MXNet pr-awaiting-response PR is reviewed and waiting for contributor to respond labels Aug 8, 2018
@lupesko
Copy link
Contributor

lupesko commented Sep 11, 2018

@piiswrong looks like this is ready for merge?

@stu1130
Copy link
Contributor

stu1130 commented Sep 21, 2018

@piiswrong bounce again

@vandanavk
Copy link
Contributor

@haojin2 @apeforest for review

@vrakesh
Copy link
Contributor

vrakesh commented Oct 9, 2018

@haojin2 is this good to merge?

@Roshrini
Copy link
Member

@piiswrong @eric-haibin-lin Is this PR ready to be merged?

@ankkhedia
Copy link
Contributor

@piiswrong @eric-haibin-lin ping!
It seems like this PR is good to go. Could you please look into it?

@kalyc
Copy link
Contributor

kalyc commented Nov 12, 2018

@eric-haibin-lin @piiswrong could you please take a look?

@mxnet-label-bot add [pr-awaiting-merge]

@stu1130
Copy link
Contributor

stu1130 commented Nov 21, 2018

@mxnet-label-bot update [backend, pr-awaiting-merge]
@eric-haibin-lin feel free to review and change the label

@marcoabreu marcoabreu added pr-awaiting-merge Review and CI is complete. Ready to Merge Backend Issues related to the backend of MXNet and removed Backend Issues related to the backend of MXNet pr-awaiting-response PR is reviewed and waiting for contributor to respond labels Nov 21, 2018
@pengzhao-intel
Copy link
Contributor

@ZhennanQin to aware the changes since we are WIP for Cached OP too.

@KellenSunderland
Copy link
Contributor

@piiswrong When you have a second I believe this may need a rebase. Has some refs to a non-existing TVM commit, 290226e1c9a.

@ZhennanQin
Copy link
Contributor

@pengzhao-intel I just reviewed this. It has nothing changed with cpu backend, but an optimization for GPU memory pool. So I think it's OK.

@stu1130
Copy link
Contributor

stu1130 commented Nov 26, 2018

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

@marcoabreu marcoabreu added pr-awaiting-response PR is reviewed and waiting for contributor to respond and removed Backend Issues related to the backend of MXNet pr-awaiting-merge Review and CI is complete. Ready to Merge labels Nov 26, 2018
@roywei
Copy link
Member

roywei commented Dec 11, 2018

@piiswrong ping to rebase and trigger ci, thanks!

@sandeep-krishnamurthy
Copy link
Contributor

@piiswrong - Can you please suggest next steps in this PR? How can we take this forward?

@Roshrini
Copy link
Member

Roshrini commented Jan 8, 2019

@piiswrong Can you please look into failing CI builds? Thanks

@stu1130
Copy link
Contributor

stu1130 commented Jan 16, 2019

@piiswrong could you please rebase the PR thanks!

@sandeep-krishnamurthy sandeep-krishnamurthy added the pr-work-in-progress PR is still work in progress label Jan 25, 2019
@sandeep-krishnamurthy
Copy link
Contributor

@zheng-da @pengzhao-intel - Any suggestions on next step with this optimization? How can we take this forward?

@pengzhao-intel
Copy link
Contributor

@sandeep-krishnamurthy This PR is not related to CPU backend now.
Feel free to ping us if anything needs our help. Thanks a lot.

@pinaraws
Copy link

@mxnet-label-bot remove[pr-work-in-progress]

@marcoabreu marcoabreu removed the pr-work-in-progress PR is still work in progress label Mar 19, 2019
@pinaraws
Copy link

@nswamy @sandeep-krishnamurthy @anirudh2290 - Please consider closing this PR since there is no follow up from the authors since January.

@abhinavs95
Copy link
Contributor

@piiswrong Could you provide an update on the PR? Thanks

@lupesko
Copy link
Contributor

lupesko commented Apr 9, 2019

This PR has been open with no follow up for a long time, more than 6 months now.
I suggest we close it, it can always be re-opened if deem appropriate.
@sandeep-krishnamurthy @nswamy - can you please look into the suggestion?

@sandeep-krishnamurthy
Copy link
Contributor

To make sure we don't lose the work done in the PR, I have linked this PR in the issue about Gluon Memory optimization - #12226

Closing the PR due to inactivity.

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.