GithubHelp home page GithubHelp logo

ekloberdanz / distributed-neural-net Goto Github PK

View Code? Open in Web Editor NEW
1.0 2.0 0.0 34.56 MB

Distributed Neural Network Training with MPI using data parallelism and parallel synchronous stochastic gradient descent

License: MIT License

Makefile 1.34% C++ 96.47% Python 2.19%
mpi neural-network

distributed-neural-net's Introduction

Distributed Neural Network Training with MPI

In this project I implement a parallel neural network in C++ leveraging Eigen for linear algebra operations, and MPI for data parallelism to reduce training time via distributed learning by spreading the training data across multiple processors.

The neural network I implemented contains two dense layers, a non-linear ReLU activation function, a softmax activation function, and is optimized via categorical cross entropy loss and stochastic gradient descent. The training data is divided into partitions equal to the total number of MPI processes p - 1, which are used as worker nodes. The neural network model itself is replicated in each of these worker nodes. Therefore, each worker has a copy of the neural network and operates only on a subset of the training data. One of the processors in the cluster stores the global model parameters, and acts as a parameter server that synchronizes and processes updates to the model parameters using the gradients calculated by the worker nodes. The optimization algorithm used in this project to find the neural network parameters (i.e.: the weights and biases) is Stochastic Gradient Descent (SGD), which is the most commonly used algorithm for performing parameter updates in neural networks. The traditional definition of SGD is inherently serial, which is why I use a parallel version of SGD in this project. There are two parameter update paradigms in parallel SGD: synchronous and asynchronous. In case of synchronous parameter update the parameter server waits to receive computed gradients from all worker nodes to update the global model parameters, which are then broadcasted to all worker nodes to be utilized in the next training iteration. On the other hand, asynchronous updates are processed by the 1parameter server immediately without waiting to receive gradients from all worker nodes for the current training iteration. In this project I implement the synchronous version of SGD. A serial implementation of the neural network is used as a benchmark to assess the speed up from distributed training achieved via data parallelism with MPI and also scalability.

distributed-neural-net's People

Contributors

ekloberdanz avatar

Stargazers

Druvika Nuthalapati avatar

Watchers

James Cloos avatar  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.