Reading and writing separately from compute in the chunk executor
Maintainer thường phản hồi trong vòng 1 ngày
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 5/5
- Thời gian dự kiến
- Hơn một tuần
- Mức phù hợp với người mới
- 8/100
- Loại issue
- Tái cấu trúc
- Độ rõ ràng
- Khá rõ ràng
- Mức độ hoạt động
- Sôi nổi
- Công nghệ
- python
- Lĩnh vực
- data-engineering, performance
Hướng nghiên cứu
The work lives in TimeSeriesChunkExecutor, where each worker currently reads, computes and writes in one loop, and the proposal splits that into a reader, compute and writer stage. Read the executor and the recording extractors it calls, and the benchmark numbers in the issue, before anything else. Done would mean a design agreed in the thread (the three questions are still open) and read/write concurrency set independently of n_jobs.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
In TimeSeriesChunkExecutor, each worker reads a chunk, computes on it and writes it. So n_jobs sets three things at once: how many reads are in flight, how many cores compute and how much RAM is used. Storage backends want very different numbers of reads in flight, and that number has nothing to do with the compute.
#4833 and #4347 change the unit of work and where it runs; this is about how reads and writes are issued, and would work with either.
Backends want different numbers of reads in flight
A spinning disk serves one sequential reader best, since concurrent reads make it seek. NVMe wants the opposite: cold-cache reads of 384 int16 channels from a WD SN850X, with N threads each copying the next 1 s chunk out of a memory map as the executor does, ran at 5.6–5.7 GB/s on one thread and 6.8–6.9 GB/s on 8 or 16.
Compressed formats differ too. Reading 1 s chunks with N threads sharing one open file (40 s on NVMe, chunks of 3,750 × 384):
| 1 thread | 4 threads | 8 threads | |
|---|---|---|---|
| HDF5, gzip 1 (h5py 3.16) | 236–242 MS/s | 239–243 | 242–244 |
| zarr, gzip 1 (zarr 2.18) | 231–237 MS/s | 768–802 | 1,292–1,310 |
h5py holds a global lock, so threads don't help even with decompression; zarr's codecs release the GIL and scale 5.5 times on 8 threads.
Writes have the same coupling
Each worker writes its chunk at its own offset, so on a spinning disk the writes interleave too. With zarr v3 shards, several workers write parts of one shard; #4831 and #4833 address this by giving each job a run of chunks that covers a shard.
Proposal
The executor would run three stages:
- A reader issues reads the way the source prefers, into a window bounded by a memory budget. A source could declare a read size, an alignment (such as zarr chunk boundaries), how many reads to keep in flight and whether to read in time order. Sources that declare nothing are read as today.
- Compute takes chunks from the window and runs the chain. Adjacent chunks share margins, which are already in the window, so nothing is read twice.
- A writer writes results in time order, and could gather a whole zarr shard before writing it, whatever the chunk size.
No preprocessing step would change. With threads inside each step (#4857), one compute worker can use every core, so read concurrency, compute threads and RAM become separate settings.
Questions
- Should the executor own reading and writing like this, or should that stay with the extractors?
- Should read preferences live on the recording segment, since the extractor knows its store, or in job kwargs, since the user knows the disk?
- Would an opt-in reader for binary recordings be a useful first step?
- Ngôn ngữ chính
- Python
- Star
- 866
- Fork
- 285
- Merge trung bình
- 2 ngày 7 giờ
- Pull request đã merge (30 ngày)
- 43
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
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- 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.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của SpikeInterface/spikeinterface
-
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 85/100
SpikeInterface/spikeinterface#4842 · 2 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
testing
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
SpikeInterface/spikeinterface#4756 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
enhancement
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
SpikeInterface/spikeinterface#4510 · 2 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 48/100
SpikeInterface/spikeinterface#4880 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Lupin doesn't set `main_channel_id` propertyCó thể đã có người làm @yger đã nhận 1 ngày trước. Đang mởsorters
SpikeInterface/spikeinterface#4879 · 2 người được giao ·
Maintainer thường phản hồi trong vòng 1 ngày
Tất cả issue của SpikeInterface/spikeinterface
Issue tương tự
-
documentation good first issue
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
selimfirat/pysad#379 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
open-webui/open-webui#32805 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
fix: [bug description] HTML CVE metric table shows only the last CVE for each productCó thể đã có người làm @Chris-wh233 đã nhận hôm nay. Đang mởbug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 66/100
ossf/cve-bin-tool#5976 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
needs-triage
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
gke-labs/kube-agents#3615 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
deferred
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 70/100
Maintainer thường phản hồi trong vòng 1 ngày