-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Read/Write performance optimizations for netcdf files #6309
Comments
I have to elaborate that this may be even more important for users that READ the data back alot. Reading with the standard Xarray operands hits other limits, but one limit that it definitely hits is that of the HDF5 driver used. |
Thanks @hmaarrfk . Something I didn't quite understand: what do the values in this map refer to:
To what extent should this be done in xarray vs the underlying library? I wasn't sure how much context the underlying library needs to execute this well. |
It would be nice to add this to our documentation. |
@max-sixty unfortunately, I think the way hdf5 is designed, it doesn't try to be too smart about what would be the best fine tuning for your particular system. In some ways, this is the correct approach. The current constructor pathway: Doesn't provide a user with a catchall-kwargs. I think this would be an acceptable solution. I should say that the the performance of the direct driver is terrible without aligned data: |
Great, thanks @hmaarrfk — we'd definitely take a PR for the docs or something to pass along |
What happened?
I'm not too sure this is a bug report, but I figured I would share some of the investigation I've done on the topic of writing large datasets to netcdf.
For clarity, the usecase I'm considering is writing large in-memory array to persistant storage on Linux.
The symptoms are two fold:
Its quite hard to get good performance from systems, so I"m going to put a few more constraints on the type of data we are are writing:
np.zeros
, it doesn't fault the memory)I feel like these two options are rather easy to get to as I'll show in my example.
What did you expect to happen?
I want to be able to write at 3.2GB/s with my shiny new SSD.
I want to leave my RAM unused when I'm archiving to disk.
Minimal Complete Verifiable Example
Relevant log output
Both output about 3.5s equivalent to just about 1GB/s.
To get to about 3 ish GB/s (taking about 1.27s to write a 4GB array). One needs to do a few things:
For the h5netcdf backend you would have to add the following kwargs to h5netcdf constructor
Anything else we need to know?
The main challenge is that while writing aligned data this way is REALLY fast, writing small chunks and unaligned data becomes REALLY slow.
Personally, I think that someone might be able to write a new HDF5 driver that does better optimization, I feel like this can help people loading large datasets which seems to be a large part of the community of xarray users.
Environment
h5py includes some additions of mine that allow you to use the DIRECT driver and I am using a version of HDF5 that is built with the DIRECT driver.
The text was updated successfully, but these errors were encountered: