Repository navigation
Share one work area across a device's FFT plans of the scratch - #542
Merged
Merged
Conversation
Each plan of the transverse scratch held a work area of its own, up to a whole state, so at 768 x 768 x 600 the four took 21 GiB, the largest row of a run. They run one after another, and cuFFT's guide allows plans launched sequentially to share one. KokkosFFT's DynPlan can set it, so a device's plans of the scratch use that. A host keeps its plans. #529. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01XGENPtq9Gp7VCh5QmcDdzQ
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01XGENPtq9Gp7VCh5QmcDdzQ
Documentation build overview
81 files changed ·
|
The maintainer asked to bring it back where it costs no capability: in place on the state's rows, a block holds no buffer of its own, only its plans' work area, so a device now takes every row at once, whatever the node budget, with no seam field. At 768 x 768 x 600 that is 14 kernels and 10 transforms a step where the node chunk took 119 and 220. A CPU keeps the chunk. Whether it stays depends on an interleaved run on an AMD card, where it measured x0.978 before (#361, #541). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01XGENPtq9Gp7VCh5QmcDdzQ
SEP 44's Final and today's main. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01XGENPtq9Gp7VCh5QmcDdzQ
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01XGENPtq9Gp7VCh5QmcDdzQ
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01XGENPtq9Gp7VCh5QmcDdzQ
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01XGENPtq9Gp7VCh5QmcDdzQ
cuFFT's rank-3 transform of a frequency-fastest volume, {N,N,T}, takes
14.7 ms at 768 x 768 x 600 on an NVIDIA H200 against 17.6 ms for the
scratch's {T,N,N} (#365). A stage of the volume route now views the
transverse scratch as (y, x, omega), the order of the state and of the
low-storage registers on a device, so its input and fold stream rather
than cross layouts. Every other pass over the scratch forms its own
input in (omega, y, x), as before. An in-stage absorber, which takes its
term from the material pass's input, keeps the scratch's order. HIP is
unchanged until rocFFT is measured.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01XGENPtq9Gp7VCh5QmcDdzQ
On an NVIDIA H200, three interleaved rounds, a step takes 204 ms at 768 x 768 x 600 where it took 225 (x0.905), and 36 ms at 384 x 384 x 600 where it took 51 (x0.713), with 1.3 GiB less memory there; on the A40 the orders are within 1 % at 768 and the step doesn't change. Nine device tests catch the window read in the old order, three the fold. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01XGENPtq9Gp7VCh5QmcDdzQ
2 tasks
On an AMD Instinct MI300X at #542's native code, the whole-state collar gained in every interleaved round (x0.983 to x0.990 at 384 and 768), so it stays; rocFFT's plans of the scratch share one work area as cuFFT's do; SEP 44's gates hold; a kept backend's scan finishes every point faster; and the hard-edge fuzz fails 32 cases with the far field's pragma removed. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01XGENPtq9Gp7VCh5QmcDdzQ
This was referenced Nov 6, 2026
Open
HIP's double sqrt is __builtin_sqrt, so llvm.sqrt.f64, which LLVM defines as a conforming IEEE 754 square root unless the call carries afn; the AMDGPU backend expands it so, and solprop's HIP build sets no fast-math option. AMD's math documentation promises less, a measured 0 or 1 ulp over [0, 100]. The far field's comment and accuracy.md section 7 now say so, with the MI300X's fuzz result (#504). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01XGENPtq9Gp7VCh5QmcDdzQ
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01XGENPtq9Gp7VCh5QmcDdzQ
jtravs
marked this pull request as ready for review
November 6, 2026 07:35
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
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.
The follow-up to #520, whose native code it changes. #520 has merged, and this now targets
main. An AMD Instinct MI300X has run it (#541), and everything there passed.What's here
On a CUDA or HIP build, a free-space run's transforms of the transverse scratch share one work area instead of holding one each (#529). cuFFT's guide allows that for plans launched one after another. The plans become
KokkosFFT::DynPlans with automatic allocation off, and one buffer, sized bycompute_required_workspace_sizeover the rank-2 pair and, on the volume route, the rank-3 pair, serves all four. CPU builds are unchanged.On an NVIDIA A40, CUDA 12.8.1, 8 steps with the check off, two interleaved rounds of three runs each, against #520's head before it:
python -m benchmarks ab --device --length 0.3, 3 rounds, the same steps and final fields with no difference:kerr_beam_384x0.994 (0.984–1.048),kerr_beam_192x1.030 (1.001–1.035, a window of two steps). So the memory falls by up to three quarters of the plans, and the time doesn't change. rocFFT shares too. On an AMD Instinct MI300X, ROCm 10.0.0, a run at 768 x 768 x 600 holds 5.76 GiB of plans and 23.37 GiB in all. The MI325X held 22.02 GiB of plans at9a5d2346, and rocFFT's four plans would take 22.0 GiB of work areas of their own.A device's split collar, a whole state at a time again (#361). #520 dropped this because it missed #361's 10 %. As the maintainer decided there, it's back for a CUDA or HIP build only, without the seam field #520 removed: in place on the state's rows, a block holds no buffer of its own, so a device takes every row at once whatever
node_budgetsays, 14 kernels and 10 transforms a step at 768 x 768 x 600 against 119 and 220 at the node chunk. A CPU keeps the chunk. It was to stay only if an interleaved run on an AMD card gained in every round. On an AMD Instinct MI300X every round did: three rounds of fresh processes, 8 steps, check off, x0.990, x0.988 and x0.990 at 384 x 384 x 600, and x0.984, x0.983 and x0.986 at 768 x 768 x 600. The plans' memory was the same.ab --device --length 0.3giveskerr_beam_384x0.952 (0.912–0.999), with the fields identical. So it stays, at about 1.5 % of a point. On an NVIDIA A40, CUDA 12.8.1,python -m benchmarks ab --device --length 0.3, 3 rounds, against this branch before it:kerr_beam_384x0.989 (0.958–0.994),kerr_beam_192x0.971 (0.951–1.065), the routes without the collar x0.998–x1.004, and the fields identical.The volume route's scratch in the registers' order (#365), on CUDA only. A stage of the volume route now views the transverse scratch as
(y, x, omega), the order of the state and of a device's registers, so its rank-3 pair is cuFFT's frequency-fastest{N,N,T}and its input and fold stream instead of crossing layouts. Every other pass over the scratch forms its own input in(omega, y, x), as before, so the change stays inside the volume route; an in-stage absorber keeps the old order. On an NVIDIA H200, CUDA 13.1, a step (from a field-free point, (24 steps - 8) / 16), three interleaved rounds against this branch before it:python -m benchmarks ab --device --length 0.3, 3 rounds:kerr_beam_384x0.971 (0.928–1.003), fields to 3.2e-17. On the A40, where cuFFT's two orders are within 1 % at 768, the step doesn't change at 768 and falls 8 % at 384. HIP keeps the old order until rocFFT's orders are measured.What a HIP device's square root guarantees at a hard edge (#504). This change is comments and documentation only. In a HIP build the far field's
sqrtis__builtin_sqrt, so it becomesllvm.sqrt.f64. LLVM defines that intrinsic as a conforming IEEE 754 square root unless the call carriesafn, and solprop's HIP build sets no fast-math option. AMD's own math documentation promises less:__dsqrt_rnis round-to-nearest-even andsqrtis 1 ulp, both measured over [0, 100]. The comment infar_field.hppand a paragraph inaccuracy.mdsection 7 now say so.How it was verified
pytest -m gpuovertests251 passed, 2 skipped, and overnative/tests31 passed. A new test,test_the_plans_of_the_scratch_hold_one_work_area, holds a run's plan growth under 1.5 states.pytest -m gpuovertests251 passed, 2 skipped, and overnative/tests31 passed. With the scratch's order too, the same: 251 passed, 2 skipped, and 31 passed.c0bd23f2:pytest -m gpu tests251 passed, 1 skipped; the split rows', edge's, collar's and transverse backends' modules 172 passed, 3 skipped.gfx942, atc0bd23f2(SEP 44's later commits haven't run on an AMD card #541).pytest -m gpuovertests: 251 passed, 1 skipped. Overnative/tests: 31 passed. The split rows', edge's, collar's, transverse backends', scans', runner's and stop's modules: 270 passed, 3 skipped.field_to_host168 ms andenergy6.7 ms.Localscan on a kept backend finished every point: x0.79 at 768 and x0.87 at 384.sqrt, compiled forgfx942under ROCm 7.2.4: the ISA is a reciprocal-root estimate refined by fused multiply-adds, not the barev_sqrt_f64.d046254dpassed, both required checks. The head adds only documentation, the ledger, changelog lines and a comment infar_field.hpp. Its CI was running when this was written.The scratch's order
The maintainer decided to take the fastest route, so the order stays on CUDA. At 768 x 768 x 600 a step on an NVIDIA H200 is x0.905, 204 ms against 225, and at 384 x 384 x 600 x0.713. That leaves #365's gap at 768 at 204 ms against the dedicated engine's 159.4 ms, x1.28, short of its 1.2, so #365 stays open. HIP keeps the old order, since rocFFT's two orders haven't been compared.
Closes #529 and #504. Relates to #365, #361 and #541.
🤖 Generated with Claude Code
https://claude.ai/code/session_01XGENPtq9Gp7VCh5QmcDdzQ