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

Gradients of broadcasted exp broken with CuArrays v2.0.1 #567

Closed
aterenin opened this issue Mar 29, 2020 · 7 comments · Fixed by #565
Closed

Gradients of broadcasted exp broken with CuArrays v2.0.1 #567

aterenin opened this issue Mar 29, 2020 · 7 comments · Fixed by #565

Comments

@aterenin
Copy link
Contributor

The following works on CuArrays v1.7 but doesn't work on v2.0.1.

Flux.gradient(x -> sum(exp.(x)), CuArrays.ones(1,1))
┌ Warning: calls to Base intrinsics might be GPU incompatible
│   exception =
│    You called exp(x::T) where T<:Union{Float32, Float64} in Base.Math at special/exp.jl:75, maybe you intended to call exp(x::Float64) in CUDAnative at /vol/bitbucket/at6617/dot_julia/packages/CUDAnative/cnQli/src/device/cuda/math.jl:100 instead?
│    Stacktrace:
│     [1] exp at special/exp.jl:75
│     [2] #28 at /vol/bitbucket/at6617/dot_julia/packages/GPUArrays/QDGmr/src/host/broadcast.jl:64
└ @ CUDAnative /vol/bitbucket/at6617/dot_julia/packages/CUDAnative/cnQli/src/compiler/irgen.jl:266
@DhairyaLGandhi
Copy link
Member

Good to add to tests and see what is happening

@DhairyaLGandhi
Copy link
Member

Ref FluxML/Flux.jl#1103

@matsueushi
Copy link
Contributor

Is it just a warning, or indeed an error? cf. JuliaGPU/CuArrays.jl#615 (comment)

@aterenin
Copy link
Contributor Author

Error with a very large stack trace directly afterwards. I can post it later, once I re-upgrade CuArrays on the GPU box again.

@ararslan
Copy link
Contributor

Can you try with #565?

@ararslan
Copy link
Contributor

This works for me with #565.

@aterenin
Copy link
Contributor Author

Works for me on [e88e6eb3] Zygote v0.4.12 #04ace9 (https://github.com/FluxML/Zygote.jl.git).

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 a pull request may close this issue.

4 participants