Skip to content
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

CVXpy 1.4.1, SCS 3.2.3, osqp_python 0.6.3, CVXOPT 1.3.2, CyLP 0.92.2, add clarabel solver #36439

Merged
merged 16 commits into from
Dec 14, 2023

Conversation

mkoeppe
Copy link
Member

@mkoeppe mkoeppe commented Oct 10, 2023

Current CyLP version does not build with Cython 3. So we upgrade to the just-released CyLP 0.92.x.

Other updates because they are available.

📝 Checklist

  • The title is concise, informative, and self-explanatory.
  • The description explains in detail what this PR is about.
  • I have linked a relevant issue or discussion.
  • I have created tests covering the changes.
  • I have updated the documentation accordingly.

⌛ Dependencies

@mkoeppe mkoeppe self-assigned this Oct 10, 2023
@mkoeppe mkoeppe changed the title CVXpy 1.4 CVXpy 1.4, SCS 3.2.3, osqp_python 0.6.3, CVXOPT 1.3.2, CyLP 0.91.6 + Cython 3 patch, add clarabel solver Oct 12, 2023
@mkoeppe mkoeppe changed the title CVXpy 1.4, SCS 3.2.3, osqp_python 0.6.3, CVXOPT 1.3.2, CyLP 0.91.6 + Cython 3 patch, add clarabel solver CVXpy 1.4, SCS 3.2.3, osqp_python 0.6.3, CVXOPT 1.3.2, CyLP 0.92.0, add clarabel solver Oct 26, 2023
@mkoeppe mkoeppe added this to the sage-10.2 milestone Oct 26, 2023
@mkoeppe mkoeppe changed the title CVXpy 1.4, SCS 3.2.3, osqp_python 0.6.3, CVXOPT 1.3.2, CyLP 0.92.0, add clarabel solver CVXpy 1.4.1, SCS 3.2.3, osqp_python 0.6.3, CVXOPT 1.3.2, CyLP 0.92.0, add clarabel solver Oct 26, 2023
@mkoeppe mkoeppe changed the title CVXpy 1.4.1, SCS 3.2.3, osqp_python 0.6.3, CVXOPT 1.3.2, CyLP 0.92.0, add clarabel solver CVXpy 1.4.1, SCS 3.2.3, osqp_python 0.6.3, CVXOPT 1.3.2, CyLP 0.92.1, add clarabel solver Oct 29, 2023
@mkoeppe mkoeppe force-pushed the cvxpy_1_4 branch 2 times, most recently from e55a5e8 to 1877e5b Compare November 2, 2023 17:25
@mkoeppe mkoeppe changed the title CVXpy 1.4.1, SCS 3.2.3, osqp_python 0.6.3, CVXOPT 1.3.2, CyLP 0.92.1, add clarabel solver CVXpy 1.4.1, SCS 3.2.3, osqp_python 0.6.3, CVXOPT 1.3.2, CyLP 0.92.2, add clarabel solver Nov 2, 2023
@mkoeppe mkoeppe requested a review from dimpase November 9, 2023 16:30
@vbraun vbraun force-pushed the develop branch 2 times, most recently from 883e05f to e349b00 Compare November 12, 2023 16:25
@mkoeppe mkoeppe removed this from the sage-10.2 milestone Dec 3, 2023
@mkoeppe
Copy link
Member Author

mkoeppe commented Dec 8, 2023

@dimpase Please review

@dimpase
Copy link
Member

dimpase commented Dec 10, 2023

there is a deprecation warning

**********************************************************************
File "src/sage/numerical/backends/cvxpy_backend.pyx", line 157, in sage.numerical.backends.cvxpy_backend.CVXPYBackend.noexcept
Failed example:
    cp.solve()
Expected:
    0
Got:
    doctest:warning
      File "/Volumes/dima/sage/src/bin/sage-runtests", line 162, in <module>
        err = DC.run()
      File "/Volumes/dima/sage/src/sage/doctest/control.py", line 1540, in run
        self.run_doctests()
      File "/Volumes/dima/sage/src/sage/doctest/control.py", line 1152, in run_doctests
        self.dispatcher.dispatch()
      File "/Volumes/dima/sage/src/sage/doctest/forker.py", line 2085, in dispatch
        self.parallel_dispatch()
      File "/Volumes/dima/sage/src/sage/doctest/forker.py", line 1980, in parallel_dispatch
        w.start()  # This might take some time
      File "/Volumes/dima/sage/src/sage/doctest/forker.py", line 2254, in start
        super().start()
      File "/opt/homebrew/Cellar/python@3.11/3.11.6_1/Frameworks/Python.framework/Versions/3.11/lib/python3.11/multiprocessing/process.py", line 121, in start
        self._popen = self._Popen(self)
      File "/opt/homebrew/Cellar/python@3.11/3.11.6_1/Frameworks/Python.framework/Versions/3.11/lib/python3.11/multiprocessing/context.py", line 224, in _Popen
        return _default_context.get_context().Process._Popen(process_obj)
      File "/opt/homebrew/Cellar/python@3.11/3.11.6_1/Frameworks/Python.framework/Versions/3.11/lib/python3.11/multiprocessing/context.py", line 281, in _Popen
        return Popen(process_obj)
      File "/opt/homebrew/Cellar/python@3.11/3.11.6_1/Frameworks/Python.framework/Versions/3.11/lib/python3.11/multiprocessing/popen_fork.py", line 19, in __init__
        self._launch(process_obj)
      File "/opt/homebrew/Cellar/python@3.11/3.11.6_1/Frameworks/Python.framework/Versions/3.11/lib/python3.11/multiprocessing/popen_fork.py", line 71, in _launch
        code = process_obj._bootstrap(parent_sentinel=child_r)
      File "/opt/homebrew/Cellar/python@3.11/3.11.6_1/Frameworks/Python.framework/Versions/3.11/lib/python3.11/multiprocessing/process.py", line 314, in _bootstrap
        self.run()
      File "/Volumes/dima/sage/src/sage/doctest/forker.py", line 2226, in run
        task(self.options, self.outtmpfile, msgpipe, self.result_queue)
      File "/Volumes/dima/sage/src/sage/doctest/forker.py", line 2556, in __call__
        doctests, extras = self._run(runner, options, results)
      File "/Volumes/dima/sage/src/sage/doctest/forker.py", line 2608, in _run
        result = runner.run(test)
      File "/Volumes/dima/sage/src/sage/doctest/forker.py", line 908, in run
        return self._run(test, compileflags, out)
      File "/Volumes/dima/sage/src/sage/doctest/forker.py", line 709, in _run
        self.compile_and_execute(example, compiler, test.globs)
      File "/Volumes/dima/sage/src/sage/doctest/forker.py", line 1144, in compile_and_execute
        exec(compiled, globs)
      File "<doctest sage.numerical.backends.cvxpy_backend.CVXPYBackend.noexcept[6]>", line 1, in <module>
        cp.solve()
      File "/Volumes/dima/sage/local/var/lib/sage/venv-python3.11/lib/python3.11/site-packages/cvxpy/problems/problem.py", line 503, in solve
        return solve_func(self, *args, **kwargs)
      File "/Volumes/dima/sage/local/var/lib/sage/venv-python3.11/lib/python3.11/site-packages/cvxpy/problems/problem.py", line 1072, in _solve
        data, solving_chain, inverse_data = self.get_problem_data(
      File "/Volumes/dima/sage/local/var/lib/sage/venv-python3.11/lib/python3.11/site-packages/cvxpy/problems/problem.py", line 646, in get_problem_data
        solving_chain = self._construct_chain(
      File "/Volumes/dima/sage/local/var/lib/sage/venv-python3.11/lib/python3.11/site-packages/cvxpy/problems/problem.py", line 898, in _construct_chain
        return construct_solving_chain(self, candidate_solvers, gp=gp,
      File "/Volumes/dima/sage/local/var/lib/sage/venv-python3.11/lib/python3.11/site-packages/cvxpy/reductions/solvers/solving_chain.py", line 336, in construct_solving_chain
        warnings.warn(ECOS_DEPRECATION_MSG, FutureWarning)
      File "/opt/homebrew/Cellar/python@3.11/3.11.6_1/Frameworks/Python.framework/Versions/3.11/lib/python3.11/warnings.py", line 109, in _showwarnmsg
        sw(msg.message, msg.category, msg.filename, msg.lineno,
    :
    FutureWarning:
        Your problem is being solved with the ECOS solver by default. Starting in
        CVXPY 1.5.0, Clarabel will be used as the default solver instead. To continue
        using ECOS, specify the ECOS solver explicitly using the ``solver=cp.ECOS``
        argument to the ``problem.solve`` method.
    <BLANKLINE>
    0

@dimpase
Copy link
Member

dimpase commented Dec 10, 2023

there is also this:

platform linux -- Python 3.11.6, pytest-7.4.3, pluggy-1.3.0
rootdir: /mnt/opt/Sage/sage-clang/src
configfile: tox.ini
plugins: anyio-4.0.0
collected 50 items / 1 error / 1 skipped                                                                                                                                                                                              

=============================================================================================================== ERRORS ================================================================================================================
___________________________________________________________________________________ ERROR collecting sage/numerical/backends/cvxpy_backend_test.py ____________________________________________________________________________________
/usr/lib/python3.11/site-packages/_pytest/runner.py:341: in from_call
    result: Optional[TResult] = func()
/usr/lib/python3.11/site-packages/_pytest/runner.py:372: in <lambda>
    call = CallInfo.from_call(lambda: list(collector.collect()), "collect")
/usr/lib/python3.11/site-packages/_pytest/python.py:531: in collect
    self._inject_setup_module_fixture()
/usr/lib/python3.11/site-packages/_pytest/python.py:545: in _inject_setup_module_fixture
    self.obj, ("setUpModule", "setup_module")
/usr/lib/python3.11/site-packages/_pytest/python.py:310: in obj
    self._obj = obj = self._getobj()
/usr/lib/python3.11/site-packages/_pytest/python.py:528: in _getobj
    return self._importtestmodule()
/usr/lib/python3.11/site-packages/_pytest/python.py:617: in _importtestmodule
    mod = import_path(self.path, mode=importmode, root=self.config.rootpath)
/usr/lib/python3.11/site-packages/_pytest/pathlib.py:540: in import_path
    spec.loader.exec_module(mod)  # type: ignore[union-attr]
/usr/lib/python3.11/site-packages/_pytest/assertion/rewrite.py:186: in exec_module
    exec(co, module.__dict__)
src/sage/numerical/backends/cvxpy_backend_test.py:6: in <module>
    @pytest.importorskip("cvxpy")
E   TypeError: 'module' object is not callable
======================================================================================================= short test summary info =======================================================================================================
ERROR src/sage/numerical/backends/cvxpy_backend_test.py - TypeError: 'module' object is not callable
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! Interrupted: 1 error during collection !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
===================================================================================================== 1 skipped, 1 error in 2.88s =====================================================================================================
make[1]: *** [Makefile:233: test] Error 21

@mkoeppe
Copy link
Member Author

mkoeppe commented Dec 10, 2023

Thanks for testing, I'll take a look.

@dimpase
Copy link
Member

dimpase commented Dec 10, 2023

on another Linux system, numerical noise in cvxpy_backend's tests, where one gets -0.0 instead of 0.0.
So these need abstol. I'll send a diff later

@mkoeppe
Copy link
Member Author

mkoeppe commented Dec 10, 2023

feel free to just push to the branch

Copy link
Member

@dimpase dimpase left a comment

Choose a reason for hiding this comment

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

lgtm

Copy link

Documentation preview for this PR (built with commit 3bc7ea6; changes) is ready! 🎉

@mkoeppe
Copy link
Member Author

mkoeppe commented Dec 11, 2023

Thanks, DIma.

@vbraun vbraun merged commit 2fd122b into sagemath:develop Dec 14, 2023
16 of 26 checks passed
@mkoeppe mkoeppe added this to the sage-10.3 milestone Dec 14, 2023
@mkoeppe mkoeppe deleted the cvxpy_1_4 branch March 3, 2024 05:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants