Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SpatialMaxPooling failure case #53

Closed
soumith opened this issue Dec 7, 2014 · 6 comments
Closed

SpatialMaxPooling failure case #53

soumith opened this issue Dec 7, 2014 · 6 comments
Labels

Comments

@soumith
Copy link
Member

soumith commented Dec 7, 2014

Fails for the case:

m=nn.SpatialMaxPooling(2,2,2,2):cuda()
input=torch.randn(128,1024,12,12):cuda()
m:forward(input)
error in SpatialMaxsampling.updateOutput: invalid argument
luajit: ...ch-distro/install/share/lua/5.1/nn/SpatialMaxPooling.lua:18: aborting
@soumith
Copy link
Member Author

soumith commented Dec 7, 2014

this is a case that comes in Overfeat (fast) type network.

@soumith soumith added the bug label Dec 7, 2014
@soumith
Copy link
Member Author

soumith commented Dec 7, 2014

looks like this line is the culprit:
https://github.com/torch/cunn/blob/master/SpatialMaxPooling.cu#L242

I ran on a 3.5 capable card (titan black), but it still refuses to run. The x-dim of the blocks in this case becomes: 131072.
From this page:
http://en.wikipedia.org/wiki/CUDA#Version_features_and_specifications
xdim for 3.0+ can be upto 2^31 -1.
Anyways, cudnn doesn't have this bug, i am unlikely to even look into fixing this.

@jonathantompson
Copy link
Contributor

Nice catch.

@soumith
Copy link
Member Author

soumith commented Apr 15, 2015

The reason here is that cunn is complied with 2.0 compability:

https://github.com/torch/cunn/blob/master/CMakeLists.txt#L19

If I switch that to 35, no problems

@russellfei
Copy link

@soumith Same catch here.

a = torch.rand(64,1024,12,12):cuda()
b = nn.SpatialMaxPooling(2,2,2,2):cuda():forward(a)
-- or -- 
b = nn.SpatialAdaptiveMaxPooling(8,8):cuda():forward(a)

gives the invalid argument error.
Maybe I should switch that arch to 35.
Thanks for instructions above.

--- updates
It works!

@bamos
Copy link

bamos commented Jul 29, 2015

Hi, I have the same issue with SpatialAveragePooling and changing the arch to 35 in CMakeLists fixes the problem.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants