DI/DIT requires the following Mooncake opt-in for its StaticArrays-related tests to pass:
function Mooncake.friendly_tangent_cache(x::StaticArray)
return Mooncake.FriendlyTangentCache{Mooncake.AsPrimal}(copy(x))
end
With this in place, DI’s full test suite passes for Mooncake. That said, it is somewhat unusual that StaticArrays are included as part of DI’s core test suite, since they are not universally supported across AD backends.
DI currently states:
Thorough validation on standard inputs and outputs (numbers, vectors, matrices)
This phrasing is overly broad. In practice, support depends on specific concrete subtypes of Number, AbstractVector, and AbstractMatrix. For instance, Mooncake does not currently support differentiation with BigFloat or Vector{BigFloat}, and similar limitations likely exist for other AD backends.
Related: SciML/ComponentArrays.jl#350
DI/DIT requires the following Mooncake opt-in for its StaticArrays-related tests to pass:
With this in place, DI’s full test suite passes for Mooncake. That said, it is somewhat unusual that StaticArrays are included as part of DI’s core test suite, since they are not universally supported across AD backends.
DI currently states:
This phrasing is overly broad. In practice, support depends on specific concrete subtypes of Number, AbstractVector, and AbstractMatrix. For instance, Mooncake does not currently support differentiation with BigFloat or Vector{BigFloat}, and similar limitations likely exist for other AD backends.
Related: SciML/ComponentArrays.jl#350