You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mxnet.apache.org by GitBox <gi...@apache.org> on 2019/11/01 08:45:30 UTC

[GitHub] [incubator-mxnet] joapolarbear opened a new pull request #16700: [Profiler] Make the trace name unique

joapolarbear opened a new pull request #16700: [Profiler] Make the trace name unique
URL: https://github.com/apache/incubator-mxnet/pull/16700
 
 
   ## Description ##
   Current trace names are not unique, for example, if a model consists of two `Conv2d` layers, the corresponding trace names are the same, something like `Convolution`. In order to make each layer in trace results hold a unique name, the following changes have been made:
   
   ### Changes ###
   - [x]  For Module API, update `src/executor/graph_executor.cc`, substitute `inode.source->op()->name` with `opr_names += inode.source->attrs.name `.
   - [x] For Gluon API
   ** Update `src/engine/threaded_engine.cc`, allow profiler mode to be `kSymbolic`.
   ** Update `src/imperative/imperative_utils.h`, use `attrs.name` to substitute `op->name`. To maintain the lifecycle of `attrs.name`, use a global variable (type unordered_set string) to store it. To force profile the input and output op, assign priority 1 to the first and last node when calling PushSync, if `attrs.name` is not empty.
   
   An example of the test results is shown below:
   ```
   {
       "name": "hybridsequential0_conv0_fwd",
       "cat": "operator",
       "ph": "B",
       "ts": 1572512095582317,
       "pid": 64,
       "tid": 1623894732768404781
    }
   ...
   {
       "name": "hybridsequential0_conv1_fwd",
       "cat": "operator",
        "ph": "E",
       "ts": 1572512095582642,
       "pid": 64,
       "tid": 1623894732768404781
   }
   ```
   Now, `conv` layers is identified with an index, which make them unique in a single step.
   
   ## Checklist ##
   ### Essentials ###
   - [x] Changes are complete (i.e. I finished coding on this PR)
   - [x] To my best knowledge, examples are either not affected by this change, or have been fixed to be compatible with this change
   

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services