Skip to content
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

[FEA] Support batch construction of strings columns #16486

Closed
ttnghia opened this issue Aug 2, 2024 · 1 comment · Fixed by #17035
Closed

[FEA] Support batch construction of strings columns #16486

ttnghia opened this issue Aug 2, 2024 · 1 comment · Fixed by #17035
Assignees
Labels
feature request New feature or request libcudf Affects libcudf (C++/CUDA) code. Performance Performance related issue

Comments

@ttnghia
Copy link
Contributor

ttnghia commented Aug 2, 2024

In our framework, we often see this pattern:

for(auto& output_pairs: output_pair_buffers) {
    output.emplace_back(cudf::make_strings_column(output_pairs, stream, mr));
}

That means there are a lot of calls to cudf::make_strings_column, involving a lot of stream synchronization (at least two stream syncs per call: one when generating offsets and one when generating bitmask). In case we have 10, 20 30 etc output columns, having such high count number of stream syncs is very inefficient.

We can do better by implementing a batch construction for strings columns, deferring stream syncs until absolutely necessary. There may be just one stream sync needed for the entire process.

The next optimization level could be to fuse the involved kernels together: instead of calling a separate kernel for constructing each column, we call just one kernel for all columns. For example, calling one valid_if kernel for generating nullmask for all columns, one copy kernel for generating chars data of all columns etc.

@ttnghia ttnghia added the feature request New feature or request label Aug 2, 2024
@github-project-automation github-project-automation bot moved this to In Progress in cuDF/Dask/Numba/UCX Aug 2, 2024
@ttnghia ttnghia self-assigned this Aug 2, 2024
@ttnghia
Copy link
Contributor Author

ttnghia commented Aug 2, 2024

@ttnghia ttnghia changed the title [FEA] Support batch construction of strings column [FEA] Support batch construction of strings columns Aug 2, 2024
@PointKernel PointKernel added libcudf Affects libcudf (C++/CUDA) code. Performance Performance related issue labels Oct 16, 2024
rapids-bot bot pushed a commit that referenced this issue Oct 17, 2024
This implements batch construction of strings columns, allowing to create a large number of strings columns at once with minimal overhead of kernel launch and stream synchronization. There should be only one stream sync in the entire column construction process.

Benchmark: #17035 (comment)

Closes #16486.

Authors:
  - Nghia Truong (https://github.com/ttnghia)

Approvers:
  - David Wendt (https://github.com/davidwendt)
  - Yunsong Wang (https://github.com/PointKernel)

URL: #17035
@github-project-automation github-project-automation bot moved this from In Progress to Done in cuDF/Dask/Numba/UCX Oct 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature request New feature or request libcudf Affects libcudf (C++/CUDA) code. Performance Performance related issue
Projects
Status: Done
Development

Successfully merging a pull request may close this issue.

2 participants