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

WIP: add single_chunk_size_threshold opt #82

Closed
wants to merge 3 commits into from

Conversation

magland
Copy link
Collaborator

@magland magland commented Jul 8, 2024

@rly

I've been running into a problem where some of the large (raw ephys) datasets on DANDI are uncompressed and stored in a single very large chunk within the NWB file. For example 000935. In fact, as you know, the default in HDF5 is to create an uncompressed contiguous chunk. This is a problem for Zarr with remote files because (as far as I can see) there is no such thing as a partial read of a chunk. So if I try to randomly access a time segment with one of these arrays, the entire chunk/dataset needs to be downloaded.

This problem could potentially be addressed at various stages of the flow, but at this point I haven't found any that are satisfactory.

As a workaround, in this PR I have added another attribute to the LindiH5ZarrStoreOpts called single_uncompressed_chunk_size_threshold which defaults to 100 MB. It detects the situation where the dataset is a single uncompressed chunk of size greater than 100 MB. In this case, it is marked as an external array link. So in this case, when the client loads the array, it falls back to loading the data using h5py reader, which is capable of slicing the data efficiently.

magland added 3 commits July 8, 2024 14:22
Update assert comparison value in test_local_cacheto improve test reliability
@codecov-commenter
Copy link

Codecov Report

Attention: Patch coverage is 87.50000% with 2 lines in your changes missing coverage. Please review.

Project coverage is 79.51%. Comparing base (731fcb5) to head (bc03770).
Report is 9 commits behind head on main.

Files Patch % Lines
lindi/LindiH5ZarrStore/LindiH5ZarrStore.py 86.66% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main      #82      +/-   ##
==========================================
+ Coverage   79.43%   79.51%   +0.08%     
==========================================
  Files          30       30              
  Lines        2256     2275      +19     
==========================================
+ Hits         1792     1809      +17     
- Misses        464      466       +2     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@magland
Copy link
Collaborator Author

magland commented Jul 8, 2024

Having second thoughts about this solution, so marking as WIP.

Maybe it would be better/cleaner to detect this situation and then auto split into a large number of chunks along the first dimension, so it is represented in the RFS as multiple chunks.

@magland magland changed the title add single_chunk_size_threshold opt WIP: add single_chunk_size_threshold opt Jul 8, 2024
@magland magland closed this Jul 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants