Closed dlfivefifty closed 3 years ago
Is this calling into OpenBLAS?
Shouldn't be: it's not doing anything other than calling getindex
Can you attach the entire log as a file? My guess here is that there's a julia runtime call such as jl_string_to_array
that we didn't add a handler for yet and I'd be curious which it was.
Here's the full log.
Yup looks like the culprit here is jl_object_id_
which should be an easy fix as simply marking it as inactive (or alternatively marking it as returning an integer/readonly for activity analysis itself to determine this).
There may be a couple of other things here as well, which I'll take a look at shortly.
The patch available in the obj
branch solves the immediate problem, but this eventually hits a GC error [presumably can be solved by proper GC integration which is planned, but not yet available].
cc @vchuravy
Illegal address space cast from decayed ptr
%9 = addrspacecast double addrspace(11)* %8 to double*
signal (6): Aborted
in expression starting at /mnt/Data/git/Enzyme.jl/band.jl:4
gsignal at /lib/x86_64-linux-gnu/libc.so.6 (unknown line)
abort at /lib/x86_64-linux-gnu/libc.so.6 (unknown line)
runOnFunction at /mnt/Data/git/Enzyme.jl/julia/src/llvm-gc-invariant-verifier.cpp:183
OK... I guess I can wait.
I'm hoping to eventually do reverse-mode auto diff with banded matrices for diff eqs, e.g., Schrödinger equation... since linear algebra implementations are in-place I believe I need to wait for this package.
After latest update, remaining minimal erroring example (incorrect but runs):
using Enzyme
Enzyme.API.printall!(true)
function bmat(x)
# data = [x]
data = zeros(Float64, 1, 1)
@inbounds data[1] = x
return data
end
function f(x::Float64)
@inbounds return bmat(x)[1]
end
@show f(0.1)
Enzyme.API.printall!(true)
@show autodiff(f, Active(0.1))
I'm looking for a reverse mode autodiff package that supports in-place mutation and @ChrisRackauckas suggested this. Unfortunately it crashed on first attempt: