Skip to content

[CUDA] Make cuFFT optional at runtime#29808

Merged
tianleiwu merged 1 commit into
mainfrom
tlwu/20260721/reduce_cufft_dependency
Jul 22, 2026
Merged

[CUDA] Make cuFFT optional at runtime#29808
tianleiwu merged 1 commit into
mainfrom
tlwu/20260721/reduce_cufft_dependency

Conversation

@tianleiwu

Copy link
Copy Markdown
Contributor

Description

Make cuFFT an optional runtime dependency for the CUDA Execution Provider and CUDA Plugin EP.

  • Add a lazy cuFFT loader and forwarding stubs for the five entry points used by the Rfft/Irfft contrib operators.
  • Select the versioned cuFFT library from the build-time CUDA major version: cuFFT 11 for CUDA 12.x and cuFFT 12 for CUDA 13.x.
  • Remove CUDA::cufft from the CUDA provider, CUDA plugin, and CUDA unit-test link lists.
  • Return NOT_IMPLEMENTED with an actionable error when an FFT operator is used without cuFFT installed.
  • Extend the Linux and Windows no-cuDNN workflows to verify there is no direct cuFFT dependency. Linux additionally removes cuFFT and verifies non-FFT CUDA ops still run while Rfft fails cleanly.
  • Document the optional cuFFT runtime model for the in-tree and plugin CUDA EPs.

Motivation and Context

The CUDA provider currently has a hard load-time dependency on cuFFT even though only the Rfft and Irfft contrib operators use it. This prevents otherwise compatible CUDA models from loading when cuFFT is not installed.

This applies the same lazy-loading model introduced for optional cuDNN in #29252: non-FFT models can run without cuFFT, while FFT operators continue to work when the matching cuFFT runtime is available.

Testing

  • Built and linked onnxruntime_providers_cuda with CUDA 13.
  • Verified libonnxruntime_providers_cuda.so has no cuFFT NEEDED entry.
  • Ran ContribOpTest.Rfft and ContribOpTest.Irfft; both passed.
  • Compiled the CUDA 12.8 library-name selection against CUDA 12.8 headers.
  • Validated both workflow YAML files and the embedded Linux smoke-test Python.
  • Ran targeted lintrunner checks and git diff --check.

@tianleiwu
tianleiwu enabled auto-merge (squash) July 22, 2026 06:32
@tianleiwu
tianleiwu merged commit bf3e9ab into main Jul 22, 2026
91 checks passed
@tianleiwu
tianleiwu deleted the tlwu/20260721/reduce_cufft_dependency branch July 22, 2026 06:32
tianleiwu added a commit that referenced this pull request Jul 22, 2026
This cherry-pick the following PRs to 1.28.0 release:
* #29808
* #29812
* #29803
* #29776

---------

Co-authored-by: eserscor <erscor@microsoft.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants