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

Work around GPU launch bug for BatchNorm #555

Closed
wants to merge 1 commit into from

Conversation

staticfloat
Copy link
Contributor

X-ref: #385

@MikeInnes
Copy link
Member

Julia's escape analysis can make for some fun gpu debugging.

Do we have a test that catches this?

@staticfloat
Copy link
Contributor Author

staticfloat commented Jan 11, 2019

Yes; here you go:

using CuArrays, Flux

# Bogus initializations
μ = gpu(randn(Float32, 1, 1, 8, 1))
σ = μ

# It's important that these are tracked; it doesn't fail otherwise
β = param(μ)
γ = param(μ)

# Random input
x = gpu(randn(Float32, 10, 10, 8, 1))

# If any part of this computation is taken out or refactored, it does not error.
γ .* ((x .- μ) ./ σ) .+ β

@MikeInnes
Copy link
Member

Actually, I guess this is not escape analysis but some failure of broadcast compilation when it gets this complex.

That's useful but also, does this issue get caught by the flux gpu tests now? If not we should just add something that calls batchnorm.

@KristofferC
Copy link
Contributor

This content of this PR is in #586, can be closed.

@staticfloat staticfloat closed this Feb 8, 2019
@staticfloat
Copy link
Contributor Author

Great, thanks @KristofferC!

@CarloLucibello CarloLucibello deleted the sf/gpu_batchnorm branch April 7, 2022 07:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants