-
Notifications
You must be signed in to change notification settings - Fork 57
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
Segmentation fault (earlier TypeInference failure) with ValueShapes.jl #303
Comments
Can you post the full trace to Gist or something similar? |
And give current main a try |
Looks the same with main, here's the gist: https://gist.github.com/oschulz/94c37f22e1c7afe766f223737196d513 |
|
This now gives a julia-level error, but is the same error needing fixing. |
@vchuravy interestingly this now segfaults. |
|
Thanks for looking into this! |
Reducing: using Enzyme
Enzyme.API.printall!(true)
@noinline function myunaliascopy(V::SubArray{T,N,A,I,LD}) where {T,N,A<:Array,I<:Tuple{Vararg{Union{Real,AbstractRange,Array}}},LD}
dest = Array{T}(undef, Base.index_lengths(V.indices...))
Base.copyto!(dest, V)
SubArray{T,N,A,I,LD}(dest, map(Base._trimmedindex, V.indices), 0, Int(LD))
end
function diffeq_step!(u)
x = @inbounds @view u[1:2]
x′ = Base.unaliascopy(x)
@inbounds Base.setindex!(u, x′[1], 1)
nothing
end
u = rand(2)
diffeq_step!(u)
@show "primal"
Enzyme.autodiff(diffeq_step!, u)
@show "grad" |
This seems to be fixed by EnzymeAD/Enzyme#959 which will require a jll bump to be available here. |
Thanks Will! |
This crashes Enzyme:
with
shaped_u.x
andshaped_du.x
just produce reshaped array views, so there shouldn't be any AD-unfriendly stuff in the code (well, in principle ... :-) ).System info:
The text was updated successfully, but these errors were encountered: