Skip to content

Conversation

davidwendt
Copy link
Contributor

Description

Improves performance of nvtext::edit_distance for long strings. Also includes automatic specialization logic if both strings are ASCII.

Checklist

  • I am familiar with the Contributing Guidelines.
  • New or existing tests cover these changes.
  • The documentation is up to date with these changes.

@davidwendt davidwendt self-assigned this Oct 15, 2025
@davidwendt davidwendt added 2 - In Progress Currently a work in progress libcudf Affects libcudf (C++/CUDA) code. strings strings issues (C++ and Python) improvement Improvement / enhancement to an existing function non-breaking Non-breaking change labels Oct 15, 2025
Copy link

copy-pr-bot bot commented Oct 15, 2025

Auto-sync is disabled for draft pull requests in this repository. Workflows must be run manually.

Contributors can view more details about this message here.

@davidwendt
Copy link
Contributor Author

/ok to test

@davidwendt
Copy link
Contributor Author

Significant performance improvement especially for ASCII-only strings

## [0] NVIDIA RTX A6000

| max_width | num_rows | encode |   Ref Time |   Cmp Time |             Diff |   %Diff | x-fact |
|-----------|----------|--------|------------|------------|------------------|---------|--------|
|    32     |  262144  |  utf8  |  12.887 ms |  12.578 ms |      -309.026 us |  -2.40% |   1.02 |
|    64     |  262144  |  utf8  |  80.347 ms |  58.244 ms |    -22103.273 us | -27.51% |   1.38 |
|    128    |  262144  |  utf8  | 391.478 ms | 234.355 ms |   -157123.496 us | -40.14% |   1.67 |
|    256    |  262144  |  utf8  |    2.002 s | 883.826 ms |  -1118424.708 us | -55.86% |   2.27 |
|    512    |  262144  |  utf8  |    9.540 s |    3.420 s |  -6120318.262 us | -64.16% |   2.79 |
|    32     |  524288  |  utf8  |  24.302 ms |  25.638 ms |         1.336 ms |   5.50% |   0.95 |
|    64     |  524288  |  utf8  | 157.387 ms | 118.402 ms |    -38984.591 us | -24.77% |   1.33 |
|    128    |  524288  |  utf8  | 779.004 ms | 477.665 ms |   -301338.373 us | -38.68% |   1.63 |
|    256    |  524288  |  utf8  |    3.996 s |    1.815 s |  -2180760.546 us | -54.58% |   2.20 |
|    512    |  524288  |  utf8  |   19.229 s |    6.945 s | -12284391.602 us | -63.88% |   2.77 |
|    32     | 1048576  |  utf8  |  47.597 ms |  52.549 ms |         4.952 ms |  10.40% |   0.91 |
|    64     | 1048576  |  utf8  | 314.666 ms | 242.207 ms |    -72459.678 us | -23.03% |   1.30 |
|    128    | 1048576  |  utf8  |    1.585 s | 975.456 ms |   -609072.692 us | -38.44% |   1.62 |
|    256    | 1048576  |  utf8  |    8.085 s |    3.640 s |  -4444833.105 us | -54.98% |   2.22 |
|    512    | 1048576  |  utf8  |   38.732 s |   13.862 s | -24870030.273 us | -64.21% |   2.79 |
|    32     |  262144  | ascii  |  17.049 ms |   1.806 ms |    -15243.559 us | -89.41% |   9.44 |
|    64     |  262144  | ascii  |  99.806 ms |   3.642 ms |    -96163.753 us | -96.35% |  27.40 |
|    128    |  262144  | ascii  | 489.308 ms |   8.708 ms |   -480599.495 us | -98.22% |  56.19 |
|    256    |  262144  | ascii  |    2.388 s |  25.151 ms |  -2363337.780 us | -98.95% |  94.95 |
|    512    |  262144  | ascii  |   11.541 s |  88.843 ms | -11452008.151 us | -99.23% | 129.90 |
|    32     |  524288  | ascii  |  31.705 ms |   3.577 ms |    -28127.826 us | -88.72% |   8.86 |
|    64     |  524288  | ascii  | 194.952 ms |   7.244 ms |   -187708.149 us | -96.28% |  26.91 |
|    128    |  524288  | ascii  | 968.365 ms |  17.294 ms |   -951070.746 us | -98.21% |  55.99 |
|    256    |  524288  | ascii  |    4.755 s |  49.759 ms |  -4705105.365 us | -98.95% |  95.56 |
|    512    |  524288  | ascii  |   22.977 s | 176.072 ms | -22801365.071 us | -99.23% | 130.50 |
|    32     | 1048576  | ascii  |  62.382 ms |   7.071 ms |    -55310.036 us | -88.66% |   8.82 |
|    64     | 1048576  | ascii  | 391.860 ms |  14.391 ms |   -377468.664 us | -96.33% |  27.23 |
|    128    | 1048576  | ascii  |    1.919 s |  34.574 ms |  -1884560.540 us | -98.20% |  55.50 |
|    256    | 1048576  | ascii  |    9.622 s |  98.889 ms |  -9522836.434 us | -98.97% |  97.30 |
|    512    | 1048576  | ascii  |   46.157 s | 350.337 ms | -45806776.051 us | -99.24% | 131.75 |

@davidwendt
Copy link
Contributor Author

/ok to test

@davidwendt
Copy link
Contributor Author

/ok to test

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

2 - In Progress Currently a work in progress improvement Improvement / enhancement to an existing function libcudf Affects libcudf (C++/CUDA) code. non-breaking Non-breaking change strings strings issues (C++ and Python)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant