Skip to content
Draft
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
10 changes: 5 additions & 5 deletions .github/workflows/linux-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -65,11 +65,11 @@ jobs:
# TODO: Install a newer cmake here until we update the images upstream
pip install cmake==3.30.4

- uses: assignUser/stash/restore@v1
with:
token: '${{ secrets.ARTIFACT_CACHE_TOKEN }}'
path: '${{ env.CCACHE_DIR }}'
key: ccache-linux-adapters
# - uses: assignUser/stash/restore@v1
# with:
# token: '${{ secrets.ARTIFACT_CACHE_TOKEN }}'
# path: '${{ env.CCACHE_DIR }}'
# key: ccache-linux-adapters

- name: "Zero Ccache Statistics"
run: |
Expand Down
34 changes: 33 additions & 1 deletion velox/experimental/cudf/exec/CudfConversion.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,12 @@ RowVectorPtr CudfFromVelox::getOutput() {

// Combine selected RowVectors into a single RowVector
auto input = mergeRowVectors(selectedInputs, inputs_[0]->pool());

// print physical type of each column in output
for (auto i = 0; i < input->type()->size(); i++) {
std::cout << "input column " << i
<< " type: " << input->childAt(i)->type()->toString() << " "
<< input->childAt(i)->type()->kindName() << std::endl;
}
// Remove processed inputs
inputs_.erase(inputs_.begin(), inputs_.begin() + selectedInputs.size());
currentOutputSize_ -= totalSize;
Expand All @@ -134,6 +139,12 @@ RowVectorPtr CudfFromVelox::getOutput() {

// Convert RowVector to cudf table
auto tbl = with_arrow::toCudfTable(input, input->pool(), stream);
// print types of tbl->view()
for (auto i = 0; i < tbl->num_columns(); i++) {
std::cout << "input cudf column " << i
<< " type: " << static_cast<int>(tbl->get_column(i).type().id())
<< std::endl;
}

stream.synchronize();

Expand Down Expand Up @@ -206,8 +217,29 @@ RowVectorPtr CudfToVelox::getOutput() {
}
RowVectorPtr output =
with_arrow::toVeloxColumn(tbl->view(), pool(), "", stream);

// print types of tbl->view()
for (auto i = 0; i < tbl->num_columns(); i++) {
std::cout << "cudf column " << i
<< " type: " << static_cast<int>(tbl->get_column(i).type().id())
<< std::endl;
}
stream.synchronize();
finished_ = noMoreInput_ && inputs_.empty();
std::cout << "output.type: " << output->type()->toString() << std::endl;
std::cout << "outputType_: " << outputType_->toString() << std::endl;
// print physical type of each column in output
for (auto i = 0; i < output->type()->size(); i++) {
std::cout << "column " << i
<< " type: " << output->childAt(i)->type()->toString() << " "
<< output->childAt(i)->type()->kindName() << std::endl;
}
// print physical type of each column in outputType_
for (auto i = 0; i < outputType_->size(); i++) {
std::cout << "column " << i
<< " type: " << outputType_->childAt(i)->toString() << " "
<< outputType_->childAt(i)->kindName() << std::endl;
}
output->setType(outputType_);
return output;
}
Expand Down
29 changes: 29 additions & 0 deletions velox/experimental/cudf/exec/VeloxCudfInterop.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,34 @@ cudf::type_id velox_to_cudf_type_id(const TypePtr& type) {
}
namespace with_arrow {

// Print ArrowSchema format strings recursively
void printArrowSchemaFormat(const ArrowSchema& arrowSchema, int depth = 0) {
std::string indent(depth * 2, ' ');
if (depth == 0) {
std::cout << "arrowSchema.format: " << arrowSchema.format << std::endl;
}

for (int64_t i = 0; i < arrowSchema.n_children; ++i) {
const ArrowSchema* child = arrowSchema.children[i];
if (child != nullptr) {
std::cout << indent << " child[" << i << "].format: " << child->format
<< std::endl;
if (child->n_children > 0) {
printArrowSchemaFormat(*child, depth + 1);
}
}
}

if (arrowSchema.dictionary != nullptr) {
std::cout << indent
<< " dictionary.format: " << arrowSchema.dictionary->format
<< std::endl;
if (arrowSchema.dictionary->n_children > 0) {
printArrowSchemaFormat(*arrowSchema.dictionary, depth + 1);
}
}
}

std::unique_ptr<cudf::table> toCudfTable(
const facebook::velox::RowVectorPtr& veloxTable,
facebook::velox::memory::MemoryPool* pool,
Expand All @@ -102,6 +130,7 @@ std::unique_ptr<cudf::table> toCudfTable(
std::dynamic_pointer_cast<facebook::velox::BaseVector>(veloxTable),
arrowSchema,
arrowOptions);
printArrowSchemaFormat(arrowSchema);
auto tbl = cudf::from_arrow(&arrowSchema, &arrowArray, stream);

// Release Arrow resources
Expand Down
Loading
Loading