Add surf_batch_size to Boozer transform to control memory usage#2267
Open
dpanici wants to merge 6 commits into
Open
Add surf_batch_size to Boozer transform to control memory usage#2267dpanici wants to merge 6 commits into
dpanici wants to merge 6 commits into
Conversation
dpanici
requested review from
a team,
YigitElma,
ddudt,
f0uriest,
rahulgaur104 and
unalmis
and removed request for
a team
July 15, 2026 16:31
Contributor
Memory benchmark result| Test Name | %Δ | Master (MB) | PR (MB) | Δ (MB) | Time PR (s) | Time Master (s) |
| -------------------------------------- | ------------ | ------------------ | ------------------ | ------------ | ------------------ | ------------------ |
test_objective_jac_w7x | 0.73 % | 4.054e+03 | 4.083e+03 | 29.46 | 31.64 | 29.63 |
test_proximal_jac_w7x_with_eq_update | -1.44 % | 6.623e+03 | 6.528e+03 | -95.15 | 154.67 | 152.75 |
test_proximal_freeb_jac | 0.15 % | 1.336e+04 | 1.338e+04 | 20.04 | 81.42 | 79.84 |
test_proximal_freeb_jac_blocked | 0.69 % | 7.674e+03 | 7.727e+03 | 52.86 | 71.00 | 69.81 |
test_proximal_freeb_jac_batched | -0.39 % | 7.677e+03 | 7.647e+03 | -29.62 | 69.49 | 70.11 |
test_proximal_jac_ripple | -1.63 % | 3.574e+03 | 3.515e+03 | -58.40 | 55.06 | 54.44 |
test_proximal_jac_ripple_bounce1d | -3.43 % | 3.759e+03 | 3.630e+03 | -129.09 | 68.41 | 68.42 |
test_eq_solve | -1.22 % | 1.947e+03 | 1.923e+03 | -23.84 | 58.08 | 57.98 |For the memory plots, go to the summary of |
YigitElma
requested changes
Jul 15, 2026
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #2267 +/- ##
==========================================
- Coverage 94.32% 94.32% -0.01%
==========================================
Files 101 101
Lines 28866 28870 +4
==========================================
+ Hits 27229 27231 +2
- Misses 1637 1639 +2
🚀 New features to boost your workflow:
|
YigitElma
reviewed
Jul 16, 2026
YigitElma
approved these changes
Jul 16, 2026
ddudt
reviewed
Jul 17, 2026
ddudt
left a comment
Collaborator
There was a problem hiding this comment.
Looks fine, but has it been tested? Like running a test with multiple surfaces, and using this to only compute a few surfaces at a time.
Comment on lines
+40
to
+42
| surf_batch_size="int: Number of flux surfaces to compute simultaneously. Defaults" | ||
| " to ``grid.num_rho`` e.g. compute all flux surfaces simultaneously. Decrease " | ||
| "to reduce memory required for computation.", |
Collaborator
Collaborator
There was a problem hiding this comment.
Yes, there is no explicit default, but kwargs.get("surf_batch_size") returns None and it computes everything without chunking.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
surf_batch_sizeas a kwarg to the Boozer transform compute variables to allow control of memory usage when using with large number of surfacesQuasisymmetryBoozerandOmnigenityobjectivesmake_boozmn_outpututility functionEspecially helpful when making high res boozmn.nc using DESC