-
Notifications
You must be signed in to change notification settings - Fork 232
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
Add framework for batch compression of shuffle partitions #487
Conversation
Signed-off-by: Jason Lowe <jlowe@nvidia.com>
build |
build |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is just a first pass @jlowe I have more than 1/2 to review.
sql-plugin/src/main/scala/com/nvidia/spark/rapids/TableCompressionCodec.scala
Outdated
Show resolved
Hide resolved
sql-plugin/src/main/scala/com/nvidia/spark/rapids/TableCompressionCodec.scala
Show resolved
Hide resolved
sql-plugin/src/main/scala/com/nvidia/spark/rapids/RapidsDeviceMemoryStore.scala
Show resolved
Hide resolved
sql-plugin/src/main/java/com/nvidia/spark/rapids/GpuCompressedColumnVector.java
Show resolved
Hide resolved
sql-plugin/src/main/scala/com/nvidia/spark/rapids/RapidsBufferStore.scala
Outdated
Show resolved
Hide resolved
sql-plugin/src/main/scala/com/nvidia/spark/rapids/RapidsBufferStore.scala
Outdated
Show resolved
Hide resolved
sql-plugin/src/main/scala/com/nvidia/spark/rapids/RapidsConf.scala
Outdated
Show resolved
Hide resolved
sql-plugin/src/main/scala/com/nvidia/spark/rapids/GpuCoalesceBatches.scala
Show resolved
Hide resolved
sql-plugin/src/main/scala/com/nvidia/spark/rapids/RapidsBufferStore.scala
Outdated
Show resolved
Hide resolved
sql-plugin/src/main/scala/com/nvidia/spark/rapids/TableCompressionCodec.scala
Outdated
Show resolved
Hide resolved
sql-plugin/src/main/scala/com/nvidia/spark/rapids/TableCompressionCodec.scala
Outdated
Show resolved
Hide resolved
sql-plugin/src/main/scala/com/nvidia/spark/rapids/TableCompressionCodec.scala
Outdated
Show resolved
Hide resolved
sql-plugin/src/main/scala/com/nvidia/spark/rapids/TableCompressionCodec.scala
Show resolved
Hide resolved
sql-plugin/src/main/scala/com/nvidia/spark/rapids/TableCompressionCodec.scala
Outdated
Show resolved
Hide resolved
sql-plugin/src/main/scala/com/nvidia/spark/rapids/TableCompressionCodec.scala
Show resolved
Hide resolved
sql-plugin/src/main/scala/com/nvidia/spark/rapids/TableCompressionCodec.scala
Outdated
Show resolved
Hide resolved
sql-plugin/src/main/scala/com/nvidia/spark/rapids/TableCompressionCodec.scala
Outdated
Show resolved
Hide resolved
@jlowe I got through the rest of it. Let me know when to re-check. |
Signed-off-by: Jason Lowe <jlowe@nvidia.com>
Signed-off-by: Jason Lowe <jlowe@nvidia.com>
build |
This needs to be upmerged to the latest on branch-0.2. |
Signed-off-by: Jason Lowe <jlowe@nvidia.com>
Signed-off-by: Jason Lowe <jlowe@nvidia.com>
build |
Signed-off-by: Jason Lowe <jlowe@nvidia.com>
build |
Signed-off-by: Jason Lowe <jlowe@nvidia.com>
build |
@revans2 can you take another look? I needed to upmerge to the latest on branch-0.2. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me. I am fine with it as is, just was curious if it would be cleaner?
@@ -590,8 +590,27 @@ object RapidsConf { | |||
.bytesConf(ByteUnit.BYTE) | |||
.createWithDefault(50 * 1024) | |||
|
|||
val SHUFFLE_COMPRESSION_ENABLED = conf("spark.rapids.shuffle.compression.enabled") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am OK with two configs for this, but why not just set the codec to NONE, or something like that to disable it?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was emulating Spark's shuffle config where the compression codec and compression enable are separate.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updated this to use a single config for the shuffle codec, with none
indicating no shuffle compression codec should be used.
Signed-off-by: Jason Lowe <jlowe@nvidia.com>
Holding off on the CI build for now. Waiting on the HashJoin fix for 3.1 and updated cudf with the fix for rapidsai/cudf#5915 which was found during the added unit tests in this PR. |
build |
* Add framework for batch compression of shuffle partitions Signed-off-by: Jason Lowe <jlowe@nvidia.com> * Extract common row accessor methods to GpuColumnVectorBase Signed-off-by: Jason Lowe <jlowe@nvidia.com> * Address review comments Signed-off-by: Jason Lowe <jlowe@nvidia.com> * Fix handling of degenerate batches Signed-off-by: Jason Lowe <jlowe@nvidia.com> * Fix buffer leak Signed-off-by: Jason Lowe <jlowe@nvidia.com> * Add comment about degenerate batches potentially appearing compressed Signed-off-by: Jason Lowe <jlowe@nvidia.com> * Use a shuffle compression codec of "none" to indicate no compression Signed-off-by: Jason Lowe <jlowe@nvidia.com>
* Add framework for batch compression of shuffle partitions Signed-off-by: Jason Lowe <jlowe@nvidia.com> * Extract common row accessor methods to GpuColumnVectorBase Signed-off-by: Jason Lowe <jlowe@nvidia.com> * Address review comments Signed-off-by: Jason Lowe <jlowe@nvidia.com> * Fix handling of degenerate batches Signed-off-by: Jason Lowe <jlowe@nvidia.com> * Fix buffer leak Signed-off-by: Jason Lowe <jlowe@nvidia.com> * Add comment about degenerate batches potentially appearing compressed Signed-off-by: Jason Lowe <jlowe@nvidia.com> * Use a shuffle compression codec of "none" to indicate no compression Signed-off-by: Jason Lowe <jlowe@nvidia.com>
Signed-off-by: spark-rapids automation <70000568+nvauto@users.noreply.github.com> Signed-off-by: spark-rapids automation <70000568+nvauto@users.noreply.github.com>
This adds
TableCompressionCodec
, an interface for compression codecs that can compress contiguous table buffers. A single trivial copy codec is provided just for testing. Other codecs can be added in the future.Batch compression is supported and utilized in the partitioning code when using the RAPIDS UCX shuffle plugin which produces contiguous tables. Batch decompression is supported and utilized in the batch coalescing that is inserted into the query after each shuffle. The coalesce code automatically detects compressed shuffle buffers and handles a mix of uncompressed and compressed batches arriving to be coalesced.
If desired I can split this PR into smaller pieces (e.g.: just adding TableCompressor and copy codec, then separate PR to plug it into partitioning and coalescing). I opted to do a single PR initially so it was clear how the table compression APIs were being used in practice.