Hacktoberfest 2026: những issue maintainer đã đánh dấu cho tháng Mười, đang mở và phù hợp người mới. Xem issue Hacktoberfest

Pick better default for mp_context

Đang mở
#4,422 7 bình luận 0 reaction 0 người được giao Xem trên GitHub

Maintainer thường phản hồi trong vòng 2 ngày

Chưa có ai nhận issue này.

Đánh giá

Độ khó
4/5
Thời gian dự kiến
3-5 ngày
Mức phù hợp với người mới
45/100
Loại issue
Tính năng
Độ rõ ràng
Khá rõ ràng
Mức độ hoạt động
Ít trao đổi
Công nghệ
python
Lĩnh vực
backend

Hướng nghiên cứu

Start in src/spikeinterface/core/job_tools.py around lines 418-440 and compare the earlier selection at lines 419-427. Review Python's multiprocessing context defaults and the reported Kilosort/scikit-learn hang, especially the referenced spikedetect.py line 72. Done means agreeing on and implementing a safe default or preserving None with clear documentation, then validating the affected workload.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

io performance

#4333 changes how mp_context is chosen from:

https://github.com/SpikeInterface/spikeinterface/blob/d8f49ece6bc94cf84beb15840e07250acbbcb80d/src/spikeinterface/core/job_tools.py#L419-L427

to

https://github.com/SpikeInterface/spikeinterface/blob/81e89fd19cffdbf031e48c54100b6ab9e024e3ca/src/spikeinterface/core/job_tools.py#L418-L440

Before the PR; job_kwargs.mp_context=None and recording.get_preferred_mp_context()=None (the default and most common setup) will call mp_context = multiprocessing.get_context(None) that returned the default context for that specific machine (spawn for windows & Mac and fork/forkserver for Linux). Now, the behavior has changed for Linux: it always picks fork. Default mp_context for Linux from python 3.14 onwards is forkserver (a thread-safe, less problematic alternative to fork) docs.

When running kilosort4 in python 3.14. fork did not play nice with some multi-threaded calls inside scikit learn, particularly the process hangs forever in this line:
https://github.com/MouseLand/Kilosort/blob/7a19a57bef39f3e07ab7fa1edf5aa8635c69a850/kilosort/spikedetect.py#L72
This was run inside a kubernetes pod with GPUs but I couldn't replicate it locally: 3.13 and 3.14 both worked with fork or forkserver :/ so not sure if it will be a problem for other people.

In any case, it might be worth considering making forkserver (rather than fork) the Linux default (it's been around since python 3.4) or allow multiprocessing to pick the best default based on system and python version as it did before this PR, i.e., let mp_context=None with a comment saying what that means).

Ngôn ngữ chính
Python
Star
858
Fork
281
Merge trung bình
3 ngày 18 giờ
Pull request đã merge (30 ngày)
45

Chuẩn bị môi trường

Dự án này không cung cấp dev container, Dockerfile hay hướng dẫn đóng góp, nên bạn cần tự thiết lập môi trường: hãy bắt đầu từ README và xem hướng dẫn đóng góp lần đầu của chúng tôi để biết các bước chung.

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của SpikeInterface/spikeinterface

Tất cả issue của SpikeInterface/spikeinterface

Issue tương tự

Thêm issue về Python

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.