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

Commit

Permalink
Fix profiler executer when memonger is used
Browse files Browse the repository at this point in the history
  • Loading branch information
vandanavk committed Aug 14, 2018
1 parent 525ead9 commit 4440cd3
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 4 deletions.
10 changes: 7 additions & 3 deletions example/profiler/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand All @@ -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`.
`python profiler_ndarray.py` in terminal and it will generate `profile_ndarray.json`.
4 changes: 3 additions & 1 deletion example/profiler/profiler_executor.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
import time
import numpy as np
from mxnet import profiler
import memonger


def parse_args():
Expand Down Expand Up @@ -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],
Expand Down

0 comments on commit 4440cd3

Please sign in to comment.