Skip to content

Adapt Uno interface to unopy 0.4.0#179

Merged
Transurgeon merged 3 commits intocvxgrp:masterfrom
cvanaret:cv/uno
Mar 17, 2026
Merged

Adapt Uno interface to unopy 0.4.0#179
Transurgeon merged 3 commits intocvxgrp:masterfrom
cvanaret:cv/uno

Conversation

@cvanaret
Copy link

@cvanaret cvanaret commented Mar 16, 2026

Description

We implemented the following changes between unopy 0.2.7 and unopy 0.4.0:

  • compatibility with numpy arrays
  • small breaking changes: the Lagrangian sign convention is passed to the model via the dedicated function set_lagrangian_sign_convention instead of set_lagrangian_hessian

See unopy example

Question: can you pin down the dependency to a particular version of unopy, or a minimum required version?

Issue link (if applicable):

Type of change

  • New feature (backwards compatible)
  • New feature (breaking API changes)
  • Bug fix
  • Other (Documentation, CI, ...)

Contribution checklist

  • Add our license to new files.
  • Check that your code adheres to our coding style.
  • Write unittests.
  • Run the unittests and check that they’re passing.
  • Run the benchmarks to make sure your change doesn’t introduce a regression.

@cvanaret
Copy link
Author

cvanaret commented Mar 17, 2026

Ah I see you don't have Uno tests yet. Should I try to merge into #165 instead?

@cvanaret cvanaret changed the title Adapt Uno interface to unopy 0.3.0 Adapt Uno interface to unopy 0.4.0 Mar 17, 2026
@Transurgeon
Copy link
Member

Ah I see you don't have Uno tests yet. Should I try to merge into #165 instead?

no its fine. I will cleanup the #165 and merge it in.

@github-actions
Copy link

github-actions bot commented Mar 17, 2026

Benchmarks that have stayed the same:

   before           after         ratio
 [e6df2dda]       [909b6fd0]
     14.6±0ms         15.9±0ms     1.09  simple_LP_benchmarks.SimpleFullyParametrizedLPBenchmark.time_compile_problem
      20.2±0s          21.1±0s     1.04  sdp_segfault_1132_benchmark.SDPSegfault1132Benchmark.time_compile_problem
     42.5±0ms         43.3±0ms     1.02  matrix_stuffing.SmallMatrixStuffing.time_compile_problem
      710±0ms          720±0ms     1.01  matrix_stuffing.ConeMatrixStuffingBench.time_compile_problem
      1.00±0s          1.01±0s     1.01  finance.FactorCovarianceModel.time_compile_problem
      9.98±0s          10.1±0s     1.01  simple_LP_benchmarks.SimpleLPBenchmark.time_compile_problem
      1.76±0s          1.78±0s     1.01  simple_QP_benchmarks.UnconstrainedQP.time_compile_problem
      518±0ms          523±0ms     1.01  semidefinite_programming.SemidefiniteProgramming.time_compile_problem
      12.1±0s          12.2±0s     1.01  finance.CVaRBenchmark.time_compile_problem
      3.02±0s          3.03±0s     1.00  quantum_hilbert_matrix.QuantumHilbertMatrix.time_compile_problem
      1.57±0s          1.57±0s     1.00  tv_inpainting.TvInpainting.time_compile_problem
      5.09±0s          5.09±0s     1.00  optimal_advertising.OptimalAdvertising.time_compile_problem
      3.88±0s          3.88±0s     1.00  huber_regression.HuberRegression.time_compile_problem
      4.41±0s          4.41±0s     1.00  svm_l1_regularization.SVMWithL1Regularization.time_compile_problem
      283±0ms          283±0ms     1.00  matrix_stuffing.ParamSmallMatrixStuffing.time_compile_problem
      238±0ms          237±0ms     1.00  simple_QP_benchmarks.SimpleQPBenchmark.time_compile_problem
      1.04±0s          1.04±0s     0.99  gini_portfolio.Cajas.time_compile_problem
      230±0ms          228±0ms     0.99  gini_portfolio.Murray.time_compile_problem
      1.42±0s          1.41±0s     0.99  matrix_stuffing.ParamConeMatrixStuffing.time_compile_problem
      881±0ms          869±0ms     0.99  simple_LP_benchmarks.SimpleScalarParametrizedLPBenchmark.time_compile_problem
     15.3±0ms         15.1±0ms     0.99  simple_QP_benchmarks.ParametrizedQPBenchmark.time_compile_problem
      276±0ms          271±0ms     0.98  slow_pruning_1668_benchmark.SlowPruningBenchmark.time_compile_problem
      743±0ms          727±0ms     0.98  simple_QP_benchmarks.LeastSquares.time_compile_problem
      137±0ms          134±0ms     0.98  high_dim_convex_plasticity.ConvexPlasticity.time_compile_problem
      347±0ms          318±0ms     0.92  gini_portfolio.Yitzhaki.time_compile_problem

@PTNobel
Copy link
Member

PTNobel commented Mar 17, 2026

This is awesome! Super happy to see the changes. On the CVXPY side we set minimum versions all the time so that should be no trouble.

@Transurgeon
Copy link
Member

Transurgeon commented Mar 17, 2026

This is awesome! Super happy to see the changes. On the CVXPY side we set minimum versions all the time so that should be no trouble.

This is awesome! Super happy to see the changes. On the CVXPY side we set minimum versions all the time so that should be no trouble.

actually it seems like the #165 branch got super outdated.. so maybe you can add the changes here?

      - name: Install Uno solver
        run: uv pip install unopy
      - name: Verify Uno import
        run: uv run python -c "import unopy; print('unopy imported successfully')"

I think you would need to add these four lines in the test_nlp_solvers.yml file. This will install the latest one.

@cvanaret
Copy link
Author

OK, unopy installs and runs successfully. It does all kinds of crazy on a couple of instances, which I will investigate :)

Copy link
Member

@Transurgeon Transurgeon left a comment

Choose a reason for hiding this comment

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

I'll approve this for now, thanks a lot @cvanaret !
really exciting to make progress on this collaboration.
Will wait for the CI to pass after #181 so that the nlp tests can be actually run there.

@Transurgeon Transurgeon merged commit 909c053 into cvxgrp:master Mar 17, 2026
54 of 59 checks passed
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.

3 participants