Skip to content

Add option for lazy cache#2978

Open
blegat wants to merge 3 commits intomasterfrom
bl/autocache
Open

Add option for lazy cache#2978
blegat wants to merge 3 commits intomasterfrom
bl/autocache

Conversation

@blegat
Copy link
Member

@blegat blegat commented Mar 24, 2026

We might want to find a better name for this keyword argument, maybe lazy_cache ?
In MOI.instantiate, we have a sophisticated mechanism that adds a cache if with_cache_type is nothing and with_bridge_type is set.
This interprets with_cache_type = nothing as the user saying, "I don't explictly need a cache type but if another layer needs one, sure go for it".
Since the bridge layer needs one, we add one.
POI has the exact same use case as the bridge layer so it would be useful for POI to just say to instantiate: "even if there is no bridge layer, do your magic in case with_cache_type = nothing because I also need the incremental interface".
With this new keyword argument, we get a simple solution in jump-dev/ParametricOptInterface.jl#239 that makes the behavior of instantiation with the POI layer consistent with the bridge layer

@odow
Copy link
Member

odow commented Mar 25, 2026

I don't necessarily disagree with this, but I'd much prefer not to complicate what is already a complicated way of instantiating optimisers. I'm okay if there are a few places where we need custom instantiations, like in POI.

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

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants