Skip to content

Add Benchmarks regarding Coil Optimization#2266

Open
YigitElma wants to merge 9 commits into
masterfrom
yge/coil-benchmarks
Open

Add Benchmarks regarding Coil Optimization#2266
YigitElma wants to merge 9 commits into
masterfrom
yge/coil-benchmarks

Conversation

@YigitElma

@YigitElma YigitElma commented Jul 13, 2026

Copy link
Copy Markdown
Collaborator
  • Adds benchmarks for compute and jacobian of QuadraticFlux with a mixed coilset that is complex enough.
    • I tried to hit NFP, sym, and different coilset for loops of compute_magnetic_field
    • These tests will start running properly once the PR is merged, because those actions run under pull_request_target, that means they always use master code
  • Fixes bug in plot_coils and CoilSet.from_symmetry that ignored the given check_intersection
  • Adds check_intersection to coil set initializers
  • Passes built LinearConstraintProjection object in perturb benchmarks to make it faster. We internally use it in this way anyway. Also, we benchmark LinearConstraintProjection.build() separately.

Optional/can be reverted:

  • I removed the high-res equilibrium initialization benchmark since I think that is not too necessary and takes longer than the stuff we actually care about (like compute, jacobian etc)

@github-actions

Copy link
Copy Markdown
Contributor

Memory benchmark result

|               Test Name                |      %Δ      |    Master (MB)     |      PR (MB)       |    Δ (MB)    |    Time PR (s)     |  Time Master (s)   |
| -------------------------------------- | ------------ | ------------------ | ------------------ | ------------ | ------------------ | ------------------ |
  test_objective_jac_w7x                 |   -2.04 %    |     4.024e+03      |     3.942e+03      |    -82.01    |       32.06        |       29.54        |
  test_proximal_jac_w7x_with_eq_update   |    1.45 %    |     6.514e+03      |     6.608e+03      |    94.19     |       154.59       |       155.13       |
  test_proximal_freeb_jac                |    0.15 %    |     1.332e+04      |     1.334e+04      |    20.32     |       79.73        |       81.43        |
  test_proximal_freeb_jac_blocked        |    1.08 %    |     7.645e+03      |     7.728e+03      |    82.85     |       69.69        |       69.18        |
  test_proximal_freeb_jac_batched        |   -0.15 %    |     7.670e+03      |     7.658e+03      |    -11.17    |       69.30        |       68.70        |
  test_proximal_jac_ripple               |    1.23 %    |     3.520e+03      |     3.563e+03      |    43.18     |       53.44        |       53.44        |
  test_proximal_jac_ripple_bounce1d      |    0.03 %    |     3.772e+03      |     3.773e+03      |     1.06     |       68.85        |       67.52        |
  test_eq_solve                          |    0.41 %    |     1.975e+03      |     1.983e+03      |     8.00     |       57.98        |       57.36        |

For the memory plots, go to the summary of Memory Benchmarks workflow and download the artifact.

@YigitElma YigitElma requested review from ddudt, dpanici and f0uriest July 13, 2026 22:54
@YigitElma YigitElma added the easy Short and simple to code or review label Jul 13, 2026
@YigitElma YigitElma self-assigned this Jul 13, 2026
@YigitElma YigitElma marked this pull request as ready for review July 13, 2026 22:55
@codecov

codecov Bot commented Jul 13, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 94.31%. Comparing base (24aa7b9) to head (5a93190).

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #2266      +/-   ##
==========================================
- Coverage   94.32%   94.31%   -0.02%     
==========================================
  Files         101      101              
  Lines       28866    28868       +2     
==========================================
- Hits        27228    27226       -2     
- Misses       1638     1642       +4     
Files with missing lines Coverage Δ
desc/coils.py 97.58% <100.00%> (-0.38%) ⬇️
desc/plotting.py 95.41% <100.00%> (ø)

... and 2 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant