maciej-bendkowski / boltzmann-brain

Analytic sampler compiler for combinatorial systems
BSD 3-Clause "New" or "Revised" License
30 stars 5 forks source link

Failing cvxpy solvers #12

Open maciej-bendkowski opened 6 years ago

maciej-bendkowski commented 6 years ago

Using the -f flag it is possible to disable well-foundedness checks. Consequently, the constructed paganini specification might not be sensible. In one such case (see the examples/ill-founded.in example) the optimisation problem become unbounded and cvxpy fail with the message

cvxpy.error.SolverError: Solver 'ECOS' failed. Try another solver.

Paganini does not handle such errors. Some custom error message would be useful.

Sergey-A-Dovgal commented 6 years ago

I would not call this a bug, rather a feature request. Of course, giving some warning messages about ill-founded specifications could be useful. It is in fact possible to implement the full well-foundedness check according to the paper of Pivoteau, Salvy, Soria, but this it not very easy to do quickly.

Sergey-A-Dovgal commented 6 years ago

There is another possible workaround (not a full solution): we can try to handle "unbounded error" exception thrown by cvxpy. I am not however completely sure that cvxpy throws exception errors correctly, I need to check that.

maciej-bendkowski commented 6 years ago

Sergey, the force flag is meant to intentionally skip the well-foundedness check (think of a huge system that you a priori know to be correct). The issue is merely the cvxpy exception which is not correctly handled by paganini. I would recommend implementing a gentle error, without the stack trace. Something like "Failed to some the given convex problem. Try another solver.". Something like that.