Coder Social home page Coder Social logo

Could you please let me know if only changing the following line is enough to run the code in GPU. Environment.getInstance().setExecutionMode(EXECUTION_MODE.SEQ); to Environment.getInstance().setExecutionMode(EXECUTION_MODE.GPU); about neuralnetworks HOT 4 OPEN

ivan-vasilev avatar ivan-vasilev commented on July 25, 2024 1
Could you please let me know if only changing the following line is enough to run the code in GPU. Environment.getInstance().setExecutionMode(EXECUTION_MODE.SEQ); to Environment.getInstance().setExecutionMode(EXECUTION_MODE.GPU);

from neuralnetworks.

Comments (4)

sudiptap avatar sudiptap commented on July 25, 2024

I have the required environment set up. In fact by just changing that I am not able to cut down the running time of my application. Thank you.

from neuralnetworks.

thesilencelies avatar thesilencelies commented on July 25, 2024

You may not get any runtime improvement even if it does move it to the GPU - it really depends on how big the networks you're working with are...

from neuralnetworks.

joelself avatar joelself commented on July 25, 2024

I've tried GPU, CPU, and SEQ for MINST testLeNetSmall, testSigmoidHiddenBP and XorTest testCNNMLPBP and none of them give a speed-up for GPU. In fact, sometimes CPU is faster, but never GPU. Can anyone give an example of a network that would benefit from being run on the GPU?

from neuralnetworks.

joelself avatar joelself commented on July 25, 2024

I got the GPU run faster, but only by making huge networks that would take forever to complete for example I modified the testLenetSmall function to have this network:

NeuralNetworkImpl nn = NNFactory.convNN(new int[][] { { 28, 28, 1 }, { 5, 5, 120, 1 }, { 2, 2 }, { 5, 5, 120, 1 }, { 2, 2 },  { 3, 3, 120, 1 }, { 2, 2 }, {2048}, {2048}, {10} }, true);

Basically I added a 3rd convolutional net, bumped up the number of filters in in all covnets to 120 (from 20 and 50), quadrupled the neurons in the final hidden layer and added another hidden layer with 2048 neurons. The GPU enabled version runs about 2.4 times faster, but it's still dog slow taking something like 12 - 14 seconds per batch (the batch size is 1) so training the entire dataset of 60000 images would take 8.3 to 9.7 days. So like 10 days per epoch on the GPU. Meanwhile I built a comparable network in Lasagne/Theano and it takes around 420 seconds per epoch on the CPU (in a VM at that) which is about 2000 times faster.

from neuralnetworks.

Related Issues (20)

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.