-
Notifications
You must be signed in to change notification settings - Fork 69
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
Fixup more than simple jacobian #1712
Conversation
@swilliamson7 does this fix your jacobian case? |
Benchmark Results
Benchmark PlotsA plot of the benchmark results have been uploaded as an artifact to the workflow run for this PR. |
What does the variable julia> grad = jacobian(Reverse, compute_jacobian, S)
ERROR: MethodError: no method matching jacobian(::ReverseMode{false, FFIABI, false, false}, ::typeof(compute_jacobian), ::ShallowWaters.ModelSetup{Float32, Float32})
Closest candidates are:
jacobian(::ReverseMode{ReturnPrimal, RABI, ErrIfFuncWritten}, ::F, ::X, ::Val{n_out_val}, ::Val{1}) where {F, X, n_out_val, ReturnPrimal, RABI<:EnzymeCore.ABI, ErrIfFuncWritten}
@ Enzyme ~/.julia/packages/Enzyme/afdHl/src/Enzyme.jl:1302
jacobian(::ReverseMode{ReturnPrimal, RABI, ErrIfFuncWritten}, ::F, ::X, ::Val{n_out_val}) where {F, X, n_out_val, ReturnPrimal, RABI<:EnzymeCore.ABI, ErrIfFuncWritten}
@ Enzyme ~/.julia/packages/Enzyme/afdHl/src/Enzyme.jl:1302
jacobian(::ReverseMode{ReturnPrimal, RABI, ErrIfFuncWritten}, ::F, ::X, ::Val{n_out_val}, ::Val{chunk}) where {F, X, chunk, n_out_val, ReturnPrimal, RABI<:EnzymeCore.ABI, ErrIfFuncWritten}
@ Enzyme ~/.julia/packages/Enzyme/afdHl/src/Enzyme.jl:1253
...
Stacktrace:
[1] top-level scope
@ REPL[8]:1
|
it's the number of outputs |
If |
@swilliamson7 just pushed a version which computes n_outs for you. Currently reverse mode jacobian allows any input type, but requires an array output type. |
I saw! That was speedy lol, it doesn't seem like I can test it yet, or at least updating Enzyme doesn't bring any changes. I'm guessing I need to wait for the checks to pass or something? |
@swilliamson7 it was just merged to main, so you now should be able to just do add Enzyme#main |
I got a fun blank-ish error, julia> grad = jacobian(Reverse, compute_jacobian, S)
ERROR: MethodError: no method matching (ReverseMode{false, FFIABI, false})()
Stacktrace:
[1] jacobian(::ReverseMode{false, FFIABI, false, false}, f::typeof(compute_jacobian), x::ShallowWaters.ModelSetup{Float32, Float32})
@ Enzyme ~/.julia/packages/Enzyme/BkuKz/src/Enzyme.jl:1500
[2] top-level scope
@ REPL[13]:1 |
No description provided.