Skip to content

Use std::numeric_limits in ROCm builds compatible with CCCL 2.8 - #18

Merged
jithunnair-amd merged 1 commit into
ROCm:release/2.11.0.2from
umfranzw:update_numeric_limits_cond
Jul 23, 2026
Merged

Use std::numeric_limits in ROCm builds compatible with CCCL 2.8#18
jithunnair-amd merged 1 commit into
ROCm:release/2.11.0.2from
umfranzw:update_numeric_limits_cond

Conversation

@umfranzw

Copy link
Copy Markdown

This change updates a condition check to allow ROCm builds that are compatible with CCCL 2.8 or higher to use std::numeric_limits in place of (the deprecated) cub::FpLimits. This resolves a build failure with some new hipCUB CCCL 3.0 changes.

PLEASE NOTE THAT THE TORCHAUDIO REPOSITORY IS NO LONGER ACTIVELY MONITORED. You may not get a response. For open discussions, visit https://discuss.pytorch.org/.

Updates a condition check to allow ROCm builds that are
compatible with CCCL 2.8 or higher to use std::numeric_limits
in place of cub::FpLimits. This resolves a build failure with
some new hipCUB CCCL 3.0 changes.
@jithunnair-amd
jithunnair-amd merged commit b3ec2af into ROCm:release/2.11.0.2 Jul 23, 2026
5 of 28 checks passed
jithunnair-amd added a commit to ROCm/pytorch that referenced this pull request Jul 23, 2026
## Motivation

Pick up changes from ROCm/audio#18 to resolve
torchaudio build issues with CCCL changes added to PyTorch 2.13 in
#3442

## Technical Details

[2.13
build](https://github.com/ROCm/TheRock/actions/runs/29541268387/job/87816472633)
failed with a torchaudio build error:
```
2026-07-17T06:17:07.2596766Z [3/3] /opt/python/cp312-cp312/lib/python3.12/site-packages/_rocm_sdk_devel/bin/hipcc  -I/__w/TheRock/TheRock/external-builds/pytorch/pytorch_audio/src/libtorchaudio/cuctc -I/__w/TheRock/TheRock/external-builds/pytorch/pytorch_audio/src -I/opt/python/cp312-cp312/lib/python3.12/site-packages/torch/include -I/opt/python/cp312-cp312/lib/python3.12/site-packages/torch/include/torch/csrc/api/include -I/opt/python/cp312-cp312/lib/python3.12/site-packages/torch/include/THH -I/opt/python/cp312-cp312/lib/python3.12/site-packages/_rocm_sdk_devel/include -I/opt/_internal/cpython-3.12.10/include/python3.12 -c -c /__w/TheRock/TheRock/external-builds/pytorch/pytorch_audio/src/libtorchaudio/cuctc/src/ctc_prefix_decoder_kernel_v2.hip -o /__w/TheRock/TheRock/external-builds/pytorch/pytorch_audio/build/temp.linux-x86_64-cpython-312/src/libtorchaudio/cuctc/src/ctc_prefix_decoder_kernel_v2.o -D__HIP_PLATFORM_AMD__=1 -DUSE_ROCM=1 -DHIPBLAS_V2 -fPIC -DCUDA_HAS_FP16=1 -D__HIP_NO_HALF_OPERATORS__=1 -D__HIP_NO_HALF_CONVERSIONS__=1 -DHIP_ENABLE_WARP_SYNC_BUILTINS=1 -O3 -DTORCH_HIP_VERSION=715 -DTORCH_API_INCLUDE_EXTENSION_H -DPy_LIMITED_API=0x030A0000 -DTORCH_EXTENSION_NAME=torchaudio_prefixctc --offload-arch=gfx942 -fno-gpu-rdc -std=c++20
2026-07-17T06:17:07.2599074Z Traceback (most recent call last):
2026-07-17T06:17:07.2599366Z   File "/opt/python/cp312-cp312/lib/python3.12/site-packages/torch/utils/cpp_extension.py", line 2893, in _run_ninja_build
2026-07-17T06:17:07.2599875Z FAILED: [code=1] /__w/TheRock/TheRock/external-builds/pytorch/pytorch_audio/build/temp.linux-x86_64-cpython-312/src/libtorchaudio/cuctc/src/ctc_prefix_decoder_kernel_v2.o 
2026-07-17T06:17:07.2602243Z /opt/python/cp312-cp312/lib/python3.12/site-packages/_rocm_sdk_devel/bin/hipcc  -I/__w/TheRock/TheRock/external-builds/pytorch/pytorch_audio/src/libtorchaudio/cuctc -I/__w/TheRock/TheRock/external-builds/pytorch/pytorch_audio/src -I/opt/python/cp312-cp312/lib/python3.12/site-packages/torch/include -I/opt/python/cp312-cp312/lib/python3.12/site-packages/torch/include/torch/csrc/api/include -I/opt/python/cp312-cp312/lib/python3.12/site-packages/torch/include/THH -I/opt/python/cp312-cp312/lib/python3.12/site-packages/_rocm_sdk_devel/include -I/opt/_internal/cpython-3.12.10/include/python3.12 -c -c /__w/TheRock/TheRock/external-builds/pytorch/pytorch_audio/src/libtorchaudio/cuctc/src/ctc_prefix_decoder_kernel_v2.hip -o /__w/TheRock/TheRock/external-builds/pytorch/pytorch_audio/build/temp.linux-x86_64-cpython-312/src/libtorchaudio/cuctc/src/ctc_prefix_decoder_kernel_v2.o -D__HIP_PLATFORM_AMD__=1 -DUSE_ROCM=1 -DHIPBLAS_V2 -fPIC -DCUDA_HAS_FP16=1 -D__HIP_NO_HALF_OPERATORS__=1 -D__HIP_NO_HALF_CONVERSIONS__=1 -DHIP_ENABLE_WARP_SYNC_BUILTINS=1 -O3 -DTORCH_HIP_VERSION=715 -DTORCH_API_INCLUDE_EXTENSION_H -DPy_LIMITED_API=0x030A0000 -DTORCH_EXTENSION_NAME=torchaudio_prefixctc --offload-arch=gfx942 -fno-gpu-rdc -std=c++20
2026-07-17T06:17:07.2604662Z /__w/TheRock/TheRock/external-builds/pytorch/pytorch_audio/src/libtorchaudio/cuctc/src/ctc_prefix_decoder_kernel_v2.hip:449:15: error: no member named 'FpLimits' in namespace 'hipcub'
2026-07-17T06:17:07.2605073Z   449 |       hipcub::FpLimits<float>::Lowest(),
2026-07-17T06:17:07.2605234Z       |               ^~~~~~~~
2026-07-17T06:17:07.2605613Z /__w/TheRock/TheRock/external-builds/pytorch/pytorch_audio/src/libtorchaudio/cuctc/src/ctc_prefix_decoder_kernel_v2.hip:449:29: error: expected '(' for function-style cast or type construction
2026-07-17T06:17:07.2606041Z   449 |       hipcub::FpLimits<float>::Lowest(),
2026-07-17T06:17:07.2606201Z       |                        ~~~~~^
2026-07-17T06:17:07.2606574Z /__w/TheRock/TheRock/external-builds/pytorch/pytorch_audio/src/libtorchaudio/cuctc/src/ctc_prefix_decoder_kernel_v2.hip:449:32: error: no member named 'Lowest' in the global namespace
2026-07-17T06:17:07.2606961Z   449 |       hipcub::FpLimits<float>::Lowest(),
2026-07-17T06:17:07.2607121Z       |                                ^~~~~~
2026-07-17T06:17:07.2607282Z 3 errors generated when compiling for gfx942.
2026-07-17T06:17:07.2609497Z failed to execute:"/usr/local/bin/sccache" "/opt/python/cp312-cp312/lib/python3.12/site-packages/_rocm_sdk_devel/lib/llvm/bin/clang++"  --offload-arch=gfx942  -I/__w/TheRock/TheRock/external-builds/pytorch/pytorch_audio/src/libtorchaudio/cuctc -I/__w/TheRock/TheRock/external-builds/pytorch/pytorch_audio/src -I/opt/python/cp312-cp312/lib/python3.12/site-packages/torch/include -I/opt/python/cp312-cp312/lib/python3.12/site-packages/torch/include/torch/csrc/api/include -I/opt/python/cp312-cp312/lib/python3.12/site-packages/torch/include/THH -I/opt/python/cp312-cp312/lib/python3.12/site-packages/_rocm_sdk_devel/include -I/opt/_internal/cpython-3.12.10/include/python3.12 -c -c -x hip /__w/TheRock/TheRock/external-builds/pytorch/pytorch_audio/src/libtorchaudio/cuctc/src/ctc_prefix_decoder_kernel_v2.hip -o "/__w/TheRock/TheRock/external-builds/pytorch/pytorch_audio/build/temp.linux-x86_64-cpython-312/src/libtorchaudio/cuctc/src/ctc_prefix_decoder_kernel_v2.o" -D__HIP_PLATFORM_AMD__=1 -DUSE_ROCM=1 -DHIPBLAS_V2 -fPIC -DCUDA_HAS_FP16=1 -D__HIP_NO_HALF_OPERATORS__=1 -D__HIP_NO_HALF_CONVERSIONS__=1 -DHIP_ENABLE_WARP_SYNC_BUILTINS=1 -O3 -DTORCH_HIP_VERSION=715 -DTORCH_API_INCLUDE_EXTENSION_H -DPy_LIMITED_API=0x030A0000 -DTORCH_EXTENSION_NAME=torchaudio_prefixctc -fno-gpu-rdc -std=c++20
2026-07-17T06:17:07.2611802Z ninja: build stopped: subcommand failed.
```

## Test Plan

Tested using
https://github.com/ROCm/TheRock/actions/runs/29943641797/job/89010396692,
which used
a temporary branch with [this
change](d41798d)
to test out the torchaudio fix.

## Test Result

From
https://github.com/ROCm/TheRock/actions/runs/29943641797/job/89010396692:
`2026-07-22T18:11:26.3489091Z Found built wheel:
/__w/TheRock/TheRock/external-builds/pytorch/pytorch_audio/dist/torchaudio-2.11.0.2+devrocm7.15.0.dev0.a703bfe5b151ffb3333cd6bed241373adef42300-cp312-cp312-linux_x86_64.whl`

## Submission Checklist

- [x] Look over the contributing guidelines at
https://github.com/ROCm/ROCm/blob/develop/CONTRIBUTING.md#pull-requests.
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