Git Product home page Git Product logo

dist_mnistdemo's Introduction

Distributed TF learning

Description

This is a simple example of utilizing distributed training with Tensorflow. tf.distribute.experimental.MultiWorkerMirroredStrategy is used for synchronous training among all workers, and the connection among the workers is established via gRPC with tf.distribute.experimental.CollectiveCommunication.RING. Number of workers is preset to 3 for demonstration simplicity. Dataset sharding is automatically handled by the distribute API.

Since the training and distribution is handled within docker containers for each worker, a bridge network is required. After build.sh generates the docker container, it creates the shared network bridge - sk_tfdistnetwork.

Each container are given unique names (worker0,...) by run.sh, so that it is exposed to other containers. TF_CONFIG environment variables for each container are set correspondingly.

Usage

git clone https://github.com/skmono/dist_mnistdemo.git
cd dist_mnistdemo
./build.sh

This builds and docker image and generates the network bridge.

Note: If sudo is required to run docker commands, run the scripts (build.sh and run.sh with sudo privileges.)

To test the distributed training, run the first worker with

./run.sh 0

and other workers in different terminals (2 more required) with

./run.sh 1
./run.sh 2

The designated names will be removed after training is complete.

dist_mnistdemo's People

Watchers

 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.