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

revert function_annotation #437

Closed
wants to merge 3 commits into from
Closed
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: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ icnf = construct(
nn,
nvars, # number of variables
naugs; # number of augmented dimensions
compute_mode = DIJacVecMatrixMode(AutoEnzyme(; function_annotation = Enzyme.Const)), # process data in batches
compute_mode = DIJacVecMatrixMode(AutoEnzyme()), # process data in batches
tspan = (0.0f0, 13.0f0), # have bigger time span
steer_rate = 1.0f-1, # add random noise to end of the time span
# resource = CUDALibs(), # process data by GPU
Expand Down
8 changes: 2 additions & 6 deletions benchmark/benchmarks.jl
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,7 @@ icnf = ContinuousNormalizingFlows.construct(
nn,
nvars,
naugs;
compute_mode = ContinuousNormalizingFlows.DIJacVecMatrixMode(
ADTypes.AutoEnzyme(; function_annotation = Enzyme.Const),
),
compute_mode = ContinuousNormalizingFlows.DIJacVecMatrixMode(ADTypes.AutoEnzyme()),
tspan = (0.0f0, 13.0f0),
steer_rate = 1.0f-1,
λ₃ = 1.0f-2,
Expand Down Expand Up @@ -84,9 +82,7 @@ icnf2 = ContinuousNormalizingFlows.construct(
nvars,
naugs;
inplace = true,
compute_mode = ContinuousNormalizingFlows.DIJacVecMatrixMode(
ADTypes.AutoEnzyme(; function_annotation = Enzyme.Const),
),
compute_mode = ContinuousNormalizingFlows.DIJacVecMatrixMode(ADTypes.AutoEnzyme()),
tspan = (0.0f0, 13.0f0),
steer_rate = 1.0f-1,
λ₃ = 1.0f-2,
Expand Down
4 changes: 1 addition & 3 deletions src/base_icnf.jl
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,7 @@ function construct(
nvars::Int,
naugmented::Int = 0;
data_type::Type{<:AbstractFloat} = Float32,
compute_mode::ComputeMode = DIJacVecMatrixMode(
ADTypes.AutoEnzyme(; function_annotation = Enzyme.Const),
),
compute_mode::ComputeMode = DIJacVecMatrixMode(ADTypes.AutoEnzyme()),
inplace::Bool = false,
cond::Bool = aicnf <: Union{CondRNODE, CondFFJORD, CondPlanar},
resource::ComputationalResources.AbstractResource = ComputationalResources.CPU1(),
Expand Down
16 changes: 4 additions & 12 deletions test/call_tests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -35,18 +35,10 @@ Test.@testset "Call Tests" begin
ContinuousNormalizingFlows.DIJacVecVectorMode(ADTypes.AutoZygote()),
ContinuousNormalizingFlows.DIVecJacMatrixMode(ADTypes.AutoZygote()),
ContinuousNormalizingFlows.DIJacVecMatrixMode(ADTypes.AutoZygote()),
ContinuousNormalizingFlows.DIVecJacVectorMode(
ADTypes.AutoEnzyme(; function_annotation = Enzyme.Const),
),
ContinuousNormalizingFlows.DIJacVecVectorMode(
ADTypes.AutoEnzyme(; function_annotation = Enzyme.Const),
),
ContinuousNormalizingFlows.DIVecJacMatrixMode(
ADTypes.AutoEnzyme(; function_annotation = Enzyme.Const),
),
ContinuousNormalizingFlows.DIJacVecMatrixMode(
ADTypes.AutoEnzyme(; function_annotation = Enzyme.Const),
),
ContinuousNormalizingFlows.DIVecJacVectorMode(ADTypes.AutoEnzyme()),
ContinuousNormalizingFlows.DIJacVecVectorMode(ADTypes.AutoEnzyme()),
ContinuousNormalizingFlows.DIVecJacMatrixMode(ADTypes.AutoEnzyme()),
ContinuousNormalizingFlows.DIJacVecMatrixMode(ADTypes.AutoEnzyme()),
]
data_types = Type{<:AbstractFloat}[Float32]
resources = ComputationalResources.AbstractResource[ComputationalResources.CPU1()]
Expand Down
16 changes: 4 additions & 12 deletions test/fit_tests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -32,18 +32,10 @@ Test.@testset "Fit Tests" begin
ContinuousNormalizingFlows.DIJacVecVectorMode(ADTypes.AutoZygote()),
ContinuousNormalizingFlows.DIVecJacMatrixMode(ADTypes.AutoZygote()),
ContinuousNormalizingFlows.DIJacVecMatrixMode(ADTypes.AutoZygote()),
ContinuousNormalizingFlows.DIVecJacVectorMode(
ADTypes.AutoEnzyme(; function_annotation = Enzyme.Const),
),
ContinuousNormalizingFlows.DIJacVecVectorMode(
ADTypes.AutoEnzyme(; function_annotation = Enzyme.Const),
),
ContinuousNormalizingFlows.DIVecJacMatrixMode(
ADTypes.AutoEnzyme(; function_annotation = Enzyme.Const),
),
ContinuousNormalizingFlows.DIJacVecMatrixMode(
ADTypes.AutoEnzyme(; function_annotation = Enzyme.Const),
),
ContinuousNormalizingFlows.DIVecJacVectorMode(ADTypes.AutoEnzyme()),
ContinuousNormalizingFlows.DIJacVecVectorMode(ADTypes.AutoEnzyme()),
ContinuousNormalizingFlows.DIVecJacMatrixMode(ADTypes.AutoEnzyme()),
ContinuousNormalizingFlows.DIJacVecMatrixMode(ADTypes.AutoEnzyme()),
]
data_types = Type{<:AbstractFloat}[Float32]
resources = ComputationalResources.AbstractResource[ComputationalResources.CPU1()]
Expand Down
4 changes: 1 addition & 3 deletions test/instability_tests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,7 @@ Test.@testset "Instability" begin
nn,
nvars,
naugs;
compute_mode = ContinuousNormalizingFlows.DIJacVecMatrixMode(
ADTypes.AutoEnzyme(; function_annotation = Enzyme.Const),
),
compute_mode = ContinuousNormalizingFlows.DIJacVecMatrixMode(ADTypes.AutoEnzyme()),
tspan = (0.0f0, 13.0f0),
steer_rate = 1.0f-1,
λ₃ = 1.0f-2,
Expand Down
4 changes: 1 addition & 3 deletions test/regression_tests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,7 @@ Test.@testset "Regression Tests" begin
nn,
nvars,
naugs;
compute_mode = ContinuousNormalizingFlows.DIJacVecMatrixMode(
ADTypes.AutoEnzyme(; function_annotation = Enzyme.Const),
),
compute_mode = ContinuousNormalizingFlows.DIJacVecMatrixMode(ADTypes.AutoEnzyme()),
tspan = (0.0f0, 13.0f0),
steer_rate = 1.0f-1,
λ₃ = 1.0f-2,
Expand Down
Loading