Giter Club home page Giter Club logo

chainer_computational_cost's People

Contributors

belltailjp avatar hitsgub avatar rezoo avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

chainer_computational_cost's Issues

[idea] Theoretical speed estimation

As we not have a theoretical computational cost, if we have a theoretical specification of a device, we can estimate theoretical (upper-bound) of inference speed on the device.
It'd be nice if chainer_computational_cost can have a feature to receive a hardware profile and calculate layer-wise and total theoretical speed.

Problems

  • Interface design
    • Embed inference time inside layer report?
      • Pros: implementation is the simplest
      • Cons: Need to specify only one hardware profile to Hook instance.
  • Layer-specific accelerator
    • NVIDIA Volta has TensorCore, in V100 case convolution operation is 125TFLOPs, although other general arithmetics are 15TFLOPs.
    • If we use only one value as the hardware's theoretical performance, the estimated inference time is totally useless.

Memory consumption estimation

In addition to memory transfer amount, estimating the total memory consumption would be nice.

Basic idea

  • Simplest way: just sums up size of parameters and outputs of all layers
    • This would be an upper bound estimation
    • From hook, it's generally not easy to know what is parameter and what is input
      • Use LinkHook?
  • How to deal with forgetting?
    • An output tensor can be erased if it is no longer used after a certain timing
    • In CNN memory consumption, this is a dominant part
    • So it needs tensor lifetime estimation
      • It is impossible until the entire NN process finishes, so Hook cannot simply solve this.
        • inputs can be obtained through func of a hook method, so the computational graph until right before the last layer can be reconstructed. Once a graph structure is completely known, theoretical memory life-time can be estimated.
          • There's a problem where Variable losts creator information, e.g. cond of `Where
      • Cumulate the total amount of chainer.Variables made during the hook lifetime, and subtract those who are forgotten, would this work?
        • Unable to get peak. Also it depends on how chainer's aggressive buffer release is implemented, which is not good.
  • Returned value
    • Lower-bound: tensor-lifetime optimized memory consumption
    • Upper-bound: Just summing up everything

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.