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 13, 2018
1 parent a6ecb59 commit bd11509
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
6 changes: 4 additions & 2 deletions example/profiler/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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`,
Expand All @@ -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`.
`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 bd11509

Please sign in to comment.