GithubHelp home page GithubHelp logo

ml-cifar-10-faster's Introduction

Training cifar-10 in under 11 seconds

We use 8 V100 Nvidia GPUs to train cifar-10 in under 11 seconds using mini-batches of 2048 elements, with 256 elements per GPU. Our code modifies David C. Pages's bag of tricks implementation to take advantage of Nvidia's NCCL through pytorch's distributed training framework.

In our modifications we remove the exponential moving average model and extend the code to use multiple GPUs, but otherwise maintain the rest of the original strategies.

We distribute the computation using data parallelism, that is: we maintain a copy of the full model in each GPU and process a subset of the mini-batch in each. After every backward pass we average the 8 resulting gradient estimates to produce the final gradient estimate. At the start of training we partition the dataset into 8 subsets and assign one subset to each worker. We maintain the same partition for all epochs.

Faster training with larger batches

We execute 50 runs and achieve an accuracy of 94% (or more) in 41 of them, with a maximum training time of 10.31 (seconds) mean training time of 7.81 (seconds), minimum accuracy of 93.74% and median accuracy of 94.19%. A log of the output is available in run_log.txt

Reproducing our results

Hardware

These results were generated on a platform with:

  • 8 NVIDIA Tesla V100-SMX2 GPUs witn 32 GB of memory
  • An Intel(R) Xeon(R) Gold 6148 CPU @ 2.40GHz with 20 cores

Dependencies

We use python 3.6 the remaining dependencies are listed in requirements.txt

To Run

  • Navigate to large_batch_cifar_10_fast
  • execute bash ./train_cifar_parallel.sh the log will be printed onto STDOUT and the file timing_log.tsv will contain the per-epoch accuracies and run-times of the first replica as measured by worker 0

DAWNBench

Note that DAWNBench timings do not include validation time, as in this FAQ, but do include initial preprocessing.

License

This sample code is released under the LICENSE terms.

ml-cifar-10-faster's People

Contributors

santiago-akle 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.