Investigate penalty of passing LocalGeometry around #2450
Copy link
Copy link
Closed
Description
- Put in a test to show if we're reading too much of the geometry. The compiler may not actually be inlining when we tell it to inline.
Maybe define an array of fixed size and see at some point the compiler gives up on inlining.
Might have to look at nsys reports to see how much is being passed through.
Create new data structure like LocalGeometry but only contains two fields, to see if a simpler struct would actually reduce an important GPU usage metric.
Look in pointwise and broadcasts--anywhere projections are involved.
Look at UnrolledUtilities tests for inspiration for writing the test.
Test cases
- Pointwise (loop over different complexities and levels of nesting; inputs (tuples of N floats)) -- when do we fail to inline, or fail to compile altogether
- +, *, /, log (something harder than divide), project
- 1 vs 2 nonlocal args, yes/no is LocalGeom used?: interpolate, weighted interpolate, upwinding (e.g., van Leer), div or curl
Check runtime of every example, but also register pressure, etc.
Links
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels
Type
Projects
- StatusShow more project fieldsDone
Activity
[-]Investigate penalty of passing LocalGeometry around ...[/-][+]Investigate penalty of passing `LocalGeometry` around[/+]petebachant commentedon Feb 10, 2026
petebachant commentedon Feb 20, 2026
petebachant commentedon Mar 9, 2026
Current results are now in notebook form here: https://github.com/petebachant/clima-local-geometry/blob/main/notebooks/benchmark-localgeom.ipynb
petebachant commentedon Apr 21, 2026
Not really sure if #2471 addresses this.
petebachant commentedon Apr 29, 2026
Tests are in, so I'm going to close this. If we can come up with a more specific question to answer, I recommend a new issue.