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

Forward over Reverse Example broken on 0.11-dev #685

Closed
tgymnich opened this issue Mar 24, 2023 · 1 comment
Closed

Forward over Reverse Example broken on 0.11-dev #685

tgymnich opened this issue Mar 24, 2023 · 1 comment

Comments

@tgymnich
Copy link
Member

using Enzyme

function f(x::Array{Float64}, y::Array{Float64})
    y[1] = x[1] * x[1] + x[2] * x[1]
    return nothing
end

y = [0.0]
x = [2.0, 2.0]

dy = [0.0]
dx = [1.0, 0.0]

bx = [0.0, 0.0]
by = [1.0]
dbx = [0.0, 0.0]
dby = [0.0]

Enzyme.autodiff(
    Forward,
    (x,y) -> Enzyme.autodiff_deferred(f, x, y),
    Duplicated(Duplicated(x, bx), Duplicated(dx, dbx)),
    Duplicated(Duplicated(y, by), Duplicated(dy, dby)),
)
ERROR: Return type inferred to be Union{}. Giving up.
Stacktrace:
  [1] error(s::String)
    @ Base ./error.jl:35
  [2] #s329#164
    @ ~/Developer/Enzyme.jl/src/compiler.jl:8295 [inlined]
  [3] var"#s329#164"(FA::Any, A::Any, TT::Any, Mode::Any, ModifiedBetween::Any, width::Any, specid::Any, ReturnPrimal::Any, ShadowInit::Any, parent_job::Any, ::Any, #unused#::Type, #unused#::Type, tt::Any, #unused#::Type, #unused#::Type, #unused#::Type, #unused#::Type, #unused#::Type, #unused#::Type, #unused#::Any)
    @ Enzyme.Compiler ./none:0
  [4] (::Core.GeneratedFunctionStub)(::Any, ::Vararg{Any})
    @ Core ./boot.jl:582
  [5] thunk
    @ ~/Developer/Enzyme.jl/src/compiler.jl:8353 [inlined]
  [6] thunk (repeats 2 times)
    @ ~/Developer/Enzyme.jl/src/compiler.jl:8346 [inlined]
  [7] autodiff
    @ ~/Developer/Enzyme.jl/src/Enzyme.jl:309 [inlined]
  [8] autodiff
    @ ~/Developer/Enzyme.jl/src/Enzyme.jl:225 [inlined]
  [9] autodiff(::EnzymeCore.ForwardMode, ::var"#43#44", ::Duplicated{Duplicated{Vector{Float64}}}, ::Duplicated{Duplicated{Vector{Float64}}})
    @ Enzyme ~/Developer/Enzyme.jl/src/Enzyme.jl:211
 [10] top-level scope
    @ ~/Desktop/Debug/src/example.jl:19
@tgymnich tgymnich changed the title Forward over Reverse broken on 0.11-dev Forward over Reverse Example broken on 0.11-dev Mar 24, 2023
@wsmoses
Copy link
Member

wsmoses commented Mar 24, 2023

This is a "not using the deferred ABI on main, correctly issue for the union{}"

@wsmoses wsmoses closed this as completed Mar 24, 2023
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

No branches or pull requests

2 participants