Repository navigation
fix(fft): set correct Load/StoreOps on gather-scatter multi-GPU plans - #12602
Merged
Merged
Conversation
Gather-scatter plan creation now creates the gather + scatter items first (if needed), and they apply load/store ops as needed. They now will launch an extra kernel to apply the ops if the first/last op (respectively) is not a kernel. Once that is done, the single-device plan can then know whether or not it still needs to apply the load/store ops. We then add the required dependencies in the graph once all items exist. Modified plan execution to allow JIT callbacks and disallow function pointer callbacks with multi-GPU transforms. Enable JIT callback tests for multi-GPU.
✅ 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 #12602 +/- ##
===========================================
- Coverage 72.10% 69.97% -2.12%
===========================================
Files 2861 2933 +72
Lines 472618 482116 +9498
Branches 69810 69511 -299
===========================================
- Hits 340755 337360 -3395
- Misses 108125 120561 +12436
- Partials 23738 24195 +457
*This pull request uses carry forward flags. Click here to find out more.
🚀 New features to boost your workflow:
|
malcolmroberts
approved these changes
Sep 28, 2026
af-ayala
approved these changes
Sep 29, 2026
The non-pencil general branch re-applied load callbacks to transposed temp buffers for non-contiguous dims, so callbacks ran twice with temp-buffer cbdata. Add pencil-to-slab tokens (with and without JIT callbacks) covering this path.
regan-amd
reviewed
Oct 5, 2026
regan-amd
left a comment
Contributor
There was a problem hiding this comment.
Two additional comments/notes:
- fields or bricks -> fields - default std::nullopt on transpose_brick - remove antecedents arg from CreateInput and CreateOutput, make them only return the items needed to figure out dependencies - explicitly doc expectations for multi-gpu + jit callbacks - remove other notes saying jit cb + multi-gpu is disallowed
…to_slab' into users/evetsso/mgpu_jitcb
1 task done
Contributor
TheRock Submodule Bump ActivityNewest first
|
regan-amd
added a commit
that referenced
this pull request
Oct 13, 2026
) ## Motivation Follow-up to #12602, which was merged with some review feedback marked as resolved without a response or a corresponding change: - [Comment on the legacy section of `load-store-callbacks.rst`](#12602 (comment)), asking to remove the paragraphs that follow the new note: they still describe one function pointer per brick (with 4-brick and 6-brick examples) and the "same logical operation" rule, which contradicts the note added right above them. - [Review comment](#12602 (review)) asking for the `rocfft.h` doxygen to be updated: the JIT-callback notes were removed, but the doxygen of the deprecated `rocfft_execution_info_set_load_callback` and `rocfft_execution_info_set_store_callback` still describes per-brick arrays and does not mention the new restriction. This also removes an unused local left over by #13102 (merged into #12602). JIRA ID: AIFFT-460 ## Technical Details #12602 made `rocfft_execute` return `rocfft_status_invalid_arg_value` when function pointer callbacks are combined with fields (`have_funcptr_callbacks && have_multigpu_plan` in `transform.cpp`). A function pointer callback can therefore only run on a plan without fields, which has a single input brick and a single output brick: - the single-device execution plan reads/writes the user's buffers at index 0 (`BufferPtr::user_input(0, ...)` / `BufferPtr::user_output(0, ...)` in `plan.cpp`); - the callback function pointer and data are looked up at that same index (`execPlan.inputPtr.get(...)` / `execPlan.outputPtr.get(...)` in `powX.cpp`). So the per-brick array semantics, the "all functions must perform the same logical operation" rule and the "at least one brick on the current device" requirement no longer apply to function pointer callbacks. Changes: - `docs/how-to/load-store-callbacks.rst`: keep the gfx1250 note as it was; replace the per-brick paragraphs with the single-entry rule and the returned error. - `library/include/rocfft/rocfft.h`: same update in the doxygen of `rocfft_execution_info_set_load_callback` and `rocfft_execution_info_set_store_callback`. - `library/src/plan.cpp`: drop the unused `loadOps` local in `BuildOptMultiDevicePlan`'s `nonContiguousDims` loop; load ops are applied once by the `contiguousInputDims` FFT. ## Test Plan - Regular test suite ## Test Result - Regular test suite passes ## Submission Checklist - [x] Look over the contributing guidelines at https://github.com/ROCm/TheRock/blob/main/GOVERNANCE.md#pull-requests.
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
Enable JIT callbacks to work on multi-GPU plans.
JIRA ID: AIFFT-460
Technical Details
Gather-scatter plan creation now creates the gather + scatter items first (if needed), and they apply load/store ops as needed. They now will launch an extra kernel to apply the ops if the first/last op (respectively) is not a kernel.
Once that is done, the single-device plan can then know whether or not it still needs to apply the load/store ops. We then add the required dependencies in the graph once all items exist.
Modified plan execution to allow JIT callbacks and disallow the already-deprecated function pointer callbacks with multi-GPU transforms.
Enable JIT callback tests for multi-GPU. This additional testing uncovered a problem with result scaling in multi-GPU plans, where a real inverse transform might use a transpose kernel that works on reals and also wants result scaling. We were missing some typedefs to allow this case to work.
Test Plan
Implemented new test cases.
Test Result
Test cases pass.
Submission Checklist