Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
wants to merge 32 commits into from

Conversation

yger
Copy link
Collaborator

@yger yger commented Sep 19, 2023

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

@samuelgarcia
Copy link
Member

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

@yger
Copy link
Collaborator Author

yger commented Sep 19, 2023

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

@alejoe91 alejoe91 added the sortingcomponents Related to sortingcomponents module label Sep 19, 2023
@yger
Copy link
Collaborator Author

yger commented Sep 19, 2023

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

@samuelgarcia
Copy link
Member

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.

recording_segment, start_frame, end_frame, None, max_margin, add_zeros=True
)
else:
traces_chunk, left_margin, right_margin = None, None, None
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If we do not have traces maybe we can also skip the node loop no ?

@yger yger changed the title Patch to skip chunks without peaks Patch to skip chunks without peaks or if enough peaks have been detected Jan 3, 2024
@yger
Copy link
Collaborator Author

yger commented Jan 3, 2024

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)

@samuelgarcia samuelgarcia added this to the 0.101.0 milestone Jun 12, 2024
@alejoe91
Copy link
Member

alejoe91 commented Jul 8, 2024

@samuelgarcia @yger should we keep this for later?

@yger
Copy link
Collaborator Author

yger commented Jul 9, 2024

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

@yger
Copy link
Collaborator Author

yger commented Sep 10, 2024

This has been done in #3356

@yger yger deleted the skip_no_peaks branch September 12, 2024 06:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
sortingcomponents Related to sortingcomponents module
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants