Use std::numeric_limits in ROCm builds compatible with CCCL 2.8 - #18
Merged
jithunnair-amd merged 1 commit intoJul 23, 2026
Merged
Conversation
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.
1 task
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This change updates a condition check to allow ROCm builds that are compatible with CCCL 2.8 or higher to use
std::numeric_limitsin 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/.