From bd11509f9076055cd6f2c8843fba66e31fc687e8 Mon Sep 17 00:00:00 2001 From: vandanavk Date: Thu, 9 Aug 2018 12:59:38 -0700 Subject: [PATCH] Fix profiler executer when memonger is used --- example/profiler/README.md | 6 ++++-- example/profiler/profiler_executor.py | 4 +++- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/example/profiler/README.md b/example/profiler/README.md index 7d3c42b629d9..ebac326865f4 100644 --- a/example/profiler/README.md +++ b/example/profiler/README.md @@ -5,7 +5,9 @@ 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. +- profiler_executor.py. To run this example, +1. clone mxnet-memonger (git clone https://github.com/dmlc/mxnet-memonger.git). Add path to mxnet-memonger to PYTHONPATH +2. 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`, @@ -20,4 +22,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 8ab417a97442..91532535bd05 100644 --- a/example/profiler/profiler_executor.py +++ b/example/profiler/profiler_executor.py @@ -21,6 +21,7 @@ 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],