Skip to content

Re-enable Enzyme AD tests in FIRK after upstream fix #425

@ChrisRackauckas-Claude

Description

@ChrisRackauckas-Claude

Context

Enzyme tests in lib/BoundaryValueDiffEqFIRK/test/expanded/ad_tests.jl were removed in #424 because Enzyme BatchDuplicated forward mode crashes on closures capturing Vector{Vector{Float64}}, which is the pattern used by the FIRK solver.

The upstream bug is tracked at EnzymeAD/Enzyme.jl#2936.

Action needed

When the upstream Enzyme bug is fixed, re-add the Enzyme test variants:

using Enzyme

# For multipoint BVP tests:
jac_alg_enzyme = BVPJacobianAlgorithm(
    bc_diffmode = AutoSparse(
        AutoEnzyme(mode = Enzyme.Reverse, function_annotation = Enzyme.Duplicated)
    ),
    nonbc_diffmode = AutoEnzyme(mode = Enzyme.Forward, function_annotation = Enzyme.Duplicated)
)

# For twopoint BVP tests:
jac_alg_enzyme = BVPJacobianAlgorithm(
    AutoSparse(
        AutoEnzyme(mode = Enzyme.Forward, function_annotation = Enzyme.Duplicated)
    )
)

Also restore AutoEnzyme(mode = Enzyme.Forward, ...) as the nonbc_diffmode in the Mooncake test variants.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions