Comments (8)
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.
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.
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.
@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.
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.
oh I see. Good to know that. The last investigation was indeed probably done in V1 or V2Rxx
from cunn.
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.
I think this has been addressed in dc77610
from cunn.
Related Issues (20)
- CPU and GPU gave different results HOT 1
- use memory of GPU for a process HOT 3
- Jetson Tx2 compile error HOT 3
- wrong number of arguments for function call with ClassNLLCriterion HOT 5
- Utilizing multiple gpus with different memory to full use
- PReLU tests from test.lua give error
- CUDA fails after installation HOT 1
- Model faster in GeForce GTX 1060 6 GB compared to Google cloud K80 12 GB, missing something?
- THREAD PANIC and Segmentation fault when passing data parallelized model between threads
- Strange issue with DataParallelTable on 1080 Ti HOT 1
- How to implement own c/cuda module in cunn and nn?
- Inconsistence in SpatialMaxPooling and SpatialMaxUnpooling operations for torch.CudaTensor that leads to an error
- error: identifier "WARP_SHFL_XOR" is undefined
- Bug: spatialdepthwiseconvolution has memory leak problem HOT 2
- How to resume training from a certain epoch or how to update an already trained model in torch ?
- /torch/install/share/lua/5.1/cunn/THCUNN.lua:119: table index is nil issue HOT 1
- Fails to build against CUDA9 HOT 1
- CMake Error at THCUNN_generated_LookupTable.cu.o.cmake:267 (message):
- I got this to compile on Ubuntu 20.04 HOT 1
- Problems while Compiling with CUDA11, Ubuntu 20.04 HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from cunn.