Skip to content

Commit f07b6ec

Browse files
authored
Revert "feat: support DuplicatedNoNeed as function annotation for Enzyme (#805)" (#807)
This reverts commit 70e91d7.
1 parent 70e91d7 commit f07b6ec

File tree

3 files changed

+11
-18
lines changed

3 files changed

+11
-18
lines changed

DifferentiationInterface/Project.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
name = "DifferentiationInterface"
22
uuid = "a0c0ee7d-e4b9-4e03-894e-1c5f64a51d63"
33
authors = ["Guillaume Dalle", "Adrian Hill"]
4-
version = "0.7.1"
4+
version = "0.7.0"
55

66
[deps]
77
ADTypes = "47edcb42-4c32-4615-8424-f2b9edc5f35b"

DifferentiationInterface/ext/DifferentiationInterfaceEnzymeExt/utils.jl

Lines changed: 9 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,11 @@
1-
const AnyDuplicated = Union{Duplicated,MixedDuplicated,BatchDuplicated,BatchMixedDuplicated}
2-
3-
const AnyDuplicatedNoNeed = Union{DuplicatedNoNeed,BatchDuplicatedNoNeed}
1+
const AnyDuplicated = Union{
2+
Duplicated,
3+
MixedDuplicated,
4+
BatchDuplicated,
5+
BatchMixedDuplicated,
6+
DuplicatedNoNeed,
7+
BatchDuplicatedNoNeed,
8+
}
49

510
# until https://github.com/EnzymeAD/Enzyme.jl/pull/1545 is merged
611
function DI.pick_batchsize(::AutoEnzyme, N::Integer)
@@ -35,25 +40,13 @@ function get_f_and_df_prepared!(
3540
end
3641
end
3742

38-
function get_f_and_df_prepared!(
39-
df, f::F, ::AutoEnzyme{M,<:AnyDuplicatedNoNeed}, ::Val{B}
40-
) where {F,M,B}
41-
if B == 1
42-
return DuplicatedNoNeed(f, df)
43-
else
44-
return BatchDuplicatedNoNeed(f, df)
45-
end
46-
end
47-
4843
function function_shadow(
4944
::F, ::AutoEnzyme{M,<:Union{Const,Nothing}}, ::Val{B}
5045
) where {M,B,F}
5146
return nothing
5247
end
5348

54-
function function_shadow(
55-
f::F, ::AutoEnzyme{M,<:Union{AnyDuplicated,AnyDuplicatedNoNeed}}, ::Val{B}
56-
) where {F,M,B}
49+
function function_shadow(f::F, ::AutoEnzyme{M,<:AnyDuplicated}, ::Val{B}) where {F,M,B}
5750
if B == 1
5851
return make_zero(f)
5952
else

DifferentiationInterface/test/Back/Enzyme/test.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ backends = [
3232

3333
duplicated_backends = [
3434
AutoEnzyme(; mode=Enzyme.Forward, function_annotation=Enzyme.Duplicated),
35-
AutoEnzyme(; mode=Enzyme.Reverse, function_annotation=Enzyme.DuplicatedNoNeed),
35+
AutoEnzyme(; mode=Enzyme.Reverse, function_annotation=Enzyme.Duplicated),
3636
]
3737

3838
@testset "Checks" begin

0 commit comments

Comments
 (0)