Skip to content

[WIP] Fix PR comments#173

Merged
Transurgeon merged 4 commits intomasterfrom
pr-comments
Mar 5, 2026
Merged

[WIP] Fix PR comments#173
Transurgeon merged 4 commits intomasterfrom
pr-comments

Conversation

@dance858
Copy link
Collaborator

@dance858 dance858 commented Mar 4, 2026

No description provided.

@github-actions
Copy link

github-actions bot commented Mar 4, 2026

Benchmarks that have improved:

   before           after         ratio
 [ce8fda13]       [0efddcca]
  •     562±0ms          502±0ms     0.89  semidefinite_programming.SemidefiniteProgramming.time_compile_problem
    
  •     4.63±0s          4.02±0s     0.87  huber_regression.HuberRegression.time_compile_problem
    
  •     345±0ms          295±0ms     0.85  slow_pruning_1668_benchmark.SlowPruningBenchmark.time_compile_problem
    
  •     1.25±0s          1.04±0s     0.83  finance.FactorCovarianceModel.time_compile_problem
    
  •     280±0ms          233±0ms     0.83  gini_portfolio.Murray.time_compile_problem
    
  •     172±0ms          138±0ms     0.80  high_dim_convex_plasticity.ConvexPlasticity.time_compile_problem
    
  •     398±0ms          315±0ms     0.79  gini_portfolio.Yitzhaki.time_compile_problem
    

Benchmarks that have stayed the same:

   before           after         ratio
 [ce8fda13]       [0efddcca]
      13.8±0s          14.4±0s     1.04  finance.CVaRBenchmark.time_compile_problem
     14.9±0ms         15.4±0ms     1.03  simple_LP_benchmarks.SimpleFullyParametrizedLPBenchmark.time_compile_problem
      1.60±0s          1.65±0s     1.03  tv_inpainting.TvInpainting.time_compile_problem
      3.25±0s          3.35±0s     1.03  quantum_hilbert_matrix.QuantumHilbertMatrix.time_compile_problem
     38.9±0ms         40.0±0ms     1.03  matrix_stuffing.SmallMatrixStuffing.time_compile_problem
     15.2±0ms         15.4±0ms     1.01  simple_QP_benchmarks.ParametrizedQPBenchmark.time_compile_problem
      283±0ms          285±0ms     1.01  matrix_stuffing.ParamSmallMatrixStuffing.time_compile_problem
      240±0ms          240±0ms     1.00  simple_QP_benchmarks.SimpleQPBenchmark.time_compile_problem
      794±0ms          794±0ms     1.00  simple_QP_benchmarks.LeastSquares.time_compile_problem
      5.03±0s          5.02±0s     1.00  optimal_advertising.OptimalAdvertising.time_compile_problem
      932±0ms          913±0ms     0.98  simple_LP_benchmarks.SimpleScalarParametrizedLPBenchmark.time_compile_problem
      10.9±0s          10.6±0s     0.97  simple_LP_benchmarks.SimpleLPBenchmark.time_compile_problem
      22.2±0s          21.6±0s     0.97  sdp_segfault_1132_benchmark.SDPSegfault1132Benchmark.time_compile_problem
      1.45±0s          1.41±0s     0.97  matrix_stuffing.ParamConeMatrixStuffing.time_compile_problem
      695±0ms          673±0ms     0.97  matrix_stuffing.ConeMatrixStuffingBench.time_compile_problem
      4.99±0s          4.82±0s     0.97  svm_l1_regularization.SVMWithL1Regularization.time_compile_problem
      1.94±0s          1.85±0s     0.95  simple_QP_benchmarks.UnconstrainedQP.time_compile_problem
      1.12±0s          1.03±0s     0.92  gini_portfolio.Cajas.time_compile_problem

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.

Looks good, really nice fixes!

Copy link
Member

@PTNobel PTNobel left a comment

Choose a reason for hiding this comment

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

Looks awesome. Thanks Daniel! A couple quick comments.

def div_canon(expr, args):

# raise an error if the denominator is not nonnegative
if not args[1].is_nonneg():
Copy link
Member

@PTNobel PTNobel Mar 4, 2026

Choose a reason for hiding this comment

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

Suggested change
if not args[1].is_nonneg():
if not (args[1].get_bounds()[0] >= 0).all():

This will allow more code than your version; which is something we need to fix at some point 😅

def entr_canon(expr, args):
t = Variable(args[0].shape, bounds=[0, None])
t = Variable(args[0].shape, nonneg=True)
if args[0].value is not None:
Copy link
Member

Choose a reason for hiding this comment

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

I thought the value had to be non-None at this point in the DNLP canon process

Copy link
Member

Choose a reason for hiding this comment

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

I had missed your reply on the other thread! Thanks for clarifying. Discregard the resolved ones.


return expr.copy([t]), [t == args[0]]

sinh_canon = smooth_full_domain_canon
Copy link
Member

Choose a reason for hiding this comment

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

My preference is to just have these mappings in the dictionary rather than here; but I trust your judgement on this.

@Transurgeon
Copy link
Member

@PTNobel I'll merge this based on your comment on the cvxpy-merge PR.
Thanks again for having a look!

@Transurgeon Transurgeon merged commit 1cbab94 into master Mar 5, 2026
55 of 57 checks passed
@PTNobel
Copy link
Member

PTNobel commented Mar 5, 2026

Please address my two comments here too!

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