Fix Linux CUDA 13.3 build (abseil + CCCL parse errors)#29042
Open
tianleiwu wants to merge 1 commit into
Open
Conversation
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.
Description
Fixes two NVCC 13.3 (
cudafe++/ EDG front-end) parse regressions that break the Linux CUDA build of ONNX Runtime. Both are host-side parser bugs in the CUDA 13.3 toolkit that reject valid C++ which compiles fine on CUDA 13.2 and earlier.Abseil member alias template. NVCC 13.3 mis-parses the qualified-id
IfRRef<...>::AddPtr<Other>used inside abseil'sinsert_or_assign/try_emplacemacros, failing withusing template type parameter ... after 'typename'. A new patch introduces a top-level alias templateIfRRefAddPtr<T, Other>and routes the macros through it. Because it stays an alias template, substitution remains in the immediate context, so forming a pointer-to-reference is still a soft (SFINAE) failure rather than a hard error — the original behavior is preserved.CCCL global-qualified partial specializations.
<cub/device/device_transform.cuh>and<cub/device/dispatch/tuning/tuning_transform.cuh>declarestruct ::cuda::proclaims_copyable_arguments<...> : ::cuda::std::true_type {};at global scope, which NVCC 13.3 rejects withglobal qualification of class name is invalid before ':' token. Since the affected headers ship inside the (often read-only) CUDA toolkit, the build now generates corrected copies — rewriting the specializations into namespace-reopened form (_CCCL_BEGIN_NAMESPACE_CUDA ... _CCCL_END_NAMESPACE_CUDA) — into the build tree and places that directory ahead of the toolkit CCCL include path. The transform is a no-op on toolkits that do not contain the offending pattern, so it is safe to keep enabled across CUDA versions.Summary of changes
cmake/patches/abseil/absl_cuda13_member_template.patchIfRRefAddPtralias template and rewriting the abseil container macros to use it.cmake/vcpkg-ports/abseil/absl_cuda13_member_template.patchcmake/vcpkg-ports/abseil/portfile.cmakePATCHESlist.cmake/external/abseil-cpp.cmakecmake/onnxruntime_providers_cuda.cmakeort_cuda13_patch_cccl_header()and, for CUDA >= 13.0, generate fixed CCCL headers into the build tree and prepend that directory to the CUDA include path.Motivation and Context
The CUDA 13.3 toolkit introduced
cudafe++parser regressions that reject valid template code accepted by CUDA 13.2 and earlier, so the Linux CUDA build fails before producing any libraries. These workarounds restore the build on CUDA 13.3 while remaining no-ops on toolkits without the regressions, so existing CUDA versions are unaffected.How was this tested?
CMAKE_CUDA_ARCHITECTURES="89;90", Release) completes successfully and produces theonnxruntime_gpuwheel; the two previously-failing translation units (bias_softmax_impl.cuandmoe_kernel.cu) now compile.exit 0.