[Story] Improve performance of regex processing in cuDF
- Dominant language
- C++
- Stars
- 9.8k
- Forks
- 1.1k
- Avg merge
- 3d 6m
- Merged PRs (30d)
- 278
Description
**Is your feature request related to a problem? Please describe.**
cuDF includes a precompiled regex (regular expression) engine that supports a wide set of regex patterns and good data processing throughput.
cuDF's regex engine uses a string-parallel approach, and shows lower data processing throughput with longer strings. Even for short strings, cuDF's regex engine shows a throughput much lower than the GPU global memory bandwidth.
This example shows pandas data processing throughput for `contains_re` around 3 GB/s, and cuDF data processing thoughput from 0.1 to 30 GB/s depending on string length.
| Approach | Outlook | Status |
|--|--|--|
| Use `cudf::transform` with UDF's (user defined functions) to JIT-compile efficient kernels for doing regex transformation | cuDF's JIT transform API can be used to complete regex transformations (see [blog](https://developer.nvidia.com/blog/efficient-transforms-in-cudf-using-jit-compilation/)). The conversion from regex pattern to UDF requires a translation. See this [example implementation](https://github.com/sirius-db/sirius/pull/171). | available since ~25.06 (https://github.com/rapidsai/cudf/pull/18490) |
| Add a utility to convert a compiled cuDF regex program into a UDF | cuDF regex processing goes through a compile step to parse the pattern before executing with the engine. The compiled program could be inspected and some types directly converted into UDFs. | |
| Add custom kernels to cuDF for some common regex patterns | cuDF could inspect the pattern and dispatch to a custom kernel instead of the full engine. | In progress in #22178 |
| Introduce a new regex engine based on [Glushkov automata](https://coursys.sfu.ca/2018fa-cmpt-384-d1/pages/GlushkovRE) |Add a bit-parallel Glushkov NFA regex engine to libcudf for compatible regex expressions. | In progress in #21936 |
| Expand microbenchmarks to cover the most important customer use cases | | |
Contributor guide
Assessment
This issue has not been assessed yet.