Code Monkey home page Code Monkey logo

Comments (8)

soumith avatar soumith commented on July 17, 2024

This is expected. Its Extremely hard to write a max pooling kernel that is deterministic when kW > dW or kH > dH. cunn, cudnn, caffe, all of these are non-deterministic maxpoolings for that case.

when kW <= dW, the kernel can be made deterministic with some effort (I think it is deterministic, but I haven't verified).
The atomic adds were done at some point for just handling the case of kW != dW, for correctness, and they are needed. Otherwise two threads might race.

from cunn.

mys007 avatar mys007 commented on July 17, 2024

Looking at the code in Caffe (https://github.com/BVLC/caffe/blob/master/src/caffe/layers/pooling_layer.cu), I believe their backward passes are deterministic: for each bottom element, all possible top elements that could contribute to it are scanned in a single thread, the summing order thus being deterministic. As another benefit, they don't need atomics.

from cunn.

mys007 avatar mys007 commented on July 17, 2024

So after empirical testing, I can say that all other implementations (caffe, cudnn V2, convnet2) behave deterministically. Therefore, I would like to reopen the issue. If this is not going to be fixed, it should be at least documented, similarly to the "Reproducibility" chapter in cudnn user guide. It would be also interesting to document how the convolution modules behave.

from cunn.

soumith avatar soumith commented on July 17, 2024

@wickedfoo investigated this, and this is not what he found. He found that cudnn's max pooling is clearly non-deterministic. @wickedfoo comments?

from cunn.

mys007 avatar mys007 commented on July 17, 2024

The behavior of cudnn's maxpool seems to have changed: while experimentally non-deterministic in V2R2, it appears to be ok in V2.

from cunn.

soumith avatar soumith commented on July 17, 2024

oh I see. Good to know that. The last investigation was indeed probably done in V1 or V2Rxx

from cunn.

mys007 avatar mys007 commented on July 17, 2024

I don't put my hand in fire for that, though:).
UPDATE: Actually, now I believe that cudnn.SpatialMaxPooling is not deterministic in V2 either. Sorry for confusion. But Caffe's maxpooling definitely is.

from cunn.

fmassa avatar fmassa commented on July 17, 2024

I think this has been addressed in dc77610

from cunn.

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.