Vectorized EDF/BDF window decode fast path - #14214
Closed
bruAristimunha wants to merge 9 commits into
Closed
Conversation
This was referenced Aug 25, 2026
bruAristimunha
force-pushed
the
pr/3-edf-fastpath
branch
from
August 25, 2026 08:41
82c96b3 to
2a08bc5
Compare
bruAristimunha
force-pushed
the
pr/3-edf-fastpath
branch
from
August 25, 2026 08:53
2a08bc5 to
9e09d4d
Compare
get_data resolves picks=None to arange directly instead of going through string-based channel-name machinery on every call; _picks_to_idx gets an early return for integer arrays already unique and in range (duplicate picks keep taking the validating path); _mult_cal_one fuses gather, type-cast, and calibration into a single elementwise pass.
FIF raw segments are read as byte-offset views into a PID-keyed memory map of the file instead of open/seek/read per call; buffer entries are selected with searchsorted on the sorted bounds. gzip, file-like objects, and non-simple tag types keep the legacy path. The generic memory-map cache in _read_segments_file also serves the other binary readers.
Uniform-sampling-rate EDF/BDF windows decode through a strided gather plus an optional-numba kernel writing calibrated samples directly into the caller's output buffer, replacing the per-channel Python loop. Big-endian chunks are byteswapped to native order first; uniform stim channels apply the legacy truncating bitmask on the fast path; projector/compensation reads keep the exact legacy route. EDF/BDF/GDF file handles persist per process (PID-keyed LRU).
bruAristimunha
force-pushed
the
pr/3-edf-fastpath
branch
from
August 25, 2026 08:59
9e09d4d to
8dc167a
Compare
cal_v/off_v/gain_v -> channel_calibration/channel_offset/channel_gain, the uniform-row subsets get the uniform_ prefix, one_flat -> decoded_block, arr3 -> record_grid, and the strided gather is named digital_view. No behavior change.
Member
|
Do we need the memmap code here given we can get it already (once we fix it) from |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Reference issue (if any)
None. Part 3/5 of the IO-speedup series. Depends on #14213 (→ #14212).
What does this implement/fix?
Uniform-sampling-rate EDF/BDF windows decode through a strided gather plus an
optional-numba kernel writing calibrated samples straight into the output
buffer, replacing the per-channel Python loop. Big-endian chunks are
byteswapped to native order first; uniform stim channels apply the legacy
truncating bitmask on the fast path; projector reads keep the legacy route.
EDF/BDF/GDF file handles persist per process.
Random 2 s windows via public API vs
main+ earlier parts:EDF 1472 → ~300 µs, BDF 2484 → ~406 µs.
Mixed-sampling-rate files intentionally keep the existing engine.
Additional information
AI disclosure: same as #14212.
CI note: held until the parent PR merges.