Skip to content

[BUG]: Serious performance regression in branch 3.2.0 in cudf on Hopper #7097

Closed

Description

@ttnghia

Is this a duplicate?

Type of Bug

Performance

Component

CUB

Describe the bug

In Rapids, after switching CCCL branch to 3.2.0, we observe a preformance regression that causes some of our code path to run at 2X slower speed. For example:

## [0] Quadro RTX 6000

|  num_rows  |  depth  |  null_frequency  |   Ref Time |   Ref Noise |   Cmp Time |   Cmp Noise |      Diff |   %Diff |  Status  |
|------------|---------|------------------|------------|-------------|------------|-------------|-----------|---------|----------|
|    1024    |    4    |        0         |  17.769 ms |       5.34% |  39.703 ms |       5.35% | 21.934 ms | 123.44% |   SLOW   |

We had to do bisection on CCCL commits branch 3.2.X to investigate. The bisection process is not easy, as we had to go back in time across various repositories at the same time, fixing various building issues (due to changes in the build systems across various projects).

Finally, the root cause is found:

Checked out that commit:

| num_rows | depth | null_frequency | Samples | CPU Time  | Noise | GPU Time  | Noise |
|----------|-------|----------------|---------|-----------|-------|-----------|-------|
|     1024 |     4 |              0 |    374x | 40.160 ms | 5.06% | 40.154 ms | 5.06% |

Moving back one commit before it, and the performance gets back to normal:

| num_rows | depth | null_frequency | Samples | CPU Time  | Noise | GPU Time  | Noise |
|----------|-------|----------------|---------|-----------|-------|-----------|-------|
|     1024 |     4 |              0 |    647x | 23.169 ms | 5.68% | 23.163 ms | 5.66% |

Since 2X slow down regression is serious, we would like to have it fixed for our 26.02 release.

How to Reproduce

In cudf, build the benchmark SET_OPS_NVBENCH and run this particular one:

SET_OPS_NVBENCH --benchmark have_overlap --axis null_frequency=0 --axis depth=4 --axis num_rows=1024

Expected behavior

The runtime should be around 20ms.

Reproduction link

No response

Operating System

No response

nvidia-smi output

No response

NVCC version

No response

Activity

  1. github-actions commented on Jan 7, 2026

    @github-actions
    Contributor

    Hi @ttnghia!

    Thanks for submitting this issue - the CCCL team has been notified and we'll get back to you as soon as we can!
    In the mean time, feel free to add any relevant information to this issue.

  2. added
    needs triage
    on Jan 7, 2026
  3. changed the title [-][BUG]: Performance regression in branch 3.2.0[/-] [+][BUG]: Serious performance regression in branch 3.2.0[/+] on Jan 7, 2026
  4. removed
    needs triage
    on Jan 7, 2026
  5. changed the title [-][BUG]: Serious performance regression in branch 3.2.0[/-] [+][BUG]: Serious performance regression in branch 3.2.0 in cudf on Turing[/+] on Jan 7, 2026
  6. bernhardmgruber commented on Jan 7, 2026

    @bernhardmgruber
    Contributor

    I assume this can be fixed by a tuning for Turing.

  7. bernhardmgruber commented on Jan 7, 2026

    @bernhardmgruber
    Contributor

    I tried running the benchmark but I need more instructions. I tried:

    git clone [email protected]:rapidsai/cudf.git
    cd cudf
    ./build.sh benchmark
    

    after reading CONTRIBUTING.MD and trying build.sh --help.

    I also tried to locate the code that is covered by the benchmark and it seems to be here: https://github.com/rapidsai/cudf/blob/d9b84df0ddccadaae0d602b797b5407a374111f5/cpp/src/lists/set_operations.cu#L52. Inside this function I see a call to thrust::uninitialized_fill. Can you confirm that this call is causing the slowdown? Because then the regression is caused by the fill performance of cub::DeviceTransform on Turing, which is easy to benchmark and fix. It could also be thrust::scatter, which is also based on cub::DeviceTransform.

  8. jrhemstad commented on Jan 7, 2026

    @jrhemstad
    Collaborator

    @ttnghia it'd be helpful if you could provide an nsight systems profile before/after the regression to identify exactly which kernel is slower or where the increased time is spent.

  9. ttnghia commented on Jan 7, 2026

    @ttnghia
    Author

    Sure, here are the profiling for them, code were compiled with just switching CCCL versions.

    CCCL-3.1.3-one-bench.nsys-rep.zip
    CCCL-3.2.0-one-bench.nsys-rep.nsys-rep.zip

    The main changes were observed when calling cuco internal functions:

    Image

    vs

    Image
  10. ttnghia commented on Jan 7, 2026

    @ttnghia
    Author

    Here are ncu profiling for the particular cuco kernel contains_if_n:

    after.ncu-rep.zip
    before.ncu-rep.zip

  11. 9 remaining items

  12. moved this from Burndown to Slip in libcudfon Jan 20, 2026
  13. changed the title [-][BUG]: Serious performance regression in branch 3.2.0 in cudf on Turing[/-] [+][BUG]: Serious performance regression in branch 3.2.0 in cudf on Hopper[/+] on Jan 20, 2026
  14. miscco commented on Jan 20, 2026

    @miscco
    Contributor

    @GregoryKimball the bug should be fixed in main / 3.2

    We will do a followup discussion with probably @bdice to see whether the current "batteries included" approach is the right one or whether we want to rather fail than silently run on a default stream

  15. bdice commented on Jan 20, 2026

    @bdice
    Contributor

    @miscco I think you might've mixed up this issue with a different one. Is this related to default streams? Which PR/commit fixed this?

  16. miscco commented on Jan 20, 2026

    @miscco
    Contributor

    Oh yeah sorry, that was the wrong bug 🙈

  17. GregoryKimball commented on Jan 20, 2026

    @GregoryKimball

    @bernhardmgruber thank you for noting this:

    I can see that in CCCL 3.1.3 it definitely used the prefetching kernel, and in CCCL 3.2.0 it almost certainly used the vectorized kernel

    Would you please let me know how cuDF can to influence whether the prefetching kernel or the vectorized kernel is used?

    @ttnghia

    when he sets can_vectorize = false in the CUB dispatcher, forcing the vectorized kernel to fallback to the prefetching kernel at runtime, the benchmark runtime decreases from 40ms to 30ms

    How much of the regression does this address? Is changing settings in the CUB dispatcher a good workaround - or is there a better solution?

  18. jrhemstad commented on Jan 20, 2026

    @jrhemstad
    Collaborator

    @GregoryKimball to be clear, this isn't actually a performance regression and is an artifact of the benchmarking setup.

    nvbench attempts to provide more stable measurements between successive iterations of a benchmark by flushing the L2 cache. Based on @bernhardmgruber's analysis, it looks like the L2 cache flushing wasn't working correctly prior to CCCL PR in question, but after @bernhardmgruber 's change, it looks like the L2 cache flush is working correctly which then makes it seem like the benchmark is slower (confirmed by the L2 hit rate reducing after the change).

    TL;DR: There's no real cause for concern here. The cudf benchmark before appeared faster because it was exploiting data still resident in L2 between successive iterations in the benchmark.

  19. GregoryKimball commented on Jan 20, 2026

    @GregoryKimball

    OK, thank you for clarifying this @jrhemstad. I'm fine to close this then.

  20. ttnghia commented on Jan 20, 2026

    @ttnghia
    Author

    Sorry I'm still not totally clear why the other benchmark are not affected by this change? In particular, why the same benchmark without nested type is not affected by L2 cache flush?

  21. jrhemstad commented on Jan 20, 2026

    @jrhemstad
    Collaborator

    Sorry I'm still not totally clear why the other benchmark are not affected by this change? In particular, why the same benchmark without nested type is not affected by L2 cache flush?

    Unclear. Other benchmarks may not be as sensitive to L2 residency. Given the kernels are identical before and after the change, we are confident that this isn't a real regression.

  22. bernhardmgruber commented on Jan 21, 2026

    @bernhardmgruber
    Contributor

    @GregoryKimball

    @bernhardmgruber would you please update the issue title to "Hopper" instead of "Turing"?

    The entire analysis above was done for Turning, so it makes sense to keep Turning in the name of the issue. If you want to

    Would you please let me know how cuDF can to influence whether the prefetching kernel or the vectorized kernel is used?

    You cannot in the current design of CCCL. The transform implementation we use has a set of tunings which influence which algorithm is chosen and how it is parameterized. This is currently entirely owned by us. We do plan to open this infrastructure as part of #7165, but it only affects CUB for now and you are using thrust::scatter. I don't know whether and when we would expose supplying tunings to Thrust algorithms.

    when he sets can_vectorize = false in the CUB dispatcher, forcing the vectorized kernel to fallback to the prefetching kernel at runtime, the benchmark runtime decreases from 40ms to 30ms

    How much of the regression does this address? Is changing settings in the CUB dispatcher a good workaround - or is there a better solution?

    The baseline was 23.169ms as indicated in the issue description.

    I want to point out that the performance of the transform_kernel inside thrust::scatter improved from 7.672μs to 6.630μs as indicated by the nsys traces from @ttnghia, so CCCL 3.2 did ship an improvement.

    About what @jrhemstad said above:

    TL;DR: There's no real cause for concern here. The cudf benchmark before appeared faster because it was exploiting data still resident in L2 between successive iterations in the benchmark.

    This is the best explanation I can offer today given the SASS of contains_if_n, running after the transform kernel and L2 flush by nvbench, is identical, but the performance is 2x slower. It must be an artifact of the GPU's state.

    We did suggest running a warm/batch benchmark (running the benchmark region back to back without L2 flush and measuring the average runtime) to rule this out on Slack. However, as pointed out by @gevtushenko, this may need changes to nvbench since we cannot currently do batch measurements when the benchmark region contains calls to cudaDeviceSynchronize etc. (which Thrust does). @ttnghia you could emulate this yourself though, by just putting e.g. a loop with 100+ iterations inside the benchmark region and emulate a batch benchmark this way.

  23. gevtushenko commented on Oct 10, 2026

    @gevtushenko
    Collaborator

    Closing as per @bernhardmgruber comment.

  24. moved this from Todo to Done in CCCLon Oct 10, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

No labels
No labels

Type

Projects

  • Status
    Done

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions