You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@gluten.apache.org by "jinchengchenghh (via GitHub)" <gi...@apache.org> on 2026/01/19 07:00:12 UTC

[PR] BroadcastExchange outputs cudf::table [incubator-gluten]

jinchengchenghh opened a new pull request, #11441:
URL: https://github.com/apache/incubator-gluten/pull/11441

   A follow up of https://github.com/apache/incubator-gluten/pull/11090, broadcast table is usually a small table, so we don't serialize to cudf format in the first step, just convert it to cudf table, this might be expensive for string data type.
   May optimize to serialize to cudf format and deserialize to cudf table as hash shuffle reader, copy the buffer to deserialize to cudf::table.
   
   Test in local with TPCDS Q95.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@gluten.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@gluten.apache.org
For additional commands, e-mail: commits-help@gluten.apache.org


Re: [PR] [GLUTEN-10933][VL] BroadcastExchange outputs cudf::table [incubator-gluten]

Posted by "jinchengchenghh (via GitHub)" <gi...@apache.org>.
jinchengchenghh merged PR #11441:
URL: https://github.com/apache/incubator-gluten/pull/11441


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@gluten.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@gluten.apache.org
For additional commands, e-mail: commits-help@gluten.apache.org


Re: [PR] BroadcastExchange outputs cudf::table [incubator-gluten]

Posted by "marin-ma (via GitHub)" <gi...@apache.org>.
marin-ma commented on code in PR #11441:
URL: https://github.com/apache/incubator-gluten/pull/11441#discussion_r2735529852


##########
cpp/velox/memory/GpuBufferColumnarBatch.cc:
##########
@@ -123,11 +128,21 @@ std::shared_ptr<GpuBufferColumnarBatch> GpuBufferColumnarBatch::compose(
         continue;
       }
       // Combine the null buffer
-      // The last byte may still have space to write when nullBitsRemainder != 0.
-      auto* dst = returnBuffers[bufferIdx]->mutable_data();
-      if (batch->bufferAt(bufferIdx) == nullptr) {
-        arrow::bit_util::SetBitsTo(dst, rowNumber, batch->numRows(), true);
+      if (batch->bufferAt(bufferIdx) == nullptr || batch->bufferAt(bufferIdx)->size() == 0) {
+        if (returnBuffers[bufferIdx] != nullptr) {
+          auto* dst = returnBuffers[bufferIdx]->mutable_data();
+          arrow::bit_util::SetBitsTo(dst, rowNumber, batch->numRows(), true);
+        }
       } else {
+        // Need to allocate null buffer.
+        if (returnBuffers[bufferIdx] == nullptr) {
+          std::shared_ptr<arrow::Buffer> buffer;
+          GLUTEN_ASSIGN_OR_THROW(buffer, arrow::AllocateResizableBuffer(bufferSizes[bufferIdx], pool));

Review Comment:
   Should it be `arrow::bit_util::BytesForBits(bufferSizes[bufferIdx])`?



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@gluten.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@gluten.apache.org
For additional commands, e-mail: commits-help@gluten.apache.org


Re: [PR] BroadcastExchange outputs cudf::table [incubator-gluten]

Posted by "jinchengchenghh (via GitHub)" <gi...@apache.org>.
jinchengchenghh commented on code in PR #11441:
URL: https://github.com/apache/incubator-gluten/pull/11441#discussion_r2735630652


##########
cpp/velox/memory/GpuBufferColumnarBatch.cc:
##########
@@ -123,11 +128,21 @@ std::shared_ptr<GpuBufferColumnarBatch> GpuBufferColumnarBatch::compose(
         continue;
       }
       // Combine the null buffer
-      // The last byte may still have space to write when nullBitsRemainder != 0.
-      auto* dst = returnBuffers[bufferIdx]->mutable_data();
-      if (batch->bufferAt(bufferIdx) == nullptr) {
-        arrow::bit_util::SetBitsTo(dst, rowNumber, batch->numRows(), true);
+      if (batch->bufferAt(bufferIdx) == nullptr || batch->bufferAt(bufferIdx)->size() == 0) {
+        if (returnBuffers[bufferIdx] != nullptr) {
+          auto* dst = returnBuffers[bufferIdx]->mutable_data();
+          arrow::bit_util::SetBitsTo(dst, rowNumber, batch->numRows(), true);
+        }
       } else {
+        // Need to allocate null buffer.
+        if (returnBuffers[bufferIdx] == nullptr) {
+          std::shared_ptr<arrow::Buffer> buffer;
+          GLUTEN_ASSIGN_OR_THROW(buffer, arrow::AllocateResizableBuffer(bufferSizes[bufferIdx], pool));

Review Comment:
   The bufferSizes is computed here, https://github.com/apache/incubator-gluten/pull/11441/changes#diff-ce18661fb719aacbaf297406b7d1dc8406164158b10644ce68b15cf51d94ea12R102, so it is bytes



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@gluten.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@gluten.apache.org
For additional commands, e-mail: commits-help@gluten.apache.org