Giter VIP home page Giter VIP logo

Comments (1)

nvanva avatar nvanva commented on June 12, 2024 1

Recently I have managed to make it work on GPU. Though it was not easy...
Basically, you shall install DyNet with GPU support. Then run your script with --dynet-gpu option which tells DyNet to run calculations on GPU (as described in https://dynet.readthedocs.io/en/latest/python.html#installing-a-cutting-edge-and-or-gpu-version).

Now, step-by-step instructions:

  1. Install DyNet with GPU support. This was the most difficult part. To achieve this, I had to install old CUDA 10.0, old gcc 7.3 and run:
    CUDNN_ROOT=/path/to/cudnn BACKEND=cuda pip install git+https://github.com/clab/dynet#egg=dynet

  2. Add --dynet-gpu flag to the command line arguments of OptionParser, otherwise OptionParser will report unsupported argument and exit.
    For instance, I've added to sesame/targetid.py the following line:
    optpr.add_option("--config", type="str", metavar="FILE")
    +optpr.add_option("--dynet-gpu")

  3. Finally, I had an error telling me that log_softmax operation does not have GPU implementation in DyNet. So had to move it to the CPU:

  •    score_i = dy.to_device(score_i, 'CPU')
       logloss = log_softmax(score_i, [0, 1])
    

After these steps training started utilizing GPU. But... seems it became even slower than on CPU. Probably, need some code optimization to improve performance on GPU :((

from open-sesame.

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.