From 3fbae64744833f8772c4bba9c762fd6fe767b5a4 Mon Sep 17 00:00:00 2001 From: Guillaume Dalle <22795598+gdalle@users.noreply.github.com> Date: Tue, 19 Mar 2024 07:56:46 +0100 Subject: [PATCH] Fix error message --- docs/src/faq.md | 3 ++- src/compiler.jl | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/docs/src/faq.md b/docs/src/faq.md index 0bd648680c..3a6e66f44b 100644 --- a/docs/src/faq.md +++ b/docs/src/faq.md @@ -9,7 +9,8 @@ end ## Implementing pullbacks -Enzyme's [`autodiff`](@ref) function can only handle functions with scalar output. To implement pullbacks (back-propagation of gradients/tangents) for array-valued functions, use a mutating function that returns `nothing` and stores it's result in one of the arguments, which must be passed wrapped in a [`Duplicated`](@ref). +In combined reverse mode, Enzyme's [`autodiff`](@ref) function can only handle functions with scalar output (this is not true for split reverse mode, aka `autodiff_thunk`). +To implement pullbacks (back-propagation of gradients/tangents) for array-valued functions, use a mutating function that returns `nothing` and stores it's result in one of the arguments, which must be passed wrapped in a [`Duplicated`](@ref). Given a function `mymul!` that performs the equivalent of `R = A * B` for matrices `A` and `B`, and given a gradient (tangent) `∂z_∂R`, we can compute `∂z_∂A` and `∂z_∂B` like this: diff --git a/src/compiler.jl b/src/compiler.jl index 676d1f302c..8b2dd6b469 100644 --- a/src/compiler.jl +++ b/src/compiler.jl @@ -1820,7 +1820,7 @@ function julia_error(cstr::Cstring, val::LLVM.API.LLVMValueRef, errtype::API.Err println(io, Base.unsafe_string(st)) API.EnzymeStringFree(st) end - println(io, "You may be using a constant variable as temporary storage for active memory (https://enzyme.mit.edu/julia/stable/#Activity-of-temporary-storage). If not, please open an issue, and either rewrite this variable to not be conditionally active or use Enzyme.API.runtimeActivity!(true) as a workaround for now") + println(io, "You may be using a constant variable as temporary storage for active memory (https://enzyme.mit.edu/julia/stable/faq/#Activity-analysis). If not, please open an issue, and either rewrite this variable to not be conditionally active or use Enzyme.API.runtimeActivity!(true) as a workaround for now") if bt !== nothing Base.show_backtrace(io, bt) end