We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Using autodiff_thunk on sum with a Const return activity results in an AssertionError:
autodiff_thunk
sum
Const
AssertionError
x = [1.1, 2.2] ∂x = zero(x) fwd, rev = autodiff_thunk(ReverseSplitWithPrimal, Const{typeof(sum)}, Active, Duplicated{typeof(x)}); tape, result, shadow_result = fwd(Const(sum), Duplicated(x, ∂x)); rev(Const(sum), Duplicated(x, ∂x), 1.0, tape) # fine fwd, rev = autodiff_thunk(ReverseSplitWithPrimal, Const{typeof(sum)}, Const, Duplicated{typeof(x)}); tape, result, shadow_result = fwd(Const(sum), Duplicated(x, ∂x)); rev(Const(sum), Duplicated(x, ∂x), 1.0, tape) # error, see below
ERROR: AssertionError: length(argtypes) + needs_tape == length(argexprs) Stacktrace: [1] #s295#184 @ ~/projects/Enzyme.jl/src/compiler.jl:8357 [inlined] [2] var"#s295#184"(RawCall::Any, FA::Any, T::Any, RT::Any, TapeType::Any, N::Any, CC::Any, width::Any, returnPrimal::Any, ::Any, #unused#::Type, fptr::Any, #unused#::Type, #unused#::Type, #unused#::Type, tt::Any, rt::Any, fn::Any, #unused#::Any, args::Any) @ Enzyme.Compiler ./none:0 [3] (::Core.GeneratedFunctionStub)(::Any, ::Vararg{Any}) @ Core ./boot.jl:602 [4] (::Enzyme.Compiler.AdjointThunk{Const{typeof(sum)}, Const{Float64}, Tuple{Duplicated{Vector{Float64}}}, Val{1}, Nothing})(::Const{typeof(sum)}, ::Duplicated{Vector{Float64}}, ::Vararg{Any}) @ Enzyme.Compiler ~/projects/Enzyme.jl/src/compiler.jl:8308 [5] top-level scope @ REPL[44]:1
The text was updated successfully, but these errors were encountered:
You still pass the active return 1.0 in the second case, where you have the return marked as const.
Sorry, something went wrong.
No branches or pull requests
Using
autodiff_thunk
onsum
with aConst
return activity results in anAssertionError
:The text was updated successfully, but these errors were encountered: