jump-dev / Convex.jl

A Julia package for disciplined convex programming
https://jump.dev/Convex.jl/stable/
Other
559 stars 119 forks source link

optimize `ExpAtom` #613

Closed ericphanson closed 2 months ago

ericphanson commented 2 months ago

closes #254

Before: on the original problem, today I OOM'd on my 16 GB macbook pro. On previous attempts, I got

1303.736478 seconds (11.94 M allocations: 191.588 GiB, 92.49% gc time)

On this branch:

  5.474096 seconds (1.13 M allocations: 216.129 MiB, 20.82% gc time)

The issue is formulating 33378 IndexAtoms and so forth. In general in Convex we must never do scalar operations if we hope to formulate things performantly (unless we move everything to a scalar representation like MOI).

Here, I couldn't see how to avoid the scalar operations, so I lower to MOI to do them on that level, which is efficient.

I filed #614 to track this issue more generally.

codecov[bot] commented 2 months ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 97.88%. Comparing base (2a3b520) to head (c7e3bec).

Additional details and impacted files ```diff @@ Coverage Diff @@ ## master #613 +/- ## ========================================== + Coverage 97.83% 97.88% +0.04% ========================================== Files 88 88 Lines 5045 5058 +13 ========================================== + Hits 4936 4951 +15 + Misses 109 107 -2 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

odow commented 2 months ago

Closing in favor of #618