Repository navigation
Description
Is this a duplicate?
- I confirmed there appear to be no duplicate issues for this bug and that I agree to the Code of Conduct
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
Metadata
Metadata
Assignees
Labels
Type
Projects
- StatusShow more project fieldsDone
Activity
github-actions commentedon Jan 7, 2026
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.
[-][BUG]: Performance regression in branch 3.2.0[/-][+][BUG]: Serious performance regression in branch 3.2.0[/+][-][BUG]: Serious performance regression in branch 3.2.0[/-][+][BUG]: Serious performance regression in branch 3.2.0 in cudf on Turing[/+]bernhardmgruber commentedon Jan 7, 2026
I assume this can be fixed by a tuning for Turing.
bernhardmgruber commentedon Jan 7, 2026
I tried running the benchmark but I need more instructions. I tried:
after reading
CONTRIBUTING.MDand tryingbuild.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 ofcub::DeviceTransformon Turing, which is easy to benchmark and fix. It could also bethrust::scatter, which is also based oncub::DeviceTransform.jrhemstad commentedon Jan 7, 2026
@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.
ttnghia commentedon Jan 7, 2026
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
cucointernal functions:vs
ttnghia commentedon Jan 7, 2026
Here are
ncuprofiling for the particular cuco kernelcontains_if_n:after.ncu-rep.zip
before.ncu-rep.zip
9 remaining items
[-][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[/+]miscco commentedon Jan 20, 2026
@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
bdice commentedon Jan 20, 2026
@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?
miscco commentedon Jan 20, 2026
Oh yeah sorry, that was the wrong bug 🙈
GregoryKimball commentedon Jan 20, 2026
@bernhardmgruber thank you for noting this:
Would you please let me know how cuDF can to influence whether the prefetching kernel or the vectorized kernel is used?
@ttnghia
How much of the regression does this address? Is changing settings in the CUB dispatcher a good workaround - or is there a better solution?
jrhemstad commentedon Jan 20, 2026
@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.
GregoryKimball commentedon Jan 20, 2026
OK, thank you for clarifying this @jrhemstad. I'm fine to close this then.
ttnghia commentedon Jan 20, 2026
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?
jrhemstad commentedon Jan 20, 2026
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.
bernhardmgruber commentedon Jan 21, 2026
@GregoryKimball
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
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.The baseline was 23.169ms as indicated in the issue description.
I want to point out that the performance of the
transform_kernelinsidethrust::scatterimproved 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:
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
cudaDeviceSynchronizeetc. (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.gevtushenko commentedon Oct 10, 2026
Closing as per @bernhardmgruber comment.