Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions cpp/velox/memory/VeloxColumnarBatch.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,13 @@ class VeloxColumnarBatch final : public ColumnarBatch {
VeloxColumnarBatch(facebook::velox::RowVectorPtr rowVector)
: ColumnarBatch(rowVector->childrenSize(), rowVector->size()), rowVector_(rowVector) {}

#ifdef GLUTEN_ENABLE_GPU
// The batch may be CudfVector, it's childrenSize is not correct, many tests failed if correcting the value
// https://github.com/facebookincubator/velox/pull/15629#discussion_r2581655771
VeloxColumnarBatch(facebook::velox::RowVectorPtr rowVector, int32_t numColumns)
: ColumnarBatch(numColumns, rowVector->size()), rowVector_(rowVector) {}
#endif
Comment on lines +32 to +37
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Compared to adding a new ctor, what if we just change the old ctor to call rowVector->rowType()->size()?

By the way. Why childrenSize() is inaccurate for cuDF row vector?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Because the childrenSize() always returns 0, RowVector contains flatVector, but CudfVector contains cudf::table(contains cudf::column)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.


std::string getType() const override {
return kType;
}
Expand Down
2 changes: 1 addition & 1 deletion cpp/velox/utils/GpuBufferBatchResizer.cc
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ std::shared_ptr<VeloxColumnarBatch> makeCudfTable(
auto cudfTable = std::make_unique<cudf::table>(std::move(cudfColumns));
stream.synchronize();
return std::make_shared<VeloxColumnarBatch>(
std::make_shared<cudf_velox::CudfVector>(pool, type, numRows, std::move(cudfTable), stream));
std::make_shared<cudf_velox::CudfVector>(pool, type, numRows, std::move(cudfTable), stream), type->size());
}

} // namespace
Expand Down