-
Notifications
You must be signed in to change notification settings - Fork 87
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
Attributes simultaneously set by the user and by the optimizer #2345
Comments
Hmm. I think I need to think about this. We haven't considered an attribute that is both set by the optimizer, and set by the user. The closest is probably |
Could you be more specific on the error you are getting ? |
@joaquimg gave a similar idea. The error stack is:
|
Yeah. I think so. With the assumption in your solver that the |
We've certainly tried to separate "what are the attributes required as input that the user provides" and "what is the data from the solver that is produced as output." Your initial For example, after the solve, how would one tell which values were provided by the user and which were computed by the solver? |
Those are valuable comments, @odow, thank you. Indeed, if the computed value was to be the same as the user-provided hint we would not be able to tell them apart. On our side, the choice for an attribute pair seems to be the way to go and this issue could be closed. |
Yes, and the error message should be improved into something like : "This is a attribute set by |
I am having some trouble with attributes that are set both by the user and by the optimizer. I think that the UI I am trying to provide collides with the assumptions made by the
supports/is_set_by_optimize/is_copyable
interface.To be more clear, in JuliaQUBO/ToQUBO.jl#77 we are having a recurrent instability with the
ToQUBO.Attributes.ConstraintEncodingPenalty <: ... <: MOI.AbstractConstraintAttribute
attribute.This attribute is meant to allow the user to set manually the penalty factor that will multiply the encoding of a variable in a unconstrained setting.
If not provided, our meta-solver will compute it automatically.
There is even a third scenario where the solver finds even tighter bounds and might select computed values regardless.
In the last two cases, the user will likely want to query the computed results after the call to the optimizer.
In our latest CI run, there are two broken tests where the
MOI.get(model, ToQUBO.Attributes.ConstraintEncodingPenalty(), c)
calls reach a key not found-like error in an interaction with theDoubleDict
struct that maps constraints over bridges.This error appears after setting
is_set_by_optimizer
andis_copyable
totrue
.is_copyable
is set to avoid another error related tosupport
.is_set_by_optimizer
, on the other hand, is necessary for allowing the penalty values to be requested by the caching optimizer on top of it.Is there any way to stick to the interface while still providing the desired interface?
I thought of copying these attributes after
optimize!
is called. This would work ifToQUBO.Optimizer
is accessed directly by aMOI
/JuMP
model but would fail ifMOI.copy_to
orMOI.optimize!(dst, src)
were called by other solvers.The text was updated successfully, but these errors were encountered: