-
Notifications
You must be signed in to change notification settings - Fork 58
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
[Discussion] HDF5+GDS+multi-threading #295
Comments
[...]
Note that I do not know a lot about the details of this VFD interface in HDF5. So I am therefore maybe being naive. At what level do you need thread-safety in the VFD interface? It looks to me like you're providing callbacks for read/write that HDF5 can use. If the HDF5 calls are single-threaded, you can presumably do whatever you like internally as long as you expose a "single-thread consistent" interface to HDF5. Or is it not that easy? |
Correct, the VFD itself can be multi-threaded but Legate uses threads (as opposed to processes) when parallelizing tasks on the same node. E.g., if two Legate tasks runs on the same machine, their calls to hdf5 must be serialized. |
So at this point I believe the question is, is it better to go through the "official" VFD extension interface, or only use the HDF5 API up to the point where we get access to the underlying buffers, and from that point on proceed independently. The latter would be less constrained by the main HDF5 library's quirks, and would have clearer performance characteristics, but wouldn't be as fully-featured. Which alternative is more programming effort is unclear. I am favorable towards (2), but I am absolutely not an expert here. |
In principle, yes. The MPI backend in hdf5 is implemented using a VFD approach. For reading, this should be straightforward but in order to support writing, we would have to implement something similar to MPIO VFD. |
Very well put.
That I can answer, option (2) is significant less work. Particularly, if we want to support parallel write to a single file (uncompressed). |
In #287, we propose to implement a Virtual File Driver (VFD) that uses KvikIO to accelerate HDF5 IO. However, HDF5 isn’t thread-safe thus implementing a VFD might be of limited interest to projects like Legate that make heavy use of muti-threading.
Notice, it is possible to compile HDF5 with
--enable-threadsafe
but it effectively makes the entire HDF5 library a giant critical region. There is a RFC to make HDF5 (or part of it) thread-safe, RFC: Multi-Thread HDF5, but it is not coming soon.Let’s look at some alternative approaches that supports both GDS and multi-threading:
1. Use Kerchunk
2. Parse the HDF5 metadata and extract contiguous data blocks ourselves
3. Wait for multi-thread support in HDF5
Any thoughts?
The text was updated successfully, but these errors were encountered: