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

Don't keep reference to data_index in alias partial objects #942

Merged
merged 1 commit into from
Mar 16, 2024

Conversation

f0uriest
Copy link
Member

a functools.partial object that we use for aliases keeps a copy of all of its closed over args, which meant that each alias kept a full copy of the entire data index. I don't think it's the source of any major memory leak, but it is risky so this fixes it.

@f0uriest f0uriest requested review from kianorr and dpanici March 16, 2024 04:00
Copy link

codecov bot commented Mar 16, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 94.71%. Comparing base (072f66b) to head (5ac0365).

Additional details and impacted files
@@           Coverage Diff           @@
##           master     #942   +/-   ##
=======================================
  Coverage   94.71%   94.71%           
=======================================
  Files          86       86           
  Lines       21198    21198           
=======================================
  Hits        20078    20078           
  Misses       1120     1120           
Files Coverage Δ
desc/compute/data_index.py 95.55% <100.00%> (ø)

Copy link
Contributor

|             benchmark_name             |         dt(%)          |         dt(s)          |        t_new(s)        |        t_old(s)        | 
| -------------------------------------- | ---------------------- | ---------------------- | ---------------------- | ---------------------- |
 test_build_transform_fft_lowres         |     +0.49 +/- 1.43     | +4.35e-05 +/- 1.28e-04 |  9.00e-03 +/- 8.0e-05  |  8.95e-03 +/- 9.9e-05  |
 test_build_transform_fft_midres         |     +0.94 +/- 1.03     | +8.14e-04 +/- 8.97e-04 |  8.75e-02 +/- 6.1e-04  |  8.67e-02 +/- 6.6e-04  |
 test_build_transform_fft_highres        |     +0.20 +/- 0.76     | +9.22e-04 +/- 3.44e-03 |  4.54e-01 +/- 2.2e-03  |  4.53e-01 +/- 2.7e-03  |
 test_equilibrium_init_lowres            |     +0.45 +/- 1.40     | +1.17e-03 +/- 3.61e-03 |  2.59e-01 +/- 2.1e-03  |  2.58e-01 +/- 3.0e-03  |
 test_equilibrium_init_medres            |     +0.76 +/- 1.15     | +4.50e-03 +/- 6.84e-03 |  5.97e-01 +/- 4.7e-03  |  5.93e-01 +/- 5.0e-03  |
 test_equilibrium_init_highres           |     -0.01 +/- 1.39     | -2.47e-04 +/- 2.99e-02 |  2.15e+00 +/- 1.5e-02  |  2.15e+00 +/- 2.6e-02  |
 test_objective_compile_dshape_current   |     -0.22 +/- 8.06     | -8.23e-03 +/- 3.07e-01 |  3.80e+00 +/- 2.2e-01  |  3.81e+00 +/- 2.1e-01  |
 test_objective_compile_atf              |     +0.00 +/- 4.69     | +3.55e-04 +/- 3.53e-01 |  7.52e+00 +/- 2.3e-01  |  7.52e+00 +/- 2.7e-01  |
 test_objective_compute_dshape_current   |     -1.92 +/- 2.01     | -1.02e-04 +/- 1.07e-04 |  5.20e-03 +/- 5.2e-05  |  5.30e-03 +/- 9.3e-05  |
 test_objective_compute_atf              |     +0.42 +/- 1.54     | +4.65e-05 +/- 1.70e-04 |  1.11e-02 +/- 1.5e-04  |  1.11e-02 +/- 7.8e-05  |
 test_objective_jac_dshape_current       |     +0.31 +/- 5.42     | +1.42e-04 +/- 2.47e-03 |  4.56e-02 +/- 2.1e-03  |  4.55e-02 +/- 1.3e-03  |
 test_objective_jac_atf                  |     +0.79 +/- 3.05     | +1.63e-02 +/- 6.30e-02 |  2.08e+00 +/- 4.5e-02  |  2.07e+00 +/- 4.4e-02  |
 test_perturb_1                          |     -0.83 +/- 3.07     | -1.26e-01 +/- 4.65e-01 |  1.50e+01 +/- 2.8e-01  |  1.52e+01 +/- 3.7e-01  |
 test_perturb_2                          |     -0.66 +/- 2.92     | -1.34e-01 +/- 5.91e-01 |  2.02e+01 +/- 4.7e-01  |  2.03e+01 +/- 3.6e-01  |
 test_proximal_jac_atf                   |     -0.42 +/- 0.95     | -2.96e-02 +/- 6.75e-02 |  7.06e+00 +/- 3.5e-02  |  7.09e+00 +/- 5.8e-02  |
 test_proximal_freeb_compute             |     +0.99 +/- 0.85     | +1.21e-03 +/- 1.03e-03 |  1.23e-01 +/- 7.2e-04  |  1.21e-01 +/- 7.4e-04  |
 test_proximal_freeb_jac                 |     -0.33 +/- 1.21     | -2.32e-02 +/- 8.41e-02 |  6.95e+00 +/- 4.4e-02  |  6.98e+00 +/- 7.2e-02  |

@f0uriest f0uriest merged commit 60a6c99 into master Mar 16, 2024
19 checks passed
@f0uriest f0uriest deleted the rc/alias branch March 16, 2024 15:15
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.

2 participants