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

Fix the enzyme default check #511

Merged
merged 3 commits into from
Dec 2, 2021
Merged

Fix the enzyme default check #511

merged 3 commits into from
Dec 2, 2021

Conversation

ChrisRackauckas
Copy link
Member

@ChrisRackauckas ChrisRackauckas commented Dec 2, 2021

using OrdinaryDiffEq, Zygote, DiffEqSensitivity
function fiip(du,u,p,t)
  du[1] = dx = p[1]*u[1] - p[2]*u[1]*u[2]
  du[2] = dy = -p[3]*u[2] + p[4]*u[1]*u[2]
end
p = [1.5,1.0,3.0,1.0]; u0 = [1.0; 1.0]
prob = ODEProblem(fiip,complex(u0),(0.0,10.0),complex(p))

function sum_of_solution(u0, p)
    _prob = remake(prob,u0=u0,p=p)
    real(sum(solve(_prob,Tsit5(),reltol=1e-6,abstol=1e-6,saveat=0.1)))
end

dx = Zygote.gradient(sum_of_solution, complex(u0), complex(p))

now works.

@ChrisRackauckas
Copy link
Member Author

It looks like Zygote on v1.7 is missing derivatives for gemv! coming from some higher level vector math call? @maleadt @DhairyaLGandhi I'm going to merge and ignore this but that's a little odd.

https://buildkite.com/julialang/diffeqsensitivity-dot-jl/builds/510#ac82ea28-d297-45b5-bb5f-01f490e5759d/668-1284

@DhairyaLGandhi
Copy link
Member

Seems to be a matrix-vector-scalar call somewhere in cublas. @maleadt is there a change in the code path for CUDA in 1.7?

@maleadt
Copy link
Contributor

maleadt commented Dec 2, 2021

Nothing comes to mind, no.

@devmotion
Copy link
Member

The seemingly same error showed up also in ApproximateGPs (https://github.com/JuliaGaussianProcesses/ApproximateGPs.jl/runs/4385202539?check_suite_focus=true#step:5:31, the corresponding issue is JuliaGaussianProcesses/ApproximateGPs.jl#82). Since the package and its tutorials don't use CUDA, it seems to be a more general BLAS/Zygote issue.

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.

4 participants