spikeinterface icon indicating copy to clipboard operation
spikeinterface copied to clipboard

Patch to skip chunks without peaks or if enough peaks have been detected

Open yger opened this issue 2 years ago • 5 comments

Could such a solution work @samuelgarcia ? This is a patch to try to address #2001. The idea is that if we have a PeakSource node, and no peaks between start_frame and end_frame, then we should clearly reduce IO by not loading the traces

yger avatar Sep 19 '23 09:09 yger

Your patch is worst than before, you are loading (and computing) traces for all nodes!! We need the trick before the loop.

samuelgarcia avatar Sep 19 '23 09:09 samuelgarcia

Ok, so what should be done is simply checking if the first node is a PeakSource, and it it has spikes, then load traces otherwise skip. I'll give it a try

yger avatar Sep 19 '23 09:09 yger

Here we go, let me know if this works with the node_pipeline spirit!

yger avatar Sep 19 '23 09:09 yger

Yes. We check the first node and we skip the entire grpah if threre is no peak. I propose t return None in that case so it is faster.

samuelgarcia avatar Sep 19 '23 09:09 samuelgarcia

I've extended the PR to cases where we want to stop everything when at least max_peaks have been discovered. This is working, and to allow shuffliung of the chunks, we need to add some seed arguments to the run() function of the ChunkRecordingExecutor. By doing so, chunks can be shuffled, and as soon as max_peaks have been detected, we stop loading traces (or if no peaks are in the chunks)

yger avatar Jan 03 '24 13:01 yger

@samuelgarcia @yger should we keep this for later?

alejoe91 avatar Jul 08 '24 13:07 alejoe91

Yes, @samuelgarcia wants to redesign something, so I guess this will be postponed

yger avatar Jul 09 '24 09:07 yger

This has been done in #3356

yger avatar Sep 10 '24 11:09 yger