Skip to content

Vectorise the radix-4 butterfly pass of the power-of-two kernel - #3

Open
pankgeorg wants to merge 2 commits into
integration/allfrom
exp/simd-butterfly
Open

Vectorise the radix-4 butterfly pass of the power-of-two kernel#3
pankgeorg wants to merge 2 commits into
integration/allfrom
exp/simd-butterfly

Conversation

@pankgeorg

@pankgeorg pankgeorg commented Aug 30, 2026

Copy link
Copy Markdown
Member

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 every dims=2 row at 1.02–1.16×; the sub-0.95× cells of the first run were noise. Table: benchmark/compare3/aarch64/simd/COMPARE3.md on bench/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/ on bench/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.

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.
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.

1 participant