Skip to content

Conversation

@SebastianM-C
Copy link
Member

@SebastianM-C SebastianM-C commented Oct 14, 2025

Currently https://github.com/SciML/SciMLBase.jl/blob/3972f76deeb967dacae300220c350c28f7253059/src/alg_traits.jl#L306 defines the supports_opt_cache_interface in SciMLBase and in OptimizationBase we have

@static if isdefined(SciMLBase, :supports_opt_cache_interface)
import SciMLBase: supports_opt_cache_interface
else
supports_opt_cache_interface(alg) = false
end

which means that the supports_opt_cache_interface in OptimizationBase currently uses the one in SciMLBase.

This is an issue because all optimizers define overloads for both SciMLBase.supports_opt_cache_interface & OptimizationBase.supports_opt_cache_interface, causing method overwriting.

Based on SciML/SciMLBase.jl#1154 (comment) I understand that supports_opt_cache_interface should be owned by OptimizationBase, so I changed all the optimizers to use that one.

@ChrisRackauckas Is this okay?

@static if isdefined(OptimizationBase, :supports_opt_cache_interface)
OptimizationBase.supports_opt_cache_interface(::AugLag) = true
end
OptimizationBase.supports_opt_cache_interface(::AugLag) = true
Copy link
Member

Choose a reason for hiding this comment

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

but it's in scimlbase

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants