File tree Expand file tree Collapse file tree
ext/DifferentiationInterfaceEnzymeExt Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -7,13 +7,20 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
77
88## [ Unreleased]
99
10- ### Changed
10+ ## [ 0.6.54 ] - 2025-05-07
1111
12- - Allocate Enzyme shadow memory during preparation ([ #782 ] )
12+ ### Added
13+
14+ - Error hints for Enzyme ([ #788 ] )
1315
1416## [ 0.6.53] - 2025-05-07
1517
18+ ### Changed
19+
20+ - Allocate Enzyme shadow memory during preparation ([ #782 ] )
21+
1622[ unreleased ] : https://github.com/JuliaDiff/DifferentiationInterface.jl/compare/DifferentiationInterface-v0.6.53...main
1723[ 0.6.53 ] : https://github.com/JuliaDiff/DifferentiationInterface.jl/compare/DifferentiationInterface-v0.6.52...DifferentiationInterface-v0.6.53
1824
25+ [ #788 ] : https://github.com/JuliaDiff/DifferentiationInterface.jl/pull/788
1926[ #782 ] : https://github.com/JuliaDiff/DifferentiationInterface.jl/pull/782
Original file line number Diff line number Diff line change 11name = " DifferentiationInterface"
22uuid = " a0c0ee7d-e4b9-4e03-894e-1c5f64a51d63"
33authors = [" Guillaume Dalle" , " Adrian Hill" ]
4- version = " 0.6.53 "
4+ version = " 0.6.54 "
55
66[deps ]
77ADTypes = " 47edcb42-4c32-4615-8424-f2b9edc5f35b"
@@ -56,7 +56,7 @@ ADTypes = "1.13.0"
5656ChainRulesCore = " 1.23.0"
5757DiffResults = " 1.1.0"
5858Diffractor = " =0.2.6"
59- Enzyme = " 0.13.17 "
59+ Enzyme = " 0.13.39 "
6060EnzymeCore = " 0.8.8"
6161ExplicitImports = " 1.10.1"
6262FastDifferentiation = " 0.4.3"
Original file line number Diff line number Diff line change @@ -30,6 +30,7 @@ using EnzymeCore:
3030 Split,
3131 WithPrimal
3232using Enzyme:
33+ Enzyme,
3334 autodiff,
3435 autodiff_thunk,
3536 create_shadows,
@@ -53,4 +54,6 @@ include("forward_twoarg.jl")
5354include (" reverse_onearg.jl" )
5455include (" reverse_twoarg.jl" )
5556
57+ include (" init.jl" )
58+
5659end # module
Original file line number Diff line number Diff line change 1+ function __init__ ()
2+ # robust against internal changes
3+ condition = (
4+ isdefined (Enzyme, :Compiler ) &&
5+ Enzyme. Compiler isa Module &&
6+ isdefined (Enzyme. Compiler, :EnzymeError ) &&
7+ Enzyme. Compiler. EnzymeError isa DataType
8+ )
9+ condition || return nothing
10+ # see https://github.com/JuliaLang/julia/issues/58367 for why this isn't easier
11+ for n in names (Enzyme. Compiler; all= true )
12+ T = getfield (Enzyme. Compiler, n)
13+ if T isa DataType && T <: Enzyme.Compiler.EnzymeError
14+ # robust against internal changes
15+ Base. Experimental. register_error_hint (T) do io, exc
16+ if occursin (" EnzymeMutabilityException" , string (nameof (T)))
17+ printstyled (
18+ io,
19+ " \n If you are using Enzyme through DifferentiationInterface, you may want to try modifying the ADTypes backend object as follows:" ;
20+ bold= true ,
21+ )
22+ printstyled (
23+ io,
24+ " \n\n\t AutoEnzyme(; function_annotation=Enzyme.Duplicated)\n\n " ;
25+ color= :cyan ,
26+ bold= true ,
27+ )
28+ elseif occursin (" EnzymeRuntimeActivityError" , string (nameof (T)))
29+ printstyled (
30+ io,
31+ " \n If you are using Enzyme through DifferentiationInterface, you may want to try modifying the ADTypes backend object as follows:" ;
32+ bold= true ,
33+ )
34+ printstyled (
35+ io,
36+ " \n\n\t AutoEnzyme(; mode=Enzyme.set_runtime_activity(Enzyme.Forward))\n\t AutoEnzyme(; mode=Enzyme.set_runtime_activity(Enzyme.Reverse))\n\n " ;
37+ color= :cyan ,
38+ bold= true ,
39+ )
40+ end
41+ end
42+ end
43+ end
44+ end
You can’t perform that action at this time.
0 commit comments