You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mxnet.apache.org by sk...@apache.org on 2018/08/15 20:24:23 UTC

[incubator-mxnet] branch master updated: Fix profiler executer when memonger is used (#12152)

This is an automated email from the ASF dual-hosted git repository.

skm pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-mxnet.git


The following commit(s) were added to refs/heads/master by this push:
     new 8f61777  Fix profiler executer when memonger is used (#12152)
8f61777 is described below

commit 8f61777ab241868195e188269f42d855d97a692b
Author: Vandana Kannan <va...@users.noreply.github.com>
AuthorDate: Wed Aug 15 13:24:16 2018 -0700

    Fix profiler executer when memonger is used (#12152)
---
 example/profiler/README.md            | 10 +++++++---
 example/profiler/profiler_executor.py |  4 +++-
 2 files changed, 10 insertions(+), 4 deletions(-)

diff --git a/example/profiler/README.md b/example/profiler/README.md
index 7d3c42b..1b9279c 100644
--- a/example/profiler/README.md
+++ b/example/profiler/README.md
@@ -5,8 +5,12 @@ Please refer to [this link](http://mxnet.incubator.apache.org/faq/perf.html?high
 for visualizing profiling results and make sure that you have installed a version of MXNet compiled
 with `USE_PROFILER=1`.
 
-- profiler_executor.py. To run this example, simply type `python profiler_executor.py` in terminal.
-It will generate a json file named `profile_executor_5iter.json`.
+- profiler_executor.py. To run this example,
+    - clone mxnet-memonger (git clone https://github.com/dmlc/mxnet-memonger.git).
+    - Add mxnet-memonger folder to PYTHONPATH.
+    export PYTHONPATH=$PYTHONPATH:/path/to/mxnet-memonger
+    - type python profiler_executor.py in terminal.
+    It will generate a json file named `profile_executor_5iter.json`.
 
 - profiler_imageiter.py. You first need to create a file named `test.rec`,
 which is an image dataset file before running this example.
@@ -20,4 +24,4 @@ that you have installed a GPU enabled version of MXNet before running this examp
 `python profiler_matmul.py` and it will generate `profile_matmul_20iter.json`.
 
 - profiler_ndarray.py. This examples profiles a series of `NDArray` operations. Simply type
-`python profiler_ndarray.py` in terminal and it will generate `profile_ndarray.json`.
\ No newline at end of file
+`python profiler_ndarray.py` in terminal and it will generate `profile_ndarray.json`.
diff --git a/example/profiler/profiler_executor.py b/example/profiler/profiler_executor.py
index 8ab417a..9153253 100644
--- a/example/profiler/profiler_executor.py
+++ b/example/profiler/profiler_executor.py
@@ -21,6 +21,7 @@ import os
 import time
 import numpy as np
 from mxnet import profiler
+import memonger
 
 
 def parse_args():
@@ -86,7 +87,8 @@ def get_symbol():
 
 def get_module(ctx, sym, provide_data, provide_label, batch_size=None, is_train=True, use_memonger=False):
     if use_memonger:
-        sym = search_plan(sym, data=data_shapes)
+        name, data_shapes = provide_data[0]
+        sym = memonger.search_plan(sym, data=data_shapes)
     mod = mx.mod.Module(symbol=sym,
                         data_names=[name for name, _ in provide_data],
                         label_names=[name for name, _ in provide_label],