You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In spark-rapids, we use cudf::pack (in reality we cudf::contiguous_split with empty splits) to layout a cudf table with its various data, validity, offsets buffers and potential children, into a contiguous buffer described by metadata produced by cuDF. This has been a key operation for us to turn a table into something that we can trivially move to host or disk (spill). Because tables can be quite large, we have found that requiring them to be contiguous in memory, adds quite a bit of memory pressure and fragments the memory pool. Some tables can be GBs in size, so in order to satisfy the allocation needed for pack to return a contiguous buffer, we can actually introduce even more spill.
Lately we have been making more use of the spill framework as we are now able to retry some cuDF operations: NVIDIA/spark-rapids#7252. We would like to be able to turn cuDF tables into "spillable tables" without requiring a premeditated pack, instead performing the pack in chunks when it is actually needed. This means we want to call pack with a bounce buffer, ensuring that no large allocations happen during this process.
After the first invocation to pack, the bounce buffer contents are copied to host (where an allocation equal to the original contiguous size is waiting to be filled). We then keep calling pack iteratively, not unlike the other chunked interfaces in cuDF.
I've been working on this together with @nvdbaranec. I am going to post a series of PRs that get us there, but overall here's the plan:
Introduce a new metadata_builder that is used by the prior code, but allows us to create metadata without having to generate cudf::column to begin with: Add metadata_builder helper class #13232
In spark-rapids, we use
cudf::pack
(in reality wecudf::contiguous_split
with empty splits) to layout a cudf table with its various data, validity, offsets buffers and potential children, into a contiguous buffer described by metadata produced by cuDF. This has been a key operation for us to turn a table into something that we can trivially move to host or disk (spill). Because tables can be quite large, we have found that requiring them to be contiguous in memory, adds quite a bit of memory pressure and fragments the memory pool. Some tables can be GBs in size, so in order to satisfy the allocation needed forpack
to return a contiguous buffer, we can actually introduce even more spill.Lately we have been making more use of the spill framework as we are now able to retry some cuDF operations: NVIDIA/spark-rapids#7252. We would like to be able to turn cuDF tables into "spillable tables" without requiring a premeditated
pack
, instead performing thepack
in chunks when it is actually needed. This means we want to callpack
with a bounce buffer, ensuring that no large allocations happen during this process.After the first invocation to pack, the bounce buffer contents are copied to host (where an allocation equal to the original contiguous size is waiting to be filled). We then keep calling pack iteratively, not unlike the other
chunked
interfaces in cuDF.I've been working on this together with @nvdbaranec. I am going to post a series of PRs that get us there, but overall here's the plan:
copying.hpp
into a new headercontiguous_split.hpp
: Refactor contiguous_split API into contiguous_split.hpp #13186metadata_builder
that is used by the prior code, but allows us to create metadata without having to generatecudf::column
to begin with: Add metadata_builder helper class #13232chunked_pack
: API Implement a chunked_pack API #13260chunked_pack
JNI changes: JNI api for cudf::chunked_pack #13278The text was updated successfully, but these errors were encountered: