Build with abseil 20250814 (NVCC) - #28586
Conversation
|
cc: @chilo-ms , @tianleiwu |
There was a problem hiding this comment.
Pull request overview
This PR updates ONNX Runtime’s build compatibility with newer NVIDIA toolchains by (1) gating/adjusting TensorRT EP code paths that were removed or changed in TensorRT 11, and (2) extending the existing Abseil CUDA/NVCC patch to work around a cudafe++ parsing issue introduced with Abseil 20250814.
Changes:
- TensorRT EP: Guard removed TensorRT APIs behind
NV_TENSORRT_MAJOR < 11and remove dead execution-context construction paths (TRT 11 makesIExecutionContextabstract). - Abseil patch: Add
IfRRefAddPtralias and route a small set ofIfRRef<...>::AddPtr<...>uses through it to avoid NVCC EDG frontend parse failures.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| onnxruntime/core/providers/tensorrt/tensorrt_execution_provider.cc | Gates TensorRT APIs removed in TRT 11; tightens execution-context handling to avoid constructing abstract TRT types. |
| cmake/patches/abseil/absl_cuda_warnings.patch | Adds an Abseil internal alias and updates a handful of template-argument sites to compile under NVCC. |
Comments suppressed due to low confidence (1)
onnxruntime/core/providers/tensorrt/tensorrt_execution_provider.cc:4002
- The MSVC
#pragma warning(push)scope here is only popped in theNV_TENSORRT_MAJOR < 11branch, so TensorRT 11+ builds will keep warning 4996 disabled until some later (unrelated)pop. This is especially problematic because another warning scope is pushed later in the same function. Please ensure the warning scope opened here is popped unconditionally after the INT8 dynamic-range block (regardless of TensorRT major) before any subsequent#pragma warning(push).
#pragma warning(push)
#pragma warning(disable : 4996)
#endif
// Set INT8 Per Tensor Dynamic range
#if NV_TENSORRT_MAJOR < 11
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
@mc-nv, please run |
|
This PR interfere with #28611 |
Once that PR is merged, you can still add the abseil workaround here. |
NVCC's EDG-based frontend (cudafe++) fails to parse the new `IfRRef<int KQual>::AddPtr<K>` constructs used by the lifetime-bound `insert_or_assign` overload sets in `raw_hash_map.h` and `btree_container.h` when they appear inside heavily macro-expanded template parameter lists. Plain g++ accepts the same code. Add a top-level `IfRRefAddPtr<T, Other>` alias in `common.h` and route the six affected use-sites through it so the member-template lookup happens outside the surrounding dependent template-id.
34cabc4 to
29d22e4
Compare
tianleiwu
left a comment
There was a problem hiding this comment.
Thanks for the focused Abseil workaround. I compared this with #29042 since both touch the same CUDA/NVCC build area. This PR fixes the Abseil IfRRef<...>::AddPtr<...> parser issue, and because it extends the existing absl_cuda_warnings.patch, it should be picked up by both the FetchContent and vcpkg Abseil paths.
If the intended goal is to unblock Linux CUDA 13.3, though, this PR looks incomplete by itself. #29042 carries the same Abseil member-template workaround and also handles the CUDA 13.3 CCCL/CUB parse error around ::cuda::proclaims_copyable_arguments in toolkit headers. My recommendation would be to move forward with #29042 once it is out of draft, or cherry-pick its CCCL workaround here, rather than merging this as the full CUDA 13.3 build fix.
If this remains a narrow Abseil-only fix, please make that scope explicit in the PR title/description and refresh the currently failed/cancelled WebGPU checks before merge.
|
Thanks for the cross-check against #29042. This PR is intentionally the narrow Abseil-only fix for the On the WebGPU checks: the latest CI run is fully green, including |
Description
Narrow, Abseil-only build fix. NVCC's
cudafe++(EDG front-end) fails to parse theIfRRef<...>::AddPtr<...>qualified-ids used by the lifetime-boundinsert_or_assign/try_emplaceoverload sets in abseil 20250814 (raw_hash_map.h,btree_container.h) when theyappear inside heavily macro-expanded template parameter lists. Plain g++ accepts the same code.
This adds a top-level
IfRRefAddPtr<T, Other>alias and routes the affected use-sites through it sothe member-template lookup happens outside the surrounding dependent template-id. 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 — original behavior is preserved.
Applied as a cmake patch under
cmake/patches/abseil/absl_cuda_warnings.patch, so it is picked up byboth the FetchContent and vcpkg Abseil paths.
Scope
This is intentionally an Abseil-only fix. It does not address the CUDA 13.3 CCCL/CUB
(
::cuda::proclaims_copyable_arguments) parse error — that is handled by #29042. This PR is not acomplete CUDA 13.3 build fix on its own.
Motivation and Context
Needed to build ONNX Runtime against the abseil version pulled in by recent CUDA toolchain updates.
Plain g++ compiles fine; only NVCC needs this workaround.