Skip to content

Use matrix products for O2GF mode sums - #684

Merged
adrn merged 2 commits into
adrn:mainfrom
rpinho:perf-o2gf-matrix-products
Nov 26, 2026
Merged

adrn merged 2 commits into
adrn:mainfrom
rpinho:perf-o2gf-matrix-products

Conversation

@rpinho

@rpinho rpinho commented Nov 18, 2026 •

Copy link
Copy Markdown
Contributor

Describe your changes

O2GF spends time projecting modes and summing their products along each orbit. Run the action-angle benchmark with ten orbits and 10,000 steps to measure the difference. The patch reuses mode projections and uses matrix products when the conditioning check passes. The test checks the sums for a trajectory that spans fractions of a period.

Checklist

  • Did you add tests?
  • Did you add documentation for your changes?
  • Did you reference any relevant issues?
  • Did you add a changelog entry? (see CHANGES.rst)
  • Are the CI tests passing?
  • Is the milestone set?

🤖 Generated with Claude Code

https://claude.ai/code/session_01LKxc9GKLwnyeV2jaZBxH9N

@adrn adrn added the benchmark label Nov 19, 2026
@adrn

adrn commented Nov 19, 2026

Copy link
Copy Markdown
Owner

Thanks. Let's see what the benchmark improvement is.

@codspeed

codspeed Bot commented Nov 19, 2026 •

Copy link
Copy Markdown

Merging this PR will improve performance by 76.73%

2 warnings

⚠️ 14 benchmarks are dominated by system calls

System calls cannot be simulated consistently and are left out of the measure. The reported value understates the real cost. Switch to the Walltime instrument to measure them.

Learn more about system calls

See affected benchmarks

⚠️ 2 benchmarks with a significant change ran on different hardware

Their base and head results were measured on machines with a different CPU, core count or memory, so the changes might not come from the code. Run base and head on the same runner type.

Learn more about Macro Runners

See affected benchmarks

⚡ 2 improved benchmarks
✅ 399 untouched benchmarks
⏩ 390 skipped benchmarks1

Performance Changes

Benchmark BASE HEAD Efficiency
⚡ test_o2gf[1-10000] 26.7 s 11.9 s ×2.2
⚡ test_o2gf[1-1000] 2 s 1.4 s +39.19%

Tip

Curious why performance improved? Comment @codspeedbot explain why performance improved on this PR, or directly use the CodSpeed MCP with your agent.


Comparing rpinho:perf-o2gf-matrix-products (41e9194) with main (3e9f229)2

Open in CodSpeed

Footnotes

  1. 390 benchmarks were skipped, so the baseline results were used instead. If they were deleted from the codebase, click here and archive them to remove them from the performance reports. ↩

  2. No successful run was found on main (7c989a0) during the generation of this report, so 3e9f229 was used instead as the comparison base. There might be some changes unrelated to this pull request in this report. ↩

@rpinho

rpinho commented Nov 19, 2026

Copy link
Copy Markdown
Contributor Author

Thanks! We would be glad to help in any way we can. What would be helpful for you? What's a hard problem?

rpinho and others added 2 commits November 25, 2026 20:00
The conditioning check only reproduced the old einsum rounding on fits that
are already numerically singular; einsum is not more accurate than BLAS
there. Remove it, its eigvalsh import, and the test that pinned it.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@adrn
adrn force-pushed the perf-o2gf-matrix-products branch from 65560f6 to 41e9194 Compare November 26, 2026 01:02
@adrn adrn added this to the v1.13 milestone Nov 26, 2026
@adrn
adrn enabled auto-merge (squash) November 26, 2026 01:47
@adrn
adrn merged commit 393b9cb into adrn:main Nov 26, 2026
29 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants