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

Fix integer overflow in parallel computing #3426

Merged
merged 3 commits into from
Sep 23, 2024
Merged

Conversation

jiumao2
Copy link
Contributor

@jiumao2 jiumao2 commented Sep 18, 2024

frame_starts = np.arange(n) * chunk_size will overflow when the recording is ~24 hours long and chunk_size = "1s"

Another integer overflow issue on long recordings following #3388

frame_starts = frame_starts.tolist()
frame_stops = frame_stops.tolist()
frame_starts = [i * chunk_size for i in range(n)]
frame_stops = [(i + 1) * chunk_size for i in range(n)]
Copy link
Collaborator

Choose a reason for hiding this comment

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

This works. I tend to lean toward explicit so something like


frame_stops = [frame_start + chunk_size for frame_start in frame_starts]

Just because it is clearer rather than have to multiple things out. But I think this is a good protection against overflow. Your long recordings are really finding all the overflows :)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yeah... I am surprised no one has tried to deal with long recordings before. Are there any other long-recording users?

Copy link
Collaborator

Choose a reason for hiding this comment

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

The most I've heard of recently is closer to the 10-15 hour mark. But haven't really followed up on those. These things work until they don't. So we are trying to track them down, but they are easier to find when they break.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Hope that long recording is not a bad idea :)

Copy link
Member

Choose a reason for hiding this comment

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

@jiumao2 we are planning to run week long recordings. You are in good company :)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Good to hear that! Not alone anymore :)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Hi @alejoe91 ,

Are you beginning to work with the week-long recordings? I'm not satisfied with the results from Kilosort and have run into a number of issues. Could you share any strategies or tools you're using, such as different sorters, that might be helpful?

Thank you!

@zm711
Copy link
Collaborator

zm711 commented Sep 18, 2024

@h-mayorquin

Copy link
Collaborator

@h-mayorquin h-mayorquin left a comment

Choose a reason for hiding this comment

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

Yeah, this is a good idea.

I also prefer @zm711 writing but this is your PR and that would firmly in style territory : P

@zm711
Copy link
Collaborator

zm711 commented Sep 18, 2024

firmly in style territory : P

pero somos elegantes, carnal.

@jiumao2
Copy link
Contributor Author

jiumao2 commented Sep 18, 2024

We all love @zm711 writing!

@alejoe91 alejoe91 added the core Changes to core module label Sep 23, 2024
@alejoe91 alejoe91 merged commit 57c4e2b into SpikeInterface:main Sep 23, 2024
15 checks passed
@alejoe91 alejoe91 added this to the 0.101.2 milestone Sep 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
core Changes to core module
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants