Code Monkey home page Code Monkey logo

dnnemu's Introduction

Layer-Wise Profiler

This repository is the implementation of our layer-wise profiler. Other code about emulation will be publicly available soon.

Running

Our layer-wise profiler is based on MXNet 1.4.1. You should download MXNet source code and apply the patch(0001-layer-wise-profiler.patch) in this repository to the MXNet source code.

  1. Download the MXNet source.
    git clone https://github.com/apache/incubator-mxnet.git
  2. apply the patch file the MXNet source code.
    cd incubator-mxnet
    git checkout 1.4.1
    git apply 0001-layer-wise-profiler.patch
  3. build and install MXNet follow the Building From Source guide.

Approach

approach

As illustrated in Algorithm 1, our layer-wise profiler uses the operator name (op:name) and layer name (layer id) to record the operator execution. The operator name (e.g., Convolution, Pooling, and FullyConnected) is usually registered with NNVM. One of the biggest improvements brought by NNVM is the operator attribute system, and we can register attributes with any key (e.g., layer name) to any operators. In line 9, the operator attribute system uses attrs:name to store layer name and operator name together. With this feature, we can profile the same operators but in different layers.

Usage

profiler profiler2

Our layer-wise profiler requires no changes to the users' code. You should enable profiler follow the Profiling Guide

  1. View in console
    profiler.set_state('run')
    profiler.set_state('stop')
    print(profiler.dumps())
    print
  2. View in browser
    profiler.dump(finished=False)
    tracing

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.