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

[MXNET-696] Fix profiler executer when memonger is used #12152

Merged
merged 1 commit into from
Aug 15, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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