Giter Site home page Giter Site logo

qinchun / cpu-vs-gpu-benchmark-on-mnist Goto Github PK

View Code? Open in Web Editor NEW

This project forked from moritzhambach/cpu-vs-gpu-benchmark-on-mnist

0.0 0.0 0.0 39 KB

compare training duration of CNN with CPU (i7 8550U) vs GPU (mx150) with CUDA depending on batch size

Jupyter Notebook 100.00%

cpu-vs-gpu-benchmark-on-mnist's Introduction

CPU-vs-GPU-benchmark-on-MNIST

System: i7 8550U (4 cores), 16 GB ram, Geforce MX150 (2GB), windows 10 using CUDA toolkit 8.0.16, CuDNN 8.0, python 3.5, keras 2.1.2 with tensorflow 1.4.0, visual studio 2015. The CUDA installation is easiest done by following the instructions in link .

Training of neural networks can be accelerated by using the parallelism of calculations on GPUs. But by how much, for a typical small convolutional neural network (4 convolutional layers, one fully connected layer)? Let's find out! Here I compare training duration of a CNN with CPU or GPU for different batch sizes (see ipython notebook in this repo). The GPU load is monitored in an independent program (GPU-Z).

Here's the result:

alt text

We can see that the GPU calculations with Cuda/CuDNN run faster by a factor of 4-6 depending on the batch sizes (bigger is faster).

Edit: I tried training the same notebook on a Tesla K80 in the cloud, which can be accessed for free (!!!) via google colab (https://colab.research.google.com/notebooks/welcome.ipynb). The setup is quick and easy, tensorflow is already installed etc. The training ran another factor of 2 faster than my local GPU, and avoid driving my poor laptop so hard, so I'll probably switch to that. Thanks google!

cpu-vs-gpu-benchmark-on-mnist's People

Contributors

moritzhambach 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.