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

Safediv to avoid nan generation in conngould trust radius... #1488

Merged
merged 3 commits into from
Dec 24, 2024
Merged

Conversation

unalmis
Copy link
Collaborator

@unalmis unalmis commented Dec 22, 2024

This is necessary to avoid tripng the jax nan debugger in a dummy objective. Useful for future as well.

This is necessary to avoid tripng the jax nan debugger
@unalmis unalmis added the easy Short and simple to code or review label Dec 22, 2024
@unalmis unalmis requested review from a team, rahulgaur104, f0uriest, ddudt, dpanici, kianorr, sinaatalay and YigitElma and removed request for a team December 22, 2024 04:41
@unalmis unalmis added the skip_changelog No need to update changelog on this PR label Dec 22, 2024
Copy link

codecov bot commented Dec 22, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 95.61%. Comparing base (34dbac0) to head (6e9bdab).

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #1488   +/-   ##
=======================================
  Coverage   95.60%   95.61%           
=======================================
  Files          98       98           
  Lines       25417    25419    +2     
=======================================
+ Hits        24300    24304    +4     
+ Misses       1117     1115    -2     
Files with missing lines Coverage Δ
desc/optimize/least_squares.py 99.34% <100.00%> (+<0.01%) ⬆️

... and 1 file with indirect coverage changes

Copy link
Contributor

github-actions bot commented Dec 22, 2024

|             benchmark_name             |         dt(%)          |         dt(s)          |        t_new(s)        |        t_old(s)        | 
| -------------------------------------- | ---------------------- | ---------------------- | ---------------------- | ---------------------- |
 test_build_transform_fft_lowres         |     -1.72 +/- 2.92     | -1.03e-02 +/- 1.74e-02 |  5.85e-01 +/- 1.4e-02  |  5.95e-01 +/- 1.0e-02  |
 test_equilibrium_init_medres            |     +0.41 +/- 2.83     | +1.90e-02 +/- 1.32e-01 |  4.68e+00 +/- 4.7e-02  |  4.67e+00 +/- 1.2e-01  |
 test_equilibrium_init_highres           |     -3.57 +/- 2.65     | -2.18e-01 +/- 1.62e-01 |  5.90e+00 +/- 1.0e-01  |  6.11e+00 +/- 1.3e-01  |
 test_objective_compile_dshape_current   |     -5.09 +/- 1.90     | -2.20e-01 +/- 8.20e-02 |  4.10e+00 +/- 4.3e-02  |  4.32e+00 +/- 7.0e-02  |
 test_objective_compute_dshape_current   |     -9.06 +/- 3.80     | -5.35e-04 +/- 2.24e-04 |  5.37e-03 +/- 1.6e-04  |  5.90e-03 +/- 1.6e-04  |
 test_objective_jac_dshape_current       |     -0.80 +/- 7.83     | -3.68e-04 +/- 3.59e-03 |  4.56e-02 +/- 8.2e-04  |  4.59e-02 +/- 3.5e-03  |
 test_perturb_2                          |     -3.91 +/- 3.70     | -8.49e-01 +/- 8.04e-01 |  2.09e+01 +/- 3.9e-01  |  2.17e+01 +/- 7.0e-01  |
 test_proximal_freeb_jac                 |     -1.40 +/- 2.84     | -1.08e-01 +/- 2.19e-01 |  7.61e+00 +/- 1.3e-01  |  7.72e+00 +/- 1.8e-01  |
 test_solve_fixed_iter                   |     -3.40 +/- 2.91     | -1.21e+00 +/- 1.03e+00 |  3.43e+01 +/- 6.0e-01  |  3.55e+01 +/- 8.4e-01  |
 test_LinearConstraintProjection_build   |     -2.10 +/- 3.40     | -2.40e-01 +/- 3.89e-01 |  1.12e+01 +/- 2.7e-01  |  1.14e+01 +/- 2.8e-01  |
 test_build_transform_fft_midres         |     -7.70 +/- 7.63     | -5.03e-02 +/- 4.98e-02 |  6.03e-01 +/- 2.0e-02  |  6.53e-01 +/- 4.6e-02  |
 test_build_transform_fft_highres        |     -2.38 +/- 3.65     | -2.37e-02 +/- 3.63e-02 |  9.72e-01 +/- 9.1e-03  |  9.96e-01 +/- 3.5e-02  |
 test_equilibrium_init_lowres            |     -0.30 +/- 9.60     | -1.16e-02 +/- 3.69e-01 |  3.83e+00 +/- 1.5e-01  |  3.84e+00 +/- 3.4e-01  |
 test_objective_compile_atf              |     +0.04 +/- 2.98     | +3.56e-03 +/- 2.41e-01 |  8.10e+00 +/- 1.3e-01  |  8.10e+00 +/- 2.0e-01  |
 test_objective_compute_atf              |     +3.48 +/- 4.10     | +5.51e-04 +/- 6.49e-04 |  1.64e-02 +/- 6.0e-04  |  1.58e-02 +/- 2.4e-04  |
 test_objective_jac_atf                  |     +0.69 +/- 2.13     | +1.35e-02 +/- 4.15e-02 |  1.96e+00 +/- 2.1e-02  |  1.95e+00 +/- 3.6e-02  |
 test_perturb_1                          |     +2.30 +/- 2.15     | +3.35e-01 +/- 3.13e-01 |  1.49e+01 +/- 2.8e-01  |  1.46e+01 +/- 1.5e-01  |
 test_proximal_jac_atf                   |     +0.08 +/- 1.19     | +6.72e-03 +/- 9.77e-02 |  8.21e+00 +/- 6.1e-02  |  8.21e+00 +/- 7.6e-02  |
 test_proximal_freeb_compute             |     -0.34 +/- 1.60     | -6.79e-04 +/- 3.20e-03 |  1.99e-01 +/- 2.5e-03  |  2.00e-01 +/- 2.0e-03  |
 test_solve_fixed_iter_compiled          |     +0.02 +/- 1.56     | +3.10e-03 +/- 3.21e-01 |  2.05e+01 +/- 2.9e-01  |  2.05e+01 +/- 1.4e-01  |

desc/optimize/least_squares.py Outdated Show resolved Hide resolved
@YigitElma
Copy link
Collaborator

Also, there are some other instances of init_tr, i.e. aug_lagrangian_ls.py. The ones in aug_lagrangian.py and fmin_scalar.py are slightly different but can use safediv too.

@unalmis unalmis requested a review from YigitElma December 24, 2024 04:42
@unalmis unalmis merged commit e357a9b into master Dec 24, 2024
25 checks passed
@unalmis unalmis deleted the nan_debug branch December 24, 2024 22:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
easy Short and simple to code or review skip_changelog No need to update changelog on this PR
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants