Skip to content

Fix CUDA 12.8+ build issues with regards to fp4 type - #26061

Merged
hariharans29 merged 8 commits into
mainfrom
hari/fix_cuda_128_linux_builds
Sep 22, 2025
Merged

Fix CUDA 12.8+ build issues with regards to fp4 type#26061
hariharans29 merged 8 commits into
mainfrom
hari/fix_cuda_128_linux_builds

Conversation

@hariharans29

@hariharans29 hariharans29 commented Sep 17, 2025

Copy link
Copy Markdown
Member

Description

Fix CUDA 12.8+ build issues with regards to fp4 type

Motivation and Context

Fix CUDA 12.8+ build issues with regards to fp4 type

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR fixes build breaks in CUDA 12.8+ Linux builds by adding #include <cuda.h> to two CUDA-specific header files before other CUDA headers are included.

  • Adds cuda.h include with explanatory comment to cuda_type_conversion.h
  • Adds cuda.h include with explanatory comment to cuda_common.h

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
onnxruntime/core/providers/cuda/cuda_type_conversion.h Includes cuda.h to provide CUDA_VERSION before other CUDA headers
onnxruntime/core/providers/cuda/cuda_common.h Includes cuda.h to provide CUDA_VERSION before other CUDA headers

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

@hariharans29
hariharans29 marked this pull request as draft September 17, 2025 01:24

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.


Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

Comment thread onnxruntime/core/providers/cuda/cuda_type_conversion.h Outdated
Comment thread onnxruntime/core/providers/cuda/cuda_common.h Outdated
hariharans29 and others added 6 commits September 16, 2025 19:03
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@hariharans29 hariharans29 changed the title Include cuda.h in a couple of CUDA EP specific headers before float4.h is included in them Fix CUDA 12.8+ builds Sep 17, 2025
@johnnynunez

Copy link
Copy Markdown

@hariharans29it works for cuda 13?

@hariharans29

hariharans29 commented Sep 17, 2025

Copy link
Copy Markdown
Member Author

@hariharans29it works for cuda 13?

No, CUDA 13 is not tested yet. Sorry for the mis-leading title. This is to fix CUDA 12 builds but specifically 12.8+ when the fp4 type is enabled.

@hariharans29 hariharans29 changed the title Fix CUDA 12.8+ builds Fix CUDA 12.8+ build issues with regards to fp4 type Sep 17, 2025
@hariharans29
hariharans29 marked this pull request as ready for review September 17, 2025 23:59
tianleiwu
tianleiwu previously approved these changes Sep 18, 2025
@tianleiwu
tianleiwu dismissed their stale review September 18, 2025 00:56

pipeline still failed. Please take a look.

@hariharans29

hariharans29 commented Sep 18, 2025

Copy link
Copy Markdown
Member Author

@tianleiwu - The failures don't seem related to this PR.

  1. The ONNX Runtime React Native CI pipeline failure is something else
  2. The Windows GPU CI Pipeline will be fixed by Disable some of rotary embedding tests as they are failing on Win GPU CUDA #26069
  3. The Linux GPU EP Perf pipeline passes the fp4 compilation failure with this change (that is the primary motivation of this PR)
    Before change: https://aiinfra.visualstudio.com/Lotus/_build/results?buildId=943275 (fp4 compilation failure)
    After change: https://aiinfra.visualstudio.com/Lotus/_build/results?buildId=943122 (crosses fp4 compilation failure stage but hits strange link error unrelated to the fp4 type change - see Teams discussion on it)

@hariharans29
hariharans29 merged commit 99ee627 into main Sep 22, 2025
159 of 164 checks passed
@hariharans29
hariharans29 deleted the hari/fix_cuda_128_linux_builds branch September 22, 2025 20:39
fs-eire pushed a commit that referenced this pull request Oct 24, 2025
### Description
Fix CUDA 12.8+ build issues with regards to fp4 type

### Motivation and Context
Fix CUDA 12.8+ build issues with regards to fp4 type

---------

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
naomiOvad pushed a commit to naomiOvad/onnxruntime that referenced this pull request Nov 2, 2025
### Description
Fix CUDA 12.8+ build issues with regards to fp4 type

### Motivation and Context
Fix CUDA 12.8+ build issues with regards to fp4 type

---------

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
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.

4 participants