Code Monkey home page Code Monkey logo

Comments (5)

fchollet avatar fchollet commented on June 1, 2024

Right now you're basically not supposed to pass use_cudnn in the general case -- just pass nothing, and cuDNN will be used if it's feasible.

Passing use_cudnn=True is something you'd only do if you want to error out when cuDNN isn't available, as opposed to falling back to a non-cuDNN implementation.

I propose to alleviate this we always provide a reason why cudnn was not used.

Definitely, this is a good call. There are multiple user-facing factors at play, like recurrent dropout, masking (which will actually give you a targeted error message), activations, etc. And of course availability of cuDNN in your environment.

from keras.

LukeWood avatar LukeWood commented on June 1, 2024

Right now you're basically not supposed to pass use_cudnn in the general case -- just pass nothing, and cuDNN will be used if it's feasible.

I guess what I'd be hoping to gain from an additional API here would be to express in code:

"I want to make sure that my Keras code is not the reason that we aren't using cudnn.
 If the backend/environment doesnt support it, that is alright - 
but I want to make sure I do not accidentally have the flags misconfigured"

though, perhaps just improving the error messages is sufficient

from keras.

hertschuh avatar hertschuh commented on June 1, 2024

Hey @LukeWood ,

I want to make sure that my Keras code is not the reason that we aren't using cudnn

That's how I look at the use_cudnn argument. It really means "fail if you can't use cudnn".

though, perhaps just improving the error messages is sufficient

I think that's the right call. Are you willing to contribute on this?

from keras.

LukeWood avatar LukeWood commented on June 1, 2024

yes happy to contribute!

It really means "fail if you can't use cudnn".

I think the key difference is that to me there are actually two intentions users may want to express. One is "fail if you can't use cudnn, regardless of cause" - one is "fail if I can't use cudnn, due to my own configuration of the RNN layer". I think they're nuancedly different, but that the difference is actually meaningful. Perhaps what I mean here would be clarified via code, but I think there is a meaningful difference between these two intentions.


Regardless, happy to contribute error message improvements.

from keras.

fchollet avatar fchollet commented on June 1, 2024

Regardless, happy to contribute error message improvements.

Sure, please open a PR if you're able. We probably need to make two backend functions, is_config_cudnn_compatible and is_cudnn_available -- or maybe pass appropriate info in the NotImplementedError exception message.

from keras.

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.