GithubHelp home page GithubHelp logo

--cnn-mem How to do this? about dynet HOT 7 CLOSED

berzentine avatar berzentine commented on June 15, 2024
--cnn-mem How to do this?

from dynet.

Comments (7)

neubig avatar neubig commented on June 15, 2024

When you have a program compiled with cnn, and assuming that you call cnn's Initialize() function using the command line arguments passed in to the program, it's as simple as adding:
$ my_program --cnn-mem 1024 [other options]
to your command line arguments. Note that the cnn arguments must come before any other arguments.

These command line arguments should be documented, so I'll leave this issue open and add this to the documentation when I have a chance.

from dynet.

yoavg avatar yoavg commented on June 15, 2024

A small addition to this: we observe that setting --cnn-mem to values above 2010 or so always fail. Probably relates to some limits on contiguous memory allocation.

from dynet.

Oneplus avatar Oneplus commented on June 15, 2024

@yoavg @neubig it seems the current master has an integer overflow problem on the devices.cc when allocating memory. See this bug fixed in v2 (https://github.com/clab/cnn/blob/v2/cnn/devices.cc#L63) but not sure when will it be merged into master.

from dynet.

yoavg avatar yoavg commented on June 15, 2024

Thanks! is v2 operational already?

from dynet.

neubig avatar neubig commented on June 15, 2024

Yes, it's basically operational. I've switched my experiments over to v2. There are still a few things that need to be done, but I think we'll be merging it into master sooner rather than later.

from dynet.

neubig avatar neubig commented on June 15, 2024

Information about command line options has been added to README.md (in the v2 branch)

from dynet.

esalesky avatar esalesky commented on June 15, 2024

It seems to be the case that the order of the cnn args also matters. I'm using v2 and seeing that the --cnn-mem arg is ignored unless preceded by cnn-gpus or cnn-gpu-ids (will use 512 default) and those two args will fail if they follow cnn-mem. Can see with the xor example:

./examples/xor --cnn-mem 1024
[cnn] allocating memory: 512MB

./examples/xor --cnn-mem 1024 --cnn-gpu-ids 3
[cnn] Device(s) selected: 2
[cnn] Bad command line argument: --cnn-gpu-ids
Aborted (core dumped)

./examples/xor --cnn-gpu-ids 3 --cnn-mem 1024
[cnn] allocating memory: 1024MB

./examples/xor --cnn-gpus 1 --cnn-mem 1024
[cnn] allocating memory: 1024MB

from dynet.

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.