Skip to content

feat(hipccl): hipCUB's parity with CCCL 3.1.x - #13083

Open
Beanavil wants to merge 66 commits into
developfrom
users/beanavil/hipccl/hipcub-cccl-3-1-parity-upstream
Open

Beanavil wants to merge 66 commits into
developfrom
users/beanavil/hipccl/hipcub-cccl-3-1-parity-upstream

Conversation

@Beanavil

@Beanavil Beanavil commented Oct 5, 2026

Copy link
Copy Markdown
Member

Motivation

Add CCCL 3.1.x support to hipCUB and rocPRIM libraries.

The branch in this PR is the same as in #11292 but with the changes ported to the new directory structure.

JIRA ID : EXSWSTRHPC-320

Technical Details

Branch is based on the staging branch, which includes all the CCCL 3.0.x updates.

Most relevant changes:

  • Added support for large number of segments and large number of items to DeviceSegmentedRadixSort
  • Added WarpReduce overloadings
  • Added fixed size segmented reduce
  • Removed deprecated thread operators
  • Added support for large num_segments to DeviceSegmentedReduce with fixed segment size
  • Added support for large number of items to DeviceRunLengthEncode::Encode
  • Added env-based API for DeviceReduce
  • Bumped CCCL version to 3.1.4
  • Promoted libhipcxx to hard-dependency, also on Windows

Test Plan

Internal+AMD's CI runs

Test Result

Internal CI passes. AMD CI should be checked now

Submission Checklist

@Beanavil Beanavil changed the title feat(hipcub,rocprim): Add CCCL 3.1.x support feat(hipccl): hipCUB's parity with CCCL 3.1.x Oct 5, 2026
@Naraenda
Naraenda force-pushed the users/naraenda/hipccl-3.x-staging branch from 2ec1db0 to c5ccc3d Compare October 5, 2026 14:31
@Naraenda Naraenda mentioned this pull request Oct 5, 2026
1 task done
@Beanavil
Beanavil force-pushed the users/beanavil/hipccl/hipcub-cccl-3-1-parity-upstream branch from 407c119 to a93bbfb Compare October 7, 2026 10:30
Base automatically changed from users/naraenda/hipccl-3.x-staging to develop October 9, 2026 22:16
@therock-pr-bot

therock-pr-bot Bot commented Oct 9, 2026 •

Copy link
Copy Markdown

✅ All Checks Passed — Ready for Review

Check Status Details
📝 PR Description ✅ Pass —
⛔ Forbidden Files ✅ Pass —
🧪 Unit Test ✅ Pass —
🔎 pre-commit ✅ Pass —
🚫 Draft PR 🔜 To Be Enabled —
🚩 Feature Flag 🔜 To Be Enabled —
📊 Code Coverage 🔜 To Be Enabled —
🤖 therock-pr-bot ✅ Pass —

🎉 All checks passed! This PR is ready for review.

📖 Need help? See the Policy FAQ for details on every check and how to fix failures.

🙋 Wish to Override Policy?

@therock-pr-bot

therock-pr-bot Bot commented Oct 9, 2026 •

Copy link
Copy Markdown

🎉 All checks passed! This PR is ready for review.

@Beanavil
Beanavil force-pushed the users/beanavil/hipccl/hipcub-cccl-3-1-parity-upstream branch from a93bbfb to cc9176f Compare October 12, 2026 09:05
@Beanavil
Beanavil force-pushed the users/beanavil/hipccl/hipcub-cccl-3-1-parity-upstream branch from cc9176f to 1690f2d Compare October 12, 2026 09:15
@Beanavil
Beanavil marked this pull request as ready for review October 12, 2026 09:18
@Beanavil
Beanavil requested review from a team as code owners October 12, 2026 09:18
@Beanavil
Beanavil force-pushed the users/beanavil/hipccl/hipcub-cccl-3-1-parity-upstream branch from 60bf9a3 to 5f5e253 Compare October 30, 2026 10:29

@NguyenNhuDi NguyenNhuDi left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I asked Claude to take a look at this PR and come up with potential issues. Here are some issues that Claude came up with that I think are relevant.

}
}
}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it worth testing the two params overloads as well?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what params overloads do you refer to?

@NguyenNhuDi NguyenNhuDi Nov 2, 2026 •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

NB4444 and others added 24 commits November 2, 2026 17:01
…ge number of items in device segmented radix sort
This commit works around one issue and fixes another.
1. The workaround:
cmake probes the compiler to see what options it passes by default.
One of them is a -I option that includes the path to the libhipcxx headers.
For this reason, it removes that option in the compile commands it generates
from our cmake files. However, it appears that the compiler is operating in
a different mode/state when building our source than it is during the probe.
This means that the -I option to include the path to the libhipcxx header is
not passed at compile time. We can work around this with a temporary hack
in the root level hipcub CMakeLists.txt that filters out any detected implicit
include directories for libhipcxx.

2. libhipcxx 3.4 removed several macros hipCUB depended on. Modify the #defines
so that everything compiler both with the current version as well as with older
libhipcxx versions.
The workaround is no longer necessary.
Point projects/hipccl/hipccl3/libhipcxx at ROCm/libhipcxx amd-develop
(87af709ba4349548a2bfaee73907635d889736dd), which is libhipcxx 3.4.0, required for CCCL 3.1.x/3.2.x
compatibility.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
@Beanavil
Beanavil force-pushed the users/beanavil/hipccl/hipcub-cccl-3-1-parity-upstream branch from 5f5e253 to 3f374c1 Compare November 2, 2026 17:02
@codecov

codecov Bot commented Nov 3, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 85.46012% with 237 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
...3/hipcub/test/hipcub/test_hipcub_device_reduce.cpp 67.21% 14 Missing and 26 partials ⚠️
...cl3/hipcub/test/hipcub/test_hipcub_warp_reduce.cpp 71.22% 20 Missing and 20 partials ⚠️
...hipcub/test_hipcub_device_segmented_radix_sort.hpp 82.87% 10 Missing and 21 partials ⚠️
...cl3/hipcub/test/hipcub/test_hipcub_device_scan.cpp 86.63% 4 Missing and 21 partials ⚠️
...st/hipcub/test_hipcub_device_run_length_encode.cpp 85.82% 3 Missing and 17 partials ⚠️
...est/hipcub/test_hipcub_device_segmented_reduce.cpp 95.96% 2 Missing and 16 partials ⚠️
...include/hipcub/backend/rocprim/detail/util_env.hpp 65.91% 11 Missing and 4 partials ⚠️
...backend/rocprim/device/device_segmented_reduce.hpp 93.60% 9 Missing and 4 partials ⚠️
...cl/hipccl3/hipcub/hipcub/include/hipcub/config.hpp 66.67% 4 Missing and 6 partials ⚠️
.../hipccl3/hipcub/test/hipcub/common_test_header.hpp 33.33% 8 Missing and 2 partials ⚠️
... and 2 more
Additional details and impacted files
@@             Coverage Diff              @@
##           develop   #13083       +/-   ##
============================================
+ Coverage    77.77%   80.83%    +3.06%     
============================================
  Files         2905      103     -2802     
  Lines       491621    26114   -465507     
  Branches     74545     5400    -69145     
============================================
- Hits        382355    21109   -361246     
+ Misses       84274     1627    -82647     
+ Partials     24992     3378    -21614     
Flag Coverage Δ
TensileLite-CPP ?
TensileLite-Unit ?
hipBLAS ?
hipBLASLt ?
hipCUB 80.83% <85.46%> (-1.85%) ⬇️
hipDNN ?
hipFFT ?
hipRAND ?
hipSOLVER ?
hipSPARSE ?
rocBLAS ?
rocFFT ?
rocRAND ?
rocSOLVER ?
rocSPARSE ?
rocThrust ?
Files with missing lines Coverage Δ
...e/hipcub/backend/rocprim/block/block_histogram.hpp 0.00% <ø> (ø)
...nclude/hipcub/backend/rocprim/block/block_load.hpp 0.00% <ø> (ø)
.../hipcub/backend/rocprim/block/block_radix_sort.hpp 0.00% <ø> (ø)
...lude/hipcub/backend/rocprim/block/block_reduce.hpp 0.00% <ø> (ø)
...nclude/hipcub/backend/rocprim/block/block_scan.hpp 0.00% <ø> (ø)
...clude/hipcub/backend/rocprim/block/block_store.hpp 0.00% <ø> (ø)
...clude/hipcub/backend/rocprim/device/device_for.hpp 100.00% <100.00%> (ø)
...de/hipcub/backend/rocprim/device/device_reduce.hpp 100.00% <100.00%> (ø)
...ackend/rocprim/device/device_run_length_encode.hpp 100.00% <ø> (ø)
...end/rocprim/device/device_segmented_radix_sort.hpp 100.00% <ø> (ø)
... and 26 more

... and 2972 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@stanleytsang-amd

Copy link
Copy Markdown
Contributor

@Beanavil Can you resolve the merge conflicts here please?

This branch has not been deployed

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants