Skip to content
This repository was archived by the owner on Mar 12, 2021. It is now read-only.

Avoid exponential of positive numbers in softplus implementation #518

Merged
merged 3 commits into from
Jan 17, 2020

Conversation

vargonis
Copy link

Just use the standard trick to avoid getting Inf when broadcasting softplus to GPU arrays containing large positive numbers.

@maleadt maleadt requested a review from MikeInnes December 2, 2019 07:39
@maleadt
Copy link
Member

maleadt commented Dec 2, 2019

Maybe add a test to demonstrate the issue?

@vargonis
Copy link
Author

vargonis commented Dec 2, 2019 via email

@JuliaGPU JuliaGPU deleted a comment from vargonis Dec 6, 2019
@maleadt
Copy link
Member

maleadt commented Dec 6, 2019

I mean, to the CuArrays testsuite so that this doesn't regress.

@MikeInnes
Copy link
Collaborator

That and a test to make sure this produces the same results as CPU would be good, but otherwise this looks good to me, thanks @vargonis!

@vargonis
Copy link
Author

vargonis commented Dec 6, 2019 via email

@MikeInnes
Copy link
Collaborator

No worries, take your time and give us a shout if you're stuck.

@vargonis
Copy link
Author

vargonis commented Dec 14, 2019 via email

@maleadt
Copy link
Member

maleadt commented Dec 20, 2019

Down here the batchnorm test does not pass, by the way, but the ones I wrote do. What now?

Are those tests or the failures of it related? If so, I'd fix them here, otherwise create a new PR if you want :-)

bors try

bors bot added a commit that referenced this pull request Dec 20, 2019
@bors
Copy link
Contributor

bors bot commented Dec 20, 2019

try

Build succeeded

@vargonis
Copy link
Author

vargonis commented Dec 20, 2019 via email

@vargonis
Copy link
Author

vargonis commented Dec 20, 2019 via email

@maleadt
Copy link
Member

maleadt commented Jan 17, 2020

Bump. How does this relate to #539?

@vargonis
Copy link
Author

vargonis commented Jan 17, 2020 via email

@maleadt
Copy link
Member

maleadt commented Jan 17, 2020

OK thanks, let's go with this PR then.
bors r+

bors bot added a commit that referenced this pull request Jan 17, 2020
518: Avoid exponential of positive numbers in softplus implementation r=maleadt a=vargonis

Just use the standard trick to avoid getting `Inf` when broadcasting softplus to GPU arrays containing large positive numbers.

Co-authored-by: Rodrigo Vargas <[email protected]>
@bors
Copy link
Contributor

bors bot commented Jan 17, 2020

Build succeeded

@bors bors bot merged commit f4ce643 into JuliaGPU:master Jan 17, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants