Skip to content

[CUDA] Add FFT support#3243

Merged
zcbenz merged 13 commits intoml-explore:mainfrom
lucasnewman:cuda-fft
Mar 14, 2026
Merged

[CUDA] Add FFT support#3243
zcbenz merged 13 commits intoml-explore:mainfrom
lucasnewman:cuda-fft

Conversation

@lucasnewman
Copy link
Contributor

Proposed changes

This adds CUDA parity with Metal for FFT ops, as requested in #2561

The implementation uses cufft and is inspired by nvmath-python which is referenced in that issue. I tried to make this as minimal as possible, and I verified all the tests for both python and cpp pass as expected, including the disabled-in-CI exhaustive one, test_fft_exhaustive.

I only had access to an H200 with CUDA 12.4 for testing -- if there's an easy way to test on other hardware, let me know and I can try it.

Checklist

Put an x in the boxes that apply.

  • I have read the CONTRIBUTING document
  • I have run pre-commit run --all-files to format my code / installed pre-commit prior to committing changes
  • I have added tests that prove my fix is effective or that my feature works
  • I have updated the necessary documentation (if needed)

Copy link
Collaborator

@zcbenz zcbenz left a comment

Choose a reason for hiding this comment

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

This is overall very nice, thanks a lot writing this!

@zcbenz
Copy link
Collaborator

zcbenz commented Mar 12, 2026

Can you enable the FFT tests in python/tests/cuda_skip.py and .github/actions/test-linux/action.yml?

@lucasnewman lucasnewman requested a review from zcbenz March 12, 2026 02:37
@lucasnewman
Copy link
Contributor Author

@zcbenz Thank you for the review! I think I've addressed everything you mentioned, and tests are passing for me on my CUDA setup. Let me know if there's anything else needed.

Copy link
Collaborator

@zcbenz zcbenz left a comment

Choose a reason for hiding this comment

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

Just a few more nitpickings, and this looks good to me!

@zcbenz zcbenz merged commit 5d17004 into ml-explore:main Mar 14, 2026
16 checks passed
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.

3 participants