Skip to content

perf: batch finite differences in monopolar log-penalty fits - #4871

Open
JESUSROYETH wants to merge 1 commit into
SpikeInterface:mainfrom
JESUSROYETH:perf/monopolar-batched-fd-20261015
Open

JESUSROYETH wants to merge 1 commit into
SpikeInterface:mainfrom
JESUSROYETH:perf/monopolar-batched-fd-20261015

Conversation

@JESUSROYETH

Copy link
Copy Markdown
Contributor

Monopolar fits with minimize_with_log_penality repeatedly call a small objective to estimate each gradient. The change batches the same four parameter points together in NumPy, so SciPy gets the objective and the gradient back in one call.

The finite-difference step, the bound adjustment and the scalar evaluation budget stay the same. Fixed bounds, array subclasses, and waveforms with nonfinite values or a nonpositive maximum still use the existing SciPy call .. the change only targets the monopolar path used by the dredge preset.

So, on the first five minutes of the public IBL CSH_ZAD_026/2020-09-04/001, probe00 recording (384 channels), five paired CPU VM trials gave a 19.15% median reduction in complete-pipeline time (17.41–20.41%). Median times were 940.45 s for baseline and 755.98 s for this change.

The timer covers the whole pipeline: local compressed .cbin reading, filtering/phase shift/common reference, CPU DREDge correction, corrected-data saving, the default tridesclous2 sorter, and a saved sparse analyzer with templates, amplitudes, locations, correlograms, five quality metrics and a saved unit selection. Also, both arms run on the same settings: 8-vCPU Intel n2-standard-8, four workers, one native thread, Python 3.12.3, NumPy 2.3.5, SciPy 1.18.1, and both explicitly use batching_mode="full" for the current DREDge preset.

Peak locations and motion agree byte for byte in each pair, and the full corrected-recording SHA-256 hashes agree too. The sorter varies between unchanged runs, so this is no claim about biological accuracy. Both localization test modules pass (13 tests), including a real-waveform regression for the numerical gradient and the evaluation budget, and the numerical checks also pass on ARM.

@alejoe91 alejoe91 added postprocessing Related to postprocessing module performance Performance issues/improvements labels Oct 15, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

performance Performance issues/improvements postprocessing Related to postprocessing module

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants