Skip to content

[Build] Fix debug build#27659

Merged
tianleiwu merged 4 commits intomainfrom
tlwu/fix_cuda_build_warnings
Mar 16, 2026
Merged

[Build] Fix debug build#27659
tianleiwu merged 4 commits intomainfrom
tlwu/fix_cuda_build_warnings

Conversation

@tianleiwu
Copy link
Contributor

@tianleiwu tianleiwu commented Mar 14, 2026

Description

This PR addresses several build warnings and a build error in the CUDA provider, primarily focused on improving the stability of Debug builds.

Changes

CUDA Provider Fixes

  • Fix signedness comparison warnings:
    • In tile.cc, changed the axis loop variable type from size_t to int32_t to match input_rank.
    • In pad.cc, converted p_pads->size() to int32_t using narrow and updated the loop variable type to resolve signedness warnings across template instantiations.
  • Fix GQA build error:
    • Added a missing include for common.cuh in group_query_attention_qkv.cuh. This resolves the identifier "CUDA_KERNEL_ASSERT" is undefined error encountered in Debug builds.

Test Improvements

Minor Cleanup

  • Simplified initializer list usage in graph_test.cc to avoid build error like:
inlined from ‘constexpr void std::vector<_Tp, _Alloc>::resize(size_type) [with _Tp = onnxruntime::NodeArg*; _Alloc = std::allocator<onnxruntime::NodeArg*>]’ at /usr/include/c++/13.2.0/bits/stl_vector.h:1013:21,
    inlined from ‘virtual void onnxruntime::test::GraphTest_GraphConstruction_CheckGraphInputOutputOrderMaintained_Test::TestBody()’ at /home/tlwu/git/onnxruntime/onnxruntime/test/ir/graph_test.cc:1214:16:
/usr/include/c++/13.2.0/bits/stl_uninitialized.h:1132:28: error: ‘void* __builtin_memmove(void*, const void*, long unsigned int)’ forming offset 8 is out of the bounds [0, 8] [-Werror=array-bounds=]
 1132 |           __builtin_memmove(__result, __first, __count * sizeof(_Tp));

@tianleiwu tianleiwu requested a review from yuslepukhin March 14, 2026 23:33
@tianleiwu tianleiwu changed the title [CUDA] Fix debug build [Build] Fix debug build Mar 14, 2026
@tianleiwu tianleiwu requested a review from yuslepukhin March 16, 2026 21:05
@tianleiwu tianleiwu merged commit 535161a into main Mar 16, 2026
94 of 95 checks passed
@tianleiwu tianleiwu deleted the tlwu/fix_cuda_build_warnings branch March 16, 2026 22:42
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