Coder Social home page Coder Social logo

mrry / ngraph Goto Github PK

View Code? Open in Web Editor NEW

This project forked from nervanasystems/ngraph-python

0.0 1.0 0.0 10.23 MB

Technical Preview of Intel® Nervana™ Graph

Home Page: http://ngraph.nervanasys.com/docs/latest/

License: Apache License 2.0

Makefile 0.14% Python 38.00% Perl 5.05% CSS 56.80%

ngraph's Introduction

Nervana Graph

Nervana graph is Nervana's library for developing frameworks that can efficiently run deep learning computations on a variety of compute platforms. it consists of three primary API components:

  • An API for creating computational Nervana Graphs.
  • Two higher level frontend APIs (TensorFlow and Neon) utilizing the Nervana Graph API for common deep learning workflows
  • A transformer API for compiling these graphs and executing them.

For more information, please see the blog post announcing our preview release!

Installation

Installation documentation can be found here. First ensure you have neon checked out and built.

To install Nervana Graph into your neon virtual env:

cd neon
make PY=2 # or "make PY=3" to instead build a Python 3 virtual environment.
. .venv/bin/activate
cd ../ngraph/
make install

To uninstall Nervana Graph from your virtual env:

make uninstall

To run the unit tests:

make test

Before checking in code, ensure no "make style" errors:

make style

To fix style errors:

make fixstyle

To generate the documentation as html files:

make doc

Examples

  • ngraph/examples/walk_through/ contains several code walk throughs.
  • ngraph/examples/mnist/mnist_mlp.py uses the neon front-end to define and train a MLP model on MNIST data.
  • ngraph/examples/cifar10/cifar10_conv.py uses the neon front-end to define and train a CNN model on CIFAR10 data.
  • ngraph/examples/cifar10/cifar10_mlp.py uses the neon front-end to define and train a MLP model on CIFAR10 data.
  • ngraph/examples/ptb/char_rnn.py uses the neon front-end to define and train a character-level RNN model on Penn Treebank data.

Overview

Frontends

  • The neon frontend offers an improved interface for increased composability/flexibility while leaving common use cases easy. We demonstrate this with MLP, convolutional, and RNN network examples on MNIST, CIFAR10, and Penn Treebank datasets.
  • The tensorflow importer allows users to import existing tensorflow graphs and execute them using Nervana Graph transformers/runtimes. This importer currently only supports a subset of the tensorflow API, but this will be expanded over time.

Nervana Graph API

  • The Nervana Graph API consists of a collection of graph building functions all exposed in the ngraph module/namespace. (eg: ngraph.sum(...))
  • We include walkthrough examples to use this API for logistic regression and multilayer perceptron classification of MNIST digit images.
  • With the introduction of named Axes we lay the foundation for frontend writers to reason about tensor axis without concern of memory layout or order (for future optimization against hardware targets which often have differing and specific requirements for batch axis orderings for example).

Transformer API

  • This release ships with two example transformers targetting CPU and GPU hardware targets.
  • Both transformers support memory usage optimization passes.
  • The GPU transformer also includes preliminary support for automatic kernel fusion/compounding for increased performance.
  • Transformers allow users to register an included set of optional compiler passes for debug and visualization.
  • The compiler pass infrastructure is slated to offer frontends/users similar flexibility to what LLVM library offers for general purpose compilation.

Known Issues

These are known issues which are being addressed:

  • The transformer fusion and memory sharing optimizations are currently hampered by some of the tensor dimension reshaping introduced by the existing lowering passes. Thus both are turned off by default.
  • Nervana Graph still requires a neon installation as a dependency.
  • RNNs don't work well with longer sequences (longer than 30).

Highlighted Future Work

  • Nervana Graph serialization/deserialization.
  • Further improvements/abstractions to graph composability for usability/optimization.
  • Distributed, heterogeneous backend target support.
  • C APIs for interoperability to enable other languages to create/execute graphs.
  • Better debugging
  • Support for model deployment

Join Us

Please feel free to contribute in shaping the future of Nervana Graph.

ngraph's People

Contributors

anlthms avatar apark263 avatar binarybana avatar diyessi avatar ljk628 avatar nbpatel avatar ptillet avatar ruby-nervana avatar varun-nervanasys avatar yasharnervana avatar yxlao avatar zach-nervana avatar

Watchers

 avatar

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.