perf(spectra): fuse two-pass tullio reductions in sum_valid! and PAspectra!#29
Merged
Conversation
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
Contributor
Benchmark Results (Julia v1)Time benchmarks
Memory benchmarks
|
460533f to
b395027
Compare
…ullio Replaces all @tullio/@sum passes in sum_valid!, PAspectra!, and directional_energy_spectra with explicit fused loops that read S only once per element. The four sum_valid! calls in directional_energy_spectra (omni/para/anti/perp) now share a single pass over S; dΩ and the three direction masks are precomputed once per t into Bumper-allocated scratch. Drops the Tullio dependency entirely (was previously the slowest precompile in the dep tree). On a full day of ELFIN-A EPDEF data (10 × 16 × 1731 Float32): - directional_energy_spectra: 1.10 ms → 345 μs (3.2×) - PAspectra: 379 μs → 172 μs (2.2×) - Package import time: 0.40 s → 0.31 s Reordered summation produces 1-ULP Float32 drift vs the previous output at a few indices; downstream tests use ≈ tolerance.
b395027 to
ff5c045
Compare
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.
Replaces the two @tullio passes in each kernel with a single fused loop, reading S only once per element. Drops the dead sum_valid_fast! variant. On a full day of ELFIN-A EPDEF data: directional_energy_spectra 1.11 ms → 690 μs (1.6×); PAspectra 334 μs → 170 μs (2.0×). Reordered summation produces 1-ULP Float32 drift vs the old output at a few indices.