NVIDIA / NVIDIA/cudf

[FEA] Refactor expensive string APIs, combining two kernel calls into one

Open
#16,073 3 comments 0 reactions 0 assignees View on GitHub
feature request libcudf strings wontfix
Dominant language
C++
Stars
9.8k
Forks
1.1k
Avg merge
3d 6m
Merged PRs (30d)
278

Description

Currently, most string APIs perform their work by calling their main kernel twice, one for computing the output string sizes and one for writing the output strings.

There is a technique that has a potential performance improvement:
* Firstly, allocate an output buffer that is large enough to write the output without knowing the output string sizes.
* The main kernel is then called only once, writing both the output string sizes and the output strings into the buffer above.
* Finally, a string factory function is called to gather the strings and sizes above.

Note that the aforementioned technique can improve the performance of expensive string APIs, when the second kernel call is more expensive than the final string gather step. Otherwise it does not provide any benefit.

In addition, the first step is not always trivial. In some cases it is easy to know the upper limit of the output size (like less than 20 bytes when converting integer to string) but some other cases we may want to call a quick heuristic kernel.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.