Skip to content

[release/2.9] [ROCm] derive the hipcub compatible cccl version from 'HIPCUB_CCCL_VERSION'#3438

Draft
jithunnair-amd wants to merge 1 commit into
ROCm:release/2.9from
jithunnair-amd:2.9-cherry-pick-pr-188072
Draft

[release/2.9] [ROCm] derive the hipcub compatible cccl version from 'HIPCUB_CCCL_VERSION'#3438
jithunnair-amd wants to merge 1 commit into
ROCm:release/2.9from
jithunnair-amd:2.9-cherry-pick-pr-188072

Conversation

@jithunnair-amd

Copy link
Copy Markdown
Collaborator

Cherry-pick of pytorch#188072 (commit c8e2473) onto release/2.9.

Summary

  • Introduce dependency on libhipcxx
  • Guard FpLimits for c10::BFloat16 backport to pre CCCL 3.x
  • Extend CUB_VERSION derivation for hipCUB using HIPCUB_CCCL_VERSION

Notes

This PR has merge conflicts that need to be resolved manually (conflict markers committed as requested).

Test plan

  • Build with ROCm
  • Verify hipCUB/CCCL compatibility glue compiles

Authored with assistance from Cursor

Made with Cursor

…RSION' (pytorch#188072)

Recreated pytorch#184552 from personal fork.

hipCUB is targeting to be compatible with CCCL 3.0 (ROCm/rocm-libraries#4079). This requires updating some of the CUB and hipCUB compatibility glue.

To help this transition hipCUB will be exposing `HIPCUB_CCCL_VERSION` in one of the following ROCm releases (>=7.14) (ROCm/rocm-libraries#7632), which will be bumped once hipCUB reaches parity with CCCL 3.0 and beyond.

This PR is created in anticipation for this future changes.

- Introduce dependency on [`libhipcxx`](https://github.com/ROCm/libhipcxx).
- Guard `FpLimits` for `c10::BFloat16` backport to pre CCCL 3.x. Numeric limits are handled by libhipcxx.
- Extend `CUB_VERSION` derivation for hipCUB. Keep old fallback for backwards compatibility. Only enable CUB V3 API once hipCUB reaches parity with CCCL 3.x.

Pull Request resolved: pytorch#188072
Approved by: https://github.com/jeffdaily

(cherry picked from commit c8e2473)
@rocm-repo-management-api

rocm-repo-management-api Bot commented Jul 14, 2026

Copy link
Copy Markdown

Jenkins build for 2a44f965df853c1ed9baed7d74fb4ff358d4d7eb commit finished as FAILURE
Links: Pipeline Overview / Build artifacts / Test Results

Detected error during Pytorch building:

[7207/8156] Building CXX object caffe2/CMakeFiles/vec_test_all_types_AVX512.dir/__/aten/src/ATen/test/vec_test_all_types.cpp.o
[7208/8156] Linking CXX executable bin/vec_test_all_types_AVX512
[7209/8156] Building CXX object caffe2/CMakeFiles/torch_cpu.dir/__/aten/src/ATen/native/cpu/FlashAttentionKernel.cpp.AVX512.cpp.o
[7210/8156] Linking CXX shared library lib/libtorch_cpu.so
[7211/8156] Building HIPCC object caffe2/CMakeFiles/torch_hip.dir/__/aten/src/ATen/hip/torch_hip_generated_cub-RadixSortPairs-int64-2.hip.o
FAILED: caffe2/CMakeFiles/torch_hip.dir/__/aten/src/ATen/hip/torch_hip_generated_cub-RadixSortPairs-int64-2.hip.o /var/lib/jenkins/pytorch/build/caffe2/CMakeFiles/torch_hip.dir/__/aten/src/ATen/hip/torch_hip_generated_cub-RadixSortPairs-int64-2.hip.o 
cd /var/lib/jenkins/pytorch/build/caffe2/CMakeFiles/torch_hip.dir/__/aten/src/ATen/hip && /opt/conda/envs/py_3.12/lib/python3.12/site-packages/cmake/data/bin/cmake -E make_directory /var/lib/jenkins/pytorch/build/caffe2/CMakeFiles/torch_hip.dir/__/aten/src/ATen/hip/. && /opt/conda/envs/py_3.12/lib/python3.12/site-packages/cmake/data/bin/cmake -D verbose:BOOL=OFF -D build_configuration:STRING=RELEASE -D generated_file:STRING=/var/lib/jenkins/pytorch/build/caffe2/CMakeFiles/torch_hip.dir/__/aten/src/ATen/hip/./torch_hip_generated_cub-RadixSortPairs-int64-2.hip.o -P /var/lib/jenkins/pytorch/build/caffe2/CMakeFiles/torch_hip.dir/__/aten/src/ATen/hip/torch_hip_generated_cub-RadixSortPairs-int64-2.hip.o.cmake
In file included from /var/lib/jenkins/pytorch/aten/src/ATen/hip/cub-RadixSortPairs-int64-2.hip:2:
In file included from /var/lib/jenkins/pytorch/aten/src/ATen/hip/cub-RadixSortPairs.cuh:6:
In file included from /var/lib/jenkins/pytorch/aten/src/ATen/hip/cub.cuh:15:
/var/lib/jenkins/pytorch/aten/src/ATen/hip/cub_definitions.cuh:47:1: error: version control conflict marker in file

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants