Vectorise the radix-4 butterfly pass of the power-of-two kernel - #3
Open
pankgeorg wants to merge 2 commits into
Open
Vectorise the radix-4 butterfly pass of the power-of-two kernel#3pankgeorg wants to merge 2 commits into
pankgeorg wants to merge 2 commits into
Conversation
W butterflies per iteration on SIMD.jl vectors (2 for ComplexF64, 4 for ComplexF32); the twiddle table keeps its compact layout and the triplets are rearranged in registers. Falls back to the scalar loop for strided or non-contiguous output and for other element types.
This was referenced Aug 30, 2026
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 butterfly pass of
fft_pow2_radix4!runs W butterflies per iteration on SIMD.jl vectors (W = 2 ComplexF64, 4 ComplexF32); the twiddle table keeps its compact layout, triplets are rearranged in registers (src/simd_pass.jl); scalar fallback for strided/non-contiguous output and other element types. New dependency SIMD.jl.compare3 vs
integration/all, aarch64 Neoverse-N1, 1 thread, 505 cases: 1.14× geomean (0.87–1.90); ComplexF64 pow2 1.19× (now 1.03× of FFTW ESTIMATE), ComplexF32 pow2 1.38×, Float32 rfft pow2/prime/awkward 1.26–1.34×, batched dims=1 1.12–1.26×; composites unchanged (not on this path). A quiet back-to-back re-run of the N-d/batched cases (benchmark/compare3/aarch64/recheck-nd-batched/) puts everydims=2row at 1.02–1.16×; the sub-0.95× cells of the first run were noise. Table:benchmark/compare3/aarch64/simd/COMPARE3.mdonbench/compare3.Tested: full suite green on 4 threads; results vs FFTW rel. err ≤ 3e-7 (Float32).
x86-64 (Core Ultra 7 165H, AVX2; companion session,
benchmark/x86-64/compare3/simd/onbench/x86-compare3): 1.17× geomean; pow2 1.12× ComplexF64 / 1.46× ComplexF32 — it is lanes per instruction that pays (W=4 Float32 fills one AVX2 register with twice the lanes), not whether the Float64 vector fits one register.