You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mxnet.apache.org by GitBox <gi...@apache.org> on 2018/01/31 20:10:17 UTC

[GitHub] piiswrong closed pull request #8114: fix memcost example

piiswrong closed pull request #8114: fix memcost example
URL: https://github.com/apache/incubator-mxnet/pull/8114
 
 
   

This is a PR merged from a forked repository.
As GitHub hides the original diff on merge, it is displayed below for
the sake of provenance:

As this is a foreign pull request (from a fork), the diff is supplied
below (as it won't show otherwise due to GitHub magic):

diff --git a/example/memcost/Makefile b/example/memcost/Makefile
index 1087c443d5..c7b94a50f1 100644
--- a/example/memcost/Makefile
+++ b/example/memcost/Makefile
@@ -7,7 +7,7 @@ no_optimization:
 
 with_inplace:
 	@echo "Estimating the cost with inplace optimization..."
-	@NNVM_EXEC_ENABLE_INPLACE=true MXNET_EXEC_MATCH_RANGE=0 python inception_memcost.py
+	@NNVM_EXEC_ENABLE_INPLACE=true NNVM_EXEC_MATCH_RANGE=0 python inception_memcost.py
 
 with_sharing:
 	@echo "Estimating the cost with memory sharing ..."
diff --git a/src/executor/inplace_addto_detect_pass.cc b/src/executor/inplace_addto_detect_pass.cc
index 9359d88635..bc4277baa7 100644
--- a/src/executor/inplace_addto_detect_pass.cc
+++ b/src/executor/inplace_addto_detect_pass.cc
@@ -32,6 +32,7 @@ namespace mxnet {
 namespace exec {
 
 Graph DetectInplaceAddTo(Graph g) {
+  size_t enable_inplace = dmlc::GetEnv("NNVM_EXEC_ENABLE_INPLACE", true);
   nnvm::StorageVector storage_id =
       g.MoveCopyAttr<nnvm::StorageVector>("storage_id");
   std::vector<int> storage_inplace_index =
@@ -64,6 +65,7 @@ Graph DetectInplaceAddTo(Graph g) {
     if (inode.inputs[0].node_id >= inode.inputs[1].node_id) continue;
     // TODO(haibin) support inplace addto for Dynamic Storage
     if (storage_id[eid_rhs] == kDynamicStorageID) continue;
+    if (!enable_inplace) continue;
     CHECK_NE(storage_id[eid_rhs], sid);
     storage_id[eid_rhs] = sid;
     addto_entry[eid_rhs] = 1;


 

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services