Skip to content

Add Benchmarks regarding Coil Optimization - #2266

Merged
YigitElma merged 27 commits into
masterfrom
yge/coil-benchmarks
Jul 30, 2026
Merged

Add Benchmarks regarding Coil Optimization#2266
YigitElma merged 27 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
  • Sets the default of check_intersection to False in many places. Only exception is FourierCurrentPotentialField.to_CoilSet as it seems a bit more important.
  • 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. Also takes it out of setup to prevent triggering build multiple times.

@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.30%. Comparing base (f0b58b8) to head (ce1adf7).

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #2266      +/-   ##
==========================================
- Coverage   94.31%   94.30%   -0.01%     
==========================================
  Files         101      101              
  Lines       28932    28934       +2     
==========================================
- Hits        27288    27287       -1     
- Misses       1644     1647       +3     
Files with missing lines Coverage Δ
desc/coils.py 97.46% <100.00%> (-0.51%) ⬇️
desc/plotting.py 95.41% <100.00%> (ø)

... and 3 files with indirect coverage changes

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

Comment thread desc/coils.py
This was referenced Jul 22, 2026
Comment thread desc/coils.py
Comment thread desc/coils.py Outdated
Comment thread tests/benchmarks/benchmark_cpu_small.py Outdated
@YigitElma

Copy link
Copy Markdown
Collaborator Author

Default to no check for intersections, change the docstring for new default, add to the changelog.

@YigitElma
YigitElma requested a review from ddudt July 23, 2026 22:31
Comment thread tests/benchmarks/benchmark_cpu_small.py
IssraAli
IssraAli previously approved these changes Jul 24, 2026
ddudt
ddudt previously approved these changes Jul 25, 2026
@YigitElma
YigitElma dismissed stale reviews from ddudt and IssraAli via e400dee July 27, 2026 20:20
@YigitElma
YigitElma requested review from IssraAli, ddudt and lkadz July 27, 2026 20:21
lkadz
lkadz previously approved these changes Jul 28, 2026
ddudt
ddudt previously approved these changes Jul 28, 2026
@YigitElma
YigitElma dismissed stale reviews from ddudt and lkadz via 6d0b7d9 July 28, 2026 20:12
@YigitElma YigitElma added the run_benchmarks Run timing benchmarks on this PR against current master branch label Jul 28, 2026
@PlasmaControl PlasmaControl deleted a comment from github-actions Bot Jul 28, 2026
@YigitElma

YigitElma commented Jul 28, 2026

Copy link
Copy Markdown
Collaborator Author

Sorry for the last minute changes, I realized that memory benchmark script had a bug in the import and the benchmarks in general were taking too long on CI (the jacobian one was 4 seconds on my laptop CPU but 40 seconds on CI). I fixed the bug and made the tests smaller.

@YigitElma
YigitElma requested review from ddudt and lkadz July 29, 2026 15:48
@YigitElma
YigitElma merged commit 979839e into master Jul 30, 2026
25 of 28 checks passed
@YigitElma
YigitElma deleted the yge/coil-benchmarks branch July 30, 2026 02:01
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 run_benchmarks Run timing benchmarks on this PR against current master branch

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants