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

max pool #110

Draft
wants to merge 8 commits into
base: master
Choose a base branch
from
Draft

max pool #110

wants to merge 8 commits into from

Conversation

americast
Copy link
Contributor

@americast americast commented Apr 10, 2018

An implementation of maxpool. Here's a sample benchmarking (CPU v/s GPU): https://gist.github.com/americast/95358d972647adf5c7ebcde7c58db51f

Tests were failing due to getindex is disabled error. I have made a small change in src/indexing.jl as a workaround.

Thanks.

@SimonDanisch
Copy link
Member

Lol, the assertslow is there for a reason, since scalar indexing into a gpuarray is very slow and should not be done!
You can do allowslow(true) to disable that error. Since your benchmarks seem to indicate good speed, I'm guessing the problem happens on the other side of the test code. I'll check.

@americast
Copy link
Contributor Author

Ouch! The benchmarks don't include padding. I should have mentioned that. Sorry, my bad. I'll create a separate benchmark with padding.

src/pool.jl Outdated
@@ -0,0 +1,44 @@
import CUDAnative
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's not needed, right?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

src/pool.jl Outdated
pool = UInt32(pool)
stride = UInt32(stride)
out = similar(b)
out = out[1:(div(Asize[1] - pool, stride) + 1), 1:(div(Asize[2] - pool, stride) + 1), :, :]
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you could just do similar(b, outsize) no?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, I was unaware of this. It should be similar(b, outSize...) perhaps. Also, outSize needs to be determined before similar is called.

@americast
Copy link
Contributor Author

Updated. Thank you @SimonDanisch for PR #111 and commit 1e1104e.
I've updated the benchmarks at https://gist.github.com/americast/95358d972647adf5c7ebcde7c58db51f.

@maleadt maleadt force-pushed the master branch 4 times, most recently from 39e7783 to fef2421 Compare December 11, 2018 15:49
@maleadt maleadt changed the title Max pool WIP: Max pool Feb 23, 2019
@maleadt maleadt marked this pull request as draft May 8, 2020 10:39
@maleadt maleadt changed the title WIP: Max pool max pool May 8, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants