Repository navigation
feat(hipfft): add hipfftXtSetWorkArea for multi-device external work buffers - #11434
Merged
Merged
Conversation
✅ All Checks Passed — Ready for Review
📖 Need help? See the Policy FAQ for details on every check and how to fix failures. |
|
🎉 All checks passed! This PR is ready for review. |
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## develop #11434 +/- ##
===========================================
+ Coverage 63.78% 64.49% +0.71%
===========================================
Files 2825 2826 +1
Lines 469112 469096 -16
Branches 69265 69252 -13
===========================================
+ Hits 299193 302505 +3312
+ Misses 148872 145505 -3367
- Partials 21047 21086 +39
*This pull request uses carry forward flags. Click here to find out more.
🚀 New features to boost your workflow:
|
regan-amd
marked this pull request as ready for review
August 29, 2026 16:06
evetsso
approved these changes
Aug 31, 2026
evetsso
left a comment
Contributor
There was a problem hiding this comment.
Looks like we're going to conflict. :(
Contributor
Author
Yeah, I'll rebase after #10875 is merged, it shouldn't be too hard to resolve the conflicts |
af-ayala
approved these changes
Sep 1, 2026
6 of 8 tasks
malcolmroberts
self-requested a review
September 2, 2026 16:45
malcolmroberts
approved these changes
Sep 2, 2026
Add hipfftXtSetWorkArea API for setting externally-managed work areas on single-process, multi-device plans. The pre-existing hipfftSetWorkArea now delegates to it, rejecting SPMD plans. Fix hipfftGetSize* work area estimates to account for the plan's pre-initialization state (device contexts, scale factor, communicator) via a new make_size_querying_plan_from helper that copies that state into a temporary plan, instead of estimating from a bare plan. Document hipfftSetWorkArea, hipfftXtSetWorkArea, and hipfftGetSize in the RST API reference (previously missing).
Disable auto-allocation in make_plan and allocate work buffers explicitly via gpubuf (which honors VRAM limits). Buffers are attached to plans via hipfftXtSetWorkArea. A static grow-to-max pool keyed by device ID (spmd_hipfft_params::work_pool) avoids redundant allocations across test instances; TearDownTestSuite clears it.
…-GPU Allocate each work area buffer on its corresponding GPU by setting the device via rocfft_scoped_device before calling alloc(). Previously all buffers were allocated on whichever device happened to be active. Also remove the redundant buf.free() call since alloc() already frees internally.
regan-amd
force-pushed
the
users/regan-amd/hipfft_ext_workareas
branch
from
September 2, 2026 18:18
8f50528 to
a0a1e24
Compare
regan-amd
enabled auto-merge (squash)
September 2, 2026 18:18
Contributor
TheRock Submodule Bump ActivityNewest first
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Motivation
Multi-device hipFFT plans previously had no way to use externally-managed work areas. The only option was auto-allocation, which doesn't allow the caller to control VRAM usage or reuse buffers across plans. The cuFFT API provides
cufftXtSetWorkAreafor this purpose; hipFFT now matches it.JIRA ID: AIFFT-523
Technical Details
hipfftXtSetWorkArea(hipfftHandle, void**)to the public API (AMD and NVIDIA backends), allowing users to supply per-device work buffers for multi-device plans.hipfftSetWorkAreanow delegates tohipfftXtSetWorkAreaand rejects single-process, multi-device plans explicitly.hipfftGetSize*/hipfftEstimate*to use a sharedhipfftHandle_t::make_size_querying_plan_from()helper, eliminating duplicated create/destroy boilerplate and ensuring multi-device device contexts are propagated to size queries.hipfftGetSizenow writes one size per device (previously only the first entry was populated).hipfftHandle_wrapper_tandhipfftLibXtDesc_wrapper_tRAII typedefs into a shared header (hipfft_object_wrapper.h) used by both the library and test clients.various_multi_gputest suite with auto-allocation disabled in single-process, multi-device tests.Test Plan
hipfftxt_test.cpp: Updatedmake_planto disable auto-allocation and attach work buffers from a grow-to-max pool viahipfftXtSetWorkArea. This exercises the new API on every parameterized multi-device test case.multi_device_test.cpp: Enabledvarious_multi_gpusuite (previouslyDISABLED_) which tests library-decided splits with auto-allocation disabled.hipfftSetWorkAreapath.Test Result
CI tests pass.
The changes were also verified manually using
Submission Checklist