Skip to content
Draft
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
2 changes: 2 additions & 0 deletions Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ SparseArrays = "2f01184e-e22b-5df5-ae63-d93ebab69eaf"
[weakdeps]
BFloat16s = "ab4f0b2a-ad5b-11e8-123f-65d77653426b"
ChainRulesCore = "d360d2e6-b24c-11e9-a2a3-2a2ae2dbcce4"
DifferentiationInterface = "a0c0ee7d-e4b9-4e03-894e-1c5f64a51d63"
GPUArraysCore = "46192b85-c4d5-4398-a991-12ede77f4527"
LogExpFunctions = "2ab3a3ac-af41-5b50-aa03-7779005ae688"
SpecialFunctions = "276daf66-3868-5448-9aa4-cd146d93841b"
Expand All @@ -29,6 +30,7 @@ StaticArrays = "90137ffa-7385-5640-81b9-e52037218182"
[extensions]
EnzymeBFloat16sExt = "BFloat16s"
EnzymeChainRulesCoreExt = "ChainRulesCore"
EnzymeDifferentiationInterfaceExt = "DifferentiationInterface"
EnzymeGPUArraysCoreExt = "GPUArraysCore"
EnzymeLogExpFunctionsExt = "LogExpFunctions"
EnzymeSpecialFunctionsExt = "SpecialFunctions"
Expand Down
10 changes: 10 additions & 0 deletions ext/EnzymeDifferentiationInterfaceExt.jl
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
module EnzymeDifferentiationInterfaceExt

function __init__()
@warn """You are using DifferentiationInterface!"
DifferentiationInterface introduces interstitial wrappers that may limit the scope of input programs and add overhead."
Copy link
Contributor

Choose a reason for hiding this comment

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

I would remove "interstitial", I think most non native English speakers don't know the word. Also it isn't clear what you mean by "limit the scope"

Copy link
Member Author

Choose a reason for hiding this comment

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

Yeah I just meant that programs need to be rewritten to be DI compatible (eg can’t have multiple active args, dupnoneed as arg etc). So then general programs that are supported by enzyme directly aren’t necessarily supported by DI (at least without a rewrite)

This can cause derivatives to be slower, or fail to differentiate with default settings when they work with Enzyme directly (e.g. Enzyme.gradient instead of DI.gradient)."
If you find issues, please report at https://github.com/EnzymeAD/Enzyme.jl/issues/new and try Enzyme directly in the interim."""
Copy link
Contributor

Choose a reason for hiding this comment

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

In the spirit of lightening your load, wouldn't you want people to submit these issues to DI instead?
As for the recommendation to switch, most people calling Enzyme through DI will actually be doing it through a third party package like ODE or Turing. In that sense, I don't think the recommendation to switch to native Enzyme is very actionable, or useful.

end

end # module
1 change: 1 addition & 0 deletions src/Enzyme.jl
Original file line number Diff line number Diff line change
Expand Up @@ -1520,5 +1520,6 @@ Returns true if within autodiff, otherwise false.
@inline EnzymeCore.within_autodiff() = false

include("precompile.jl")
include("init.jl")

end # module
9 changes: 9 additions & 0 deletions src/init.jl
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@

function __init__()
if VERSION >= v"1.11.0"
@warn """You are using Julia v1.11 or later!"
Julia 1.11 changes the default Array type to contain a triply-nested pointer, rather than a doubly nested pointer."
This may cause programs (primal but especially derivatives) to be slower, or fail to differentiate with default settings when they previously worked on 1.10."
If you find issues, please report at https://github.com/EnzymeAD/Enzyme.jl/issues/new and try Julia 1.10 in the interim."""
end
end
Loading