Commit a3749f1
authored
[BUILD] Fix Build Errors and Warnings in CUDA Providers (#27276)
## Description
User reported build error in
#27269.
This PR addresses several build issues and compilation warnings in the
CUDA provider and associated contrib ops. These fixes ensure a clean
build and improved compatibility with different CUDA versions
(specifically CUDA 13.1) and compilers.
## Changes
### 1. Fix ShardedMoE Compilation Error
- Resolved a "no matching function for call to CheckInputs" error in
sharded_moe.cc
- Updated the `moe_helper::CheckInputs` call to provide the required
`zero_points` arguments (passing `nullptr`), aligning with the updated
function signature.
### 2. Suppress CUDA 13.1 System Header Warnings
- Added GCC/Clang diagnostic pragmas to suppress `-Wunused-parameter`
warnings in `cuda_fp4.h`.
- These warnings were causing build failures in environments where
warnings are treated as errors.
- Affected files:
- onnxruntime/core/providers/cuda/cuda_common.h
- onnxruntime/core/providers/cuda/cuda_type_conversion.h
- onnxruntime/contrib_ops/cuda/llm/cutlass_type_conversion.h
### 3. Resolve Sign-Comparison Warnings
- Fixed several `-Wsign-compare` warnings that were being treated as
errors:
- **Pad Op:** Changed loop variable type to `size_t` in
onnxruntime/core/providers/cuda/tensor/pad.cc.
- **Distributed Reshape:** Added explicit casts to `size_t` for
`int64_t` comparisons in
onnxruntime/contrib_ops/cuda/collective/distributed_reshape.cc.
## Verification
- The build now completes successfully without errors or warnings using
`--cmake_extra_defines onnxruntime_USE_NCCL=ON`
- Builds tested with cuda 12.8, 13.0 and 13.1.11 parent 7121f9a commit a3749f1
File tree
6 files changed
+27
-10
lines changed- onnxruntime
- contrib_ops/cuda
- collective
- llm
- core/providers/cuda
- tensor
6 files changed
+27
-10
lines changedLines changed: 6 additions & 6 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
495 | 495 | | |
496 | 496 | | |
497 | 497 | | |
498 | | - | |
| 498 | + | |
499 | 499 | | |
500 | 500 | | |
501 | 501 | | |
| |||
505 | 505 | | |
506 | 506 | | |
507 | 507 | | |
508 | | - | |
509 | | - | |
| 508 | + | |
| 509 | + | |
510 | 510 | | |
511 | 511 | | |
512 | 512 | | |
| |||
556 | 556 | | |
557 | 557 | | |
558 | 558 | | |
559 | | - | |
| 559 | + | |
560 | 560 | | |
561 | 561 | | |
562 | 562 | | |
| |||
606 | 606 | | |
607 | 607 | | |
608 | 608 | | |
609 | | - | |
| 609 | + | |
610 | 610 | | |
611 | 611 | | |
612 | 612 | | |
| |||
660 | 660 | | |
661 | 661 | | |
662 | 662 | | |
663 | | - | |
| 663 | + | |
664 | 664 | | |
665 | 665 | | |
666 | 666 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
73 | 73 | | |
74 | 74 | | |
75 | 75 | | |
76 | | - | |
77 | | - | |
78 | | - | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
79 | 79 | | |
80 | 80 | | |
81 | 81 | | |
| |||
Lines changed: 7 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
29 | 29 | | |
30 | 30 | | |
31 | 31 | | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
32 | 36 | | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
33 | 40 | | |
34 | 41 | | |
35 | 42 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
15 | 15 | | |
16 | 16 | | |
17 | 17 | | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
18 | 21 | | |
19 | 22 | | |
20 | 23 | | |
21 | 24 | | |
22 | 25 | | |
23 | 26 | | |
| 27 | + | |
| 28 | + | |
24 | 29 | | |
25 | 30 | | |
26 | 31 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
14 | 14 | | |
15 | 15 | | |
16 | 16 | | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
17 | 20 | | |
18 | 21 | | |
19 | 22 | | |
20 | 23 | | |
21 | 24 | | |
22 | 25 | | |
| 26 | + | |
| 27 | + | |
23 | 28 | | |
24 | 29 | | |
25 | 30 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
259 | 259 | | |
260 | 260 | | |
261 | 261 | | |
262 | | - | |
| 262 | + | |
263 | 263 | | |
264 | 264 | | |
265 | 265 | | |
| |||
0 commit comments