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

Add differential use handler #1377

Merged
merged 3 commits into from
Apr 6, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion src/api.jl
Original file line number Diff line number Diff line change
Expand Up @@ -230,6 +230,8 @@
EnzymeRegisterCallHandler(name, fwdhandle, revhandle) = ccall((:EnzymeRegisterCallHandler, libEnzyme), Cvoid, (Cstring, CustomAugmentedForwardPass, CustomReversePass), name, fwdhandle, revhandle)
EnzymeRegisterFwdCallHandler(name, fwdhandle) = ccall((:EnzymeRegisterFwdCallHandler, libEnzyme), Cvoid, (Cstring, CustomForwardPass), name, fwdhandle)
Comment on lines 230 to 231
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[JuliaFormatter] reported by reviewdog 🐶

Suggested change
EnzymeRegisterCallHandler(name, fwdhandle, revhandle) = ccall((:EnzymeRegisterCallHandler, libEnzyme), Cvoid, (Cstring, CustomAugmentedForwardPass, CustomReversePass), name, fwdhandle, revhandle)
EnzymeRegisterFwdCallHandler(name, fwdhandle) = ccall((:EnzymeRegisterFwdCallHandler, libEnzyme), Cvoid, (Cstring, CustomForwardPass), name, fwdhandle)
function EnzymeRegisterCallHandler(name, fwdhandle, revhandle)
return ccall((:EnzymeRegisterCallHandler, libEnzyme), Cvoid,
(Cstring, CustomAugmentedForwardPass, CustomReversePass), name, fwdhandle,
revhandle)
end
function EnzymeRegisterFwdCallHandler(name, fwdhandle)
return ccall((:EnzymeRegisterFwdCallHandler, libEnzyme), Cvoid,
(Cstring, CustomForwardPass), name, fwdhandle)
end


const CustomDiffUse = Ptr{Cvoid}
EnzymeRegisterDiffUseCallHandler(name, handle) = ccall((:EnzymeRegisterDiffUseCallHandler, libEnzyme), Cvoid, (Cstring, CustomDiffUse), name, handle)

Check warning on line 234 in src/api.jl

View workflow job for this annotation

GitHub Actions / format

[JuliaFormatter] reported by reviewdog 🐶 Raw Output: src/api.jl:234:-EnzymeRegisterDiffUseCallHandler(name, handle) = ccall((:EnzymeRegisterDiffUseCallHandler, libEnzyme), Cvoid, (Cstring, CustomDiffUse), name, handle) src/api.jl:235:-EnzymeSetCalledFunction(ci::LLVM.CallInst, fn::LLVM.Function, toremove) = ccall((:EnzymeSetCalledFunction, libEnzyme), Cvoid, (LLVMValueRef, LLVMValueRef, Ptr{Int64}, Int64), ci, fn, toremove, length(toremove)) src/api.jl:236:-EnzymeCloneFunctionWithoutReturnOrArgs(fn::LLVM.Function, keepret, args) = ccall((:EnzymeCloneFunctionWithoutReturnOrArgs, libEnzyme), LLVMValueRef, (LLVMValueRef,UInt8,Ptr{Int64}, Int64), fn, keepret, args, length(args)) src/api.jl:237:-EnzymeGetShadowType(width, T) = ccall((:EnzymeGetShadowType, libEnzyme), LLVMTypeRef, (UInt64,LLVMTypeRef), width, T) src/api.jl:238:- src/api.jl:239:-EnzymeGradientUtilsReplaceAWithB(gutils, a, b) = ccall((:EnzymeGradientUtilsReplaceAWithB, libEnzyme), Cvoid, (EnzymeGradientUtilsRef,LLVMValueRef, LLVMValueRef), gutils, a, b) src/api.jl:240:-EnzymeGradientUtilsErase(gutils, a) = ccall((:EnzymeGradientUtilsErase, libEnzyme), Cvoid, (EnzymeGradientUtilsRef,LLVMValueRef), gutils, a) src/api.jl:241:-EnzymeGradientUtilsEraseWithPlaceholder(gutils, a, orig, erase) = ccall((:EnzymeGradientUtilsEraseWithPlaceholder, libEnzyme), Cvoid, (EnzymeGradientUtilsRef,LLVMValueRef, LLVMValueRef, UInt8), gutils, a, orig, erase) src/api.jl:242:-EnzymeGradientUtilsGetMode(gutils) = ccall((:EnzymeGradientUtilsGetMode, libEnzyme), CDerivativeMode, (EnzymeGradientUtilsRef,), gutils) src/api.jl:243:-EnzymeGradientUtilsGetWidth(gutils) = ccall((:EnzymeGradientUtilsGetWidth, libEnzyme), UInt64, (EnzymeGradientUtilsRef,), gutils) src/api.jl:244:-EnzymeGradientUtilsNewFromOriginal(gutils, val) = ccall((:EnzymeGradientUtilsNewFromOriginal, libEnzyme), LLVMValueRef, (EnzymeGradientUtilsRef, LLVMValueRef), gutils, val) src/api.jl:245:-EnzymeGradientUtilsSetDebugLocFromOriginal(gutils, val, orig) = ccall((:EnzymeGradientUtilsSetDebugLocFromOriginal, libEnzyme), Cvoid, (EnzymeGradientUtilsRef, LLVMValueRef, LLVMValueRef), gutils, val, orig) src/api.jl:246:-EnzymeGradientUtilsLookup(gutils, val, B) = ccall((:EnzymeGradientUtilsLookup, libEnzyme), LLVMValueRef, (EnzymeGradientUtilsRef, LLVMValueRef, LLVM.API.LLVMBuilderRef), gutils, val, B) src/api.jl:247:-EnzymeGradientUtilsInvertPointer(gutils, val, B) = ccall((:EnzymeGradientUtilsInvertPointer, libEnzyme), LLVMValueRef, (EnzymeGradientUtilsRef, LLVMValueRef, LLVM.API.LLVMBuilderRef), gutils, val, B) src/api.jl:248:-EnzymeGradientUtilsDiffe(gutils, val, B) = ccall((:EnzymeGradientUtilsDiffe, libEnzyme), LLVMValueRef, (EnzymeGradientUtilsRef, LLVMValueRef, LLVM.API.LLVMBuilderRef), gutils, val, B) src/api.jl:249:-EnzymeGradientUtilsAddToDiffe(gutils, val, diffe, B, T) = ccall((:EnzymeGradientUtilsAddToDiffe, libEnzyme), Cvoid, (EnzymeGradientUtilsRef, LLVMValueRef, LLVMValueRef, LLVM.API.LLVMBuilderRef, LLVMTypeRef), gutils, val, diffe, B, T) src/api.jl:250:-function EnzymeGradientUtilsAddToInvertedPointerDiffeTT(gutils, orig, origVal, vd, size, origptr, prediff, B, align, premask) src/api.jl:251:- ccall((:EnzymeGradientUtilsAddToInvertedPointerDiffeTT, libEnzyme), Cvoid, (EnzymeGradientUtilsRef, LLVMValueRef, LLVMValueRef, CTypeTreeRef, Cuint, LLVMValueRef, LLVMValueRef, LLVM.API.LLVMBuilderRef, Cuint, LLVMValueRef), gutils, orig, origVal, vd, size, origptr, prediff, B, align, premask) src/api.jl:252:-end src/api.jl:253:- src/api.jl:254:-EnzymeGradientUtilsSetDiffe(gutils, val, diffe, B) = ccall((:EnzymeGradientUtilsSetDiffe, libEnzyme), Cvoid, (EnzymeGradientUtilsRef, LLVMValueRef, LLVMValueRef, LLVM.API.LLVMBuilderRef), gutils, val, diffe, B) src/api.jl:255:-EnzymeGradientUtilsIsConstantValue(gutils, val) = ccall((:EnzymeGradientUtilsIsConstantValue, libEnzyme), UInt8, (EnzymeGradientUtilsRef, LLVMValueRef), gutils, val) src/api.jl:256:-EnzymeGradientUtilsIsConstantInstruction(gutils, val) = ccall((:EnzymeGradientUtilsIsConstantInstruction, libEnzyme), UInt8, (EnzymeGradientUtilsRef, LLVMValueRef), gutils, va
EnzymeSetCalledFunction(ci::LLVM.CallInst, fn::LLVM.Function, toremove) = ccall((:EnzymeSetCalledFunction, libEnzyme), Cvoid, (LLVMValueRef, LLVMValueRef, Ptr{Int64}, Int64), ci, fn, toremove, length(toremove))
EnzymeCloneFunctionWithoutReturnOrArgs(fn::LLVM.Function, keepret, args) = ccall((:EnzymeCloneFunctionWithoutReturnOrArgs, libEnzyme), LLVMValueRef, (LLVMValueRef,UInt8,Ptr{Int64}, Int64), fn, keepret, args, length(args))
EnzymeGetShadowType(width, T) = ccall((:EnzymeGetShadowType, libEnzyme), LLVMTypeRef, (UInt64,LLVMTypeRef), width, T)
Expand Down Expand Up @@ -258,7 +260,7 @@

EnzymeGradientUtilsAllocAndGetTypeTree(gutils, val) = ccall((:EnzymeGradientUtilsAllocAndGetTypeTree, libEnzyme), CTypeTreeRef, (EnzymeGradientUtilsRef,LLVMValueRef), gutils, val)

EnzymeGradientUtilsGetUncacheableArgs(gutils, orig, uncacheable, size) = ccall((:EnzymeGradientUtilsGetUncacheableArgs, libEnzyme), Cvoid, (EnzymeGradientUtilsRef,LLVMValueRef, Ptr{UInt8}, UInt64), gutils, orig, uncacheable, size)
EnzymeGradientUtilsGetUncacheableArgs(gutils, orig, uncacheable, size) = ccall((:EnzymeGradientUtilsGetUncacheableArgs, libEnzyme), UInt8, (EnzymeGradientUtilsRef,LLVMValueRef, Ptr{UInt8}, UInt64), gutils, orig, uncacheable, size)

EnzymeGradientUtilsGetDiffeType(gutils, op, isforeign) = ccall((:EnzymeGradientUtilsGetDiffeType, libEnzyme), CDIFFE_TYPE, (EnzymeGradientUtilsRef,LLVMValueRef, UInt8), gutils, op, isforeign)

Expand Down
4 changes: 3 additions & 1 deletion src/gradientutils.jl
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,9 @@ function get_shadow_type(gutils::GradientUtils, T::LLVM.Type)
end
function get_uncacheable(gutils::GradientUtils, orig::LLVM.CallInst)
uncacheable = Vector{UInt8}(undef, length(collect(LLVM.operands(orig)))-1)
API.EnzymeGradientUtilsGetUncacheableArgs(gutils, orig, uncacheable, length(uncacheable))
if API.EnzymeGradientUtilsGetUncacheableArgs(gutils, orig, uncacheable, length(uncacheable)) != 1
Comment on lines 25 to +27
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[JuliaFormatter] reported by reviewdog 🐶

Suggested change
function get_uncacheable(gutils::GradientUtils, orig::LLVM.CallInst)
uncacheable = Vector{UInt8}(undef, length(collect(LLVM.operands(orig)))-1)
API.EnzymeGradientUtilsGetUncacheableArgs(gutils, orig, uncacheable, length(uncacheable))
if API.EnzymeGradientUtilsGetUncacheableArgs(gutils, orig, uncacheable, length(uncacheable)) != 1
function get_uncacheable(gutils::GradientUtils, orig::LLVM.CallInst)
uncacheable = Vector{UInt8}(undef, length(collect(LLVM.operands(orig))) - 1)
if API.EnzymeGradientUtilsGetUncacheableArgs(gutils, orig, uncacheable,
length(uncacheable)) != 1

uncacheable .= 1
end
return uncacheable
end

Expand Down
35 changes: 30 additions & 5 deletions src/rules/customrules.jl
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@

function enzyme_custom_setup_args(B, orig, gutils, mi, RT, reverse, isKWCall)
function enzyme_custom_setup_args(B, orig::LLVM.CallInst, gutils::GradientUtils, mi, @nospecialize(RT), reverse::Bool, isKWCall::Bool)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[JuliaFormatter] reported by reviewdog 🐶

Suggested change
function enzyme_custom_setup_args(B, orig::LLVM.CallInst, gutils::GradientUtils, mi, @nospecialize(RT), reverse::Bool, isKWCall::Bool)
function enzyme_custom_setup_args(B, orig::LLVM.CallInst, gutils::GradientUtils, mi,
@nospecialize(RT), reverse::Bool, isKWCall::Bool)

ops = collect(operands(orig))
called = ops[end]
ops = ops[1:end-1]
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[JuliaFormatter] reported by reviewdog 🐶

Suggested change
ops = ops[1:end-1]
ops = ops[1:(end - 1)]

Expand Down Expand Up @@ -207,7 +207,7 @@ function enzyme_custom_setup_args(B, orig, gutils, mi, RT, reverse, isKWCall)
return args, activity, (overwritten...,), actives, kwtup
end

function enzyme_custom_setup_ret(gutils, orig, mi, RealRt)
function enzyme_custom_setup_ret(gutils::GradientUtils, orig::LLVM.CallInst, mi, @nospecialize(RealRt))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[JuliaFormatter] reported by reviewdog 🐶

Suggested change
function enzyme_custom_setup_ret(gutils::GradientUtils, orig::LLVM.CallInst, mi, @nospecialize(RealRt))
function enzyme_custom_setup_ret(gutils::GradientUtils, orig::LLVM.CallInst, mi,
@nospecialize(RealRt))

width = get_width(gutils)
mode = get_mode(gutils)

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[JuliaFormatter] reported by reviewdog 🐶

Suggested change

Expand All @@ -216,7 +216,23 @@ function enzyme_custom_setup_ret(gutils, orig, mi, RealRt)
needsShadowP = Ref{UInt8}(0)
needsPrimalP = Ref{UInt8}(0)

activep = API.EnzymeGradientUtilsGetReturnDiffeType(gutils, orig, needsPrimalP, needsShadowP, mode)
# Conditionally use the get return. This is done because EnzymeGradientUtilsGetReturnDiffeType
# calls differential use analysis to determine needsprimal/shadow. However, since now this function
# is used as part of differential use analysis, we need to avoid an ininite recursion. Thus use
# the version without differential use if actual unreachable results are not available anyways.
uncacheable = Vector{UInt8}(undef, length(collect(LLVM.operands(orig)))-1)
activep = if mode == API.DEM_ForwardMode || API.EnzymeGradientUtilsGetUncacheableArgs(gutils, orig, uncacheable, length(uncacheable)) == 1
API.EnzymeGradientUtilsGetReturnDiffeType(gutils, orig, needsPrimalP, needsShadowP, mode)
Comment on lines +223 to +225
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[JuliaFormatter] reported by reviewdog 🐶

Suggested change
uncacheable = Vector{UInt8}(undef, length(collect(LLVM.operands(orig)))-1)
activep = if mode == API.DEM_ForwardMode || API.EnzymeGradientUtilsGetUncacheableArgs(gutils, orig, uncacheable, length(uncacheable)) == 1
API.EnzymeGradientUtilsGetReturnDiffeType(gutils, orig, needsPrimalP, needsShadowP, mode)
uncacheable = Vector{UInt8}(undef, length(collect(LLVM.operands(orig))) - 1)
activep = if mode == API.DEM_ForwardMode ||
API.EnzymeGradientUtilsGetUncacheableArgs(gutils, orig, uncacheable,
length(uncacheable)) == 1
API.EnzymeGradientUtilsGetReturnDiffeType(gutils, orig, needsPrimalP, needsShadowP,
mode)

else
actv = API.EnzymeGradientUtilsGetDiffeType(gutils, orig, false)
if !isghostty(RealRt)
needsPrimalP[] = 1
if actv == API.DFT_DUP_ARG || actv == API.DFT_DUP_NONEED
needsShadowP[] = 1
end
end
actv
end
needsPrimal = needsPrimalP[] != 0
origNeedsPrimal = needsPrimal
_, sret, _ = get_return_info(RealRt)
Expand Down Expand Up @@ -479,7 +495,7 @@ function enzyme_custom_fwd(B, orig, gutils, normalR, shadowR)
return false
end

@inline function aug_fwd_mi(orig, gutils)
@inline function aug_fwd_mi(orig::LLVM.CallInst, gutils::GradientUtils)
width = get_width(gutils)

# 1) extract out the MI from attributes
Expand Down Expand Up @@ -568,7 +584,7 @@ function enzyme_custom_common_rev(forward::Bool, B, orig::LLVM.CallInst, gutils,
end

C = EnzymeRules.Config{Bool(needsPrimal), Bool(needsShadowJL), Int(width), overwritten}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[JuliaFormatter] reported by reviewdog 🐶

Suggested change
C = EnzymeRules.Config{Bool(needsPrimal), Bool(needsShadowJL), Int(width), overwritten}
C = EnzymeRules.Config{Bool(needsPrimal),Bool(needsShadowJL),Int(width),overwritten}


alloctx = LLVM.IRBuilder()
position!(alloctx, LLVM.BasicBlock(API.EnzymeGradientUtilsAllocationBlock(gutils)))

Expand Down Expand Up @@ -949,3 +965,12 @@ function enzyme_custom_rev(B, orig, gutils, tape)
enzyme_custom_common_rev(#=forward=#false, B, orig, gutils, #=normalR=#C_NULL, #=shadowR=#C_NULL, #=tape=#tape)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[JuliaFormatter] reported by reviewdog 🐶

Suggested change
enzyme_custom_common_rev(#=forward=#false, B, orig, gutils, #=normalR=#C_NULL, #=shadowR=#C_NULL, #=tape=#tape)
enzyme_custom_common_rev(false, B, orig, gutils, C_NULL, C_NULL, tape) #=tape=#

return nothing
end

function enzyme_custom_diffuse(orig, gutils, val, isshadow, mode)
# use default
if is_constant_value(gutils, orig) && is_constant_inst(gutils, orig) && !has_aug_fwd_rule(orig, gutils)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[JuliaFormatter] reported by reviewdog 🐶

Suggested change
if is_constant_value(gutils, orig) && is_constant_inst(gutils, orig) && !has_aug_fwd_rule(orig, gutils)
if is_constant_value(gutils, orig) && is_constant_inst(gutils, orig) &&
!has_aug_fwd_rule(orig, gutils)

return (false, true)
end
# don't use default and always require the arg
return (true, false)
end
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[JuliaFormatter] reported by reviewdog 🐶

Suggested change
end
end

11 changes: 11 additions & 0 deletions src/rules/llvmrules.jl
Original file line number Diff line number Diff line change
Expand Up @@ -1149,13 +1149,24 @@
end

macro fwdfunc(f)
:(@cfunction((B, OrigCI, gutils, normalR, shadowR) -> begin

Check warning on line 1152 in src/rules/llvmrules.jl

View workflow job for this annotation

GitHub Actions / format

[JuliaFormatter] reported by reviewdog 🐶 Raw Output: src/rules/llvmrules.jl:1152:- :(@cfunction((B, OrigCI, gutils, normalR, shadowR) -> begin src/rules/llvmrules.jl:1153:- UInt8($f(LLVM.IRBuilder(B), LLVM.CallInst(OrigCI), GradientUtils(gutils), normalR, shadowR)::Bool) src/rules/llvmrules.jl:1154:- end, UInt8, (LLVM.API.LLVMBuilderRef, LLVM.API.LLVMValueRef, API.EnzymeGradientUtilsRef, Ptr{LLVM.API.LLVMValueRef}, Ptr{LLVM.API.LLVMValueRef}) src/rules/llvmrules.jl:1155:- )) src/rules/llvmrules.jl:1232:+ return :(@cfunction((B, OrigCI, gutils, normalR, shadowR) -> begin src/rules/llvmrules.jl:1233:+ UInt8($f(LLVM.IRBuilder(B), LLVM.CallInst(OrigCI), src/rules/llvmrules.jl:1234:+ GradientUtils(gutils), normalR, shadowR)::Bool) src/rules/llvmrules.jl:1235:+ end, UInt8, src/rules/llvmrules.jl:1236:+ (LLVM.API.LLVMBuilderRef, LLVM.API.LLVMValueRef, src/rules/llvmrules.jl:1237:+ API.EnzymeGradientUtilsRef, Ptr{LLVM.API.LLVMValueRef}, src/rules/llvmrules.jl:1238:+ Ptr{LLVM.API.LLVMValueRef})))
UInt8($f(LLVM.IRBuilder(B), LLVM.CallInst(OrigCI), GradientUtils(gutils), normalR, shadowR)::Bool)
end, UInt8, (LLVM.API.LLVMBuilderRef, LLVM.API.LLVMValueRef, API.EnzymeGradientUtilsRef, Ptr{LLVM.API.LLVMValueRef}, Ptr{LLVM.API.LLVMValueRef})
))
end


Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[JuliaFormatter] reported by reviewdog 🐶

Suggested change

macro diffusefunc(f)
:(@cfunction((OrigCI, gutils, val, shadow, mode, useDefault) -> begin
res = $f(LLVM.CallInst(OrigCI), GradientUtils(gutils), LLVM.Value(val), shadow != 0, mode)::Tuple{Bool, Bool}
unsafe_store!(useDefault, UInt8(res[2]))
UInt8(res[1])
end, UInt8, (LLVM.API.LLVMValueRef, API.EnzymeGradientUtilsRef, LLVM.API.LLVMValueRef, UInt8, API.CDerivativeMode, Ptr{UInt8})
))
Comment on lines +1160 to +1165
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[JuliaFormatter] reported by reviewdog 🐶

Suggested change
:(@cfunction((OrigCI, gutils, val, shadow, mode, useDefault) -> begin
res = $f(LLVM.CallInst(OrigCI), GradientUtils(gutils), LLVM.Value(val), shadow != 0, mode)::Tuple{Bool, Bool}
unsafe_store!(useDefault, UInt8(res[2]))
UInt8(res[1])
end, UInt8, (LLVM.API.LLVMValueRef, API.EnzymeGradientUtilsRef, LLVM.API.LLVMValueRef, UInt8, API.CDerivativeMode, Ptr{UInt8})
))
return :(@cfunction((OrigCI, gutils, val, shadow, mode, useDefault) -> begin
res = $f(LLVM.CallInst(OrigCI), GradientUtils(gutils),
LLVM.Value(val), shadow != 0, mode)::Tuple{Bool,Bool}
unsafe_store!(useDefault, UInt8(res[2]))
UInt8(res[1])
end, UInt8,
(LLVM.API.LLVMValueRef, API.EnzymeGradientUtilsRef,
LLVM.API.LLVMValueRef, UInt8, API.CDerivativeMode, Ptr{UInt8})))

end

@noinline function register_llvm_rules()
API.EnzymeRegisterDiffUseCallHandler("enzyme_custom", @diffusefunc(enzyme_custom_diffuse))

Check warning on line 1169 in src/rules/llvmrules.jl

View workflow job for this annotation

GitHub Actions / format

[JuliaFormatter] reported by reviewdog 🐶 Raw Output: src/rules/llvmrules.jl:1169:- API.EnzymeRegisterDiffUseCallHandler("enzyme_custom", @diffusefunc(enzyme_custom_diffuse)) src/rules/llvmrules.jl:1170:- register_handler!( src/rules/llvmrules.jl:1171:- ("julia.call",), src/rules/llvmrules.jl:1172:- @augfunc(jlcall_augfwd), src/rules/llvmrules.jl:1173:- @revfunc(jlcall_rev), src/rules/llvmrules.jl:1174:- @fwdfunc(jlcall_fwd), src/rules/llvmrules.jl:1175:- ) src/rules/llvmrules.jl:1176:- register_handler!( src/rules/llvmrules.jl:1177:- ("julia.call2",), src/rules/llvmrules.jl:1178:- @augfunc(jlcall2_augfwd), src/rules/llvmrules.jl:1179:- @revfunc(jlcall2_rev), src/rules/llvmrules.jl:1180:- @fwdfunc(jlcall2_fwd), src/rules/llvmrules.jl:1181:- ) src/rules/llvmrules.jl:1182:- register_handler!( src/rules/llvmrules.jl:1183:- ("jl_apply_generic", "ijl_apply_generic"), src/rules/llvmrules.jl:1184:- @augfunc(generic_augfwd), src/rules/llvmrules.jl:1185:- @revfunc(generic_rev), src/rules/llvmrules.jl:1186:- @fwdfunc(generic_fwd), src/rules/llvmrules.jl:1187:- ) src/rules/llvmrules.jl:1188:- register_handler!( src/rules/llvmrules.jl:1189:- ("jl_invoke", "ijl_invoke", "jl_f_invoke"), src/rules/llvmrules.jl:1190:- @augfunc(invoke_augfwd), src/rules/llvmrules.jl:1191:- @revfunc(invoke_rev), src/rules/llvmrules.jl:1192:- @fwdfunc(invoke_fwd), src/rules/llvmrules.jl:1193:- ) src/rules/llvmrules.jl:1194:- register_handler!( src/rules/llvmrules.jl:1195:- ("jl_f__apply_latest", "jl_f__call_latest"), src/rules/llvmrules.jl:1196:- @augfunc(apply_latest_augfwd), src/rules/llvmrules.jl:1197:- @revfunc(apply_latest_rev), src/rules/llvmrules.jl:1198:- @fwdfunc(apply_latest_fwd), src/rules/llvmrules.jl:1199:- ) src/rules/llvmrules.jl:1200:- register_handler!( src/rules/llvmrules.jl:1201:- ("jl_threadsfor",), src/rules/llvmrules.jl:1202:- @augfunc(threadsfor_augfwd), src/rules/llvmrules.jl:1203:- @revfunc(threadsfor_rev), src/rules/llvmrules.jl:1204:- @fwdfunc(threadsfor_fwd), src/rules/llvmrules.jl:1205:- ) src/rules/llvmrules.jl:1206:- register_handler!( src/rules/llvmrules.jl:1207:- ("jl_pmap",), src/rules/llvmrules.jl:1208:- @augfunc(pmap_augfwd), src/rules/llvmrules.jl:1209:- @revfunc(pmap_rev), src/rules/llvmrules.jl:1210:- @fwdfunc(pmap_fwd), src/rules/llvmrules.jl:1211:- ) src/rules/llvmrules.jl:1212:- register_handler!( src/rules/llvmrules.jl:1213:- ("jl_new_task", "ijl_new_task"), src/rules/llvmrules.jl:1214:- @augfunc(newtask_augfwd), src/rules/llvmrules.jl:1215:- @revfunc(newtask_rev), src/rules/llvmrules.jl:1216:- @fwdfunc(newtask_fwd), src/rules/llvmrules.jl:1217:- ) src/rules/llvmrules.jl:1218:- register_handler!( src/rules/llvmrules.jl:1219:- ("jl_set_task_threadpoolid", "ijl_set_task_threadpoolid"), src/rules/llvmrules.jl:1220:- @augfunc(set_task_tid_augfwd), src/rules/llvmrules.jl:1221:- @revfunc(set_task_tid_rev), src/rules/llvmrules.jl:1222:- @fwdfunc(set_task_tid_fwd), src/rules/llvmrules.jl:1223:- ) src/rules/llvmrules.jl:1224:- register_handler!( src/rules/llvmrules.jl:1225:- ("jl_enq_work",), src/rules/llvmrules.jl:1226:- @augfunc(enq_work_augfwd), src/rules/llvmrules.jl:1227:- @revfunc(enq_work_rev), src/rules/llvmrules.jl:1228:- @fwdfunc(enq_work_fwd) src/rules/llvmrules.jl:1229:- ) src/rules/llvmrules.jl:1230:- register_handler!( src/rules/llvmrules.jl:1231:- ("enzyme_custom",), src/rules/llvmrules.jl:1232:- @augfunc(enzyme_custom_augfwd), src/rules/llvmrules.jl:1233:- @revfunc(enzyme_custom_rev), src/rules/llvmrules.jl:1234:- @fwdfunc(enzyme_custom_fwd) src/rules/llvmrules.jl:1235:- ) src/rules/llvmrules.jl:1236:- register_handler!( src/rules/llvmrules.jl:1237:- ("jl_wait",), src/rules/llvmrules.jl:1238:- @augfunc(wait_augfwd), sr
register_handler!(
("julia.call",),
@augfunc(jlcall_augfwd),
Expand Down
Loading