Phase 3: GPU TLS backend and multi-band MHAOV - #3
Merged
Conversation
TLS: the binned matched filter is now array-module-generic (numpy CPU / cupy GPU sharing one code path, as the BLS/GLS backends do). The phase correlation uses a short shifted-slice loop instead of sliding_window_view (absent in cupy); templates stay on the host and broadcast against device arrays. tls_power gains a backend argument; TLSMethod exposes gpu_backend. MHAOV: factored out the per-frequency regression sum of squares so it can be pooled across bands. New aov_multiband_power fits each band its own trig-polynomial (independent amplitudes/phases) at a shared frequency and combines them into one F-statistic (B*2H model dof, N_total-B*(2H+1) residual dof). MHAOVMethod now supports_multiband via multiband/mhaov_mb.py. GPU paths share the validated CPU code path; GPU parity tests are gated behind the [gpu] extra. 96 tests (7 GPU-gated); ruff and mypy clean. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
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.
Completes the two stretch items from Phase 2, so all seven methods now have CPU and GPU
backends (GLS, BLS, MHAOV are multi-band).
GPU TLS
The binned matched filter is now array-module-generic — numpy (CPU) and cupy (GPU) run the
identical vectorized code path, as the GLS/BLS backends do. The phase correlation uses a
short shifted-slice loop instead of
sliding_window_view(absent in cupy); templates stay onthe host and broadcast against device arrays.
tls_powergains abackendargument andTLSMethodexposesgpu_backend=cupy.Multi-band MHAOV
The per-frequency regression sum of squares is factored out so it can be pooled across bands.
aov_multiband_powerfits each band its own trig-polynomial (independent harmonic amplitudesand phases) at a shared frequency, then combines them into one F-statistic with
B*2Hmodeland
N_total - B*(2H+1)residual degrees of freedom.MHAOVMethod.supports_multibandis nowtrue, via
multiband/mhaov_mb.py.The GPU paths reuse the validated CPU logic; GPU parity tests are gated behind the
[gpu]extra. 96 tests (7 GPU-gated); ruff + mypy clean.
🤖 Generated with Claude Code