Skip to content

Enable AVX2 scheduled inverse FFT#38

Merged
falseywinchnet merged 2 commits into
mainfrom
bdjlrn-main/improve-simd-optimization-for-inverse-fft
Jun 21, 2026
Merged

Enable AVX2 scheduled inverse FFT#38
falseywinchnet merged 2 commits into
mainfrom
bdjlrn-main/improve-simd-optimization-for-inverse-fft

Conversation

@falseywinchnet

Copy link
Copy Markdown
Owner

Motivation

  • The double-precision d4 inverse fusion keeps q==8 leaves register-resident, reducing leaf store/reload cost and making the flat scheduled inverse more attractive on AVX2.
  • Add an inverse-only benchmark column so inverse performance can be measured directly and the AVX2 schedule tradeoff can be evaluated without relying on round-trip inference.

Description

  • Enabled the scheduled residue inverse runner for BRUUN_LEVEL 2 (AVX2) by switching the conditional in src/detail/bruun_kernel.hpp so AVX2 uses run_inv_residue_schedule for N>=64 and added a short rationale comment.
  • Added a direct inverse timing measurement inverse_ns and printed Inv_ns in the benchmark output by updating examples/benchmark.cpp to time plan.inverse(...) and emit the new column.
  • Updated src/detail/inverse_acceleration_notes.txt to record the AVX2 schedule decision, the validation platform/flags, and the rationale that the d4 fusion makes the scheduled inverse beneficial for BRUUN_LEVEL 2.

Testing

  • Built and ran automated tests with AVX2 flags via make -j$(nproc) test examples CXXOPTFLAGS='-O3 -mavx2 -mfma -mno-avx512*' and the correctness and api_c tests passed (reported correctness ok backend=avx2-fma-256 and c api ok backend=avx2-fma-256).
  • Ran the benchmark (build/examples/benchmark) across sizes and used the new Inv_ns column to compare direct inverse timings, observing an improvement at N=4096 from about ~11071 ns (pre-toggle) to ~10678 ns in the validation sample.
  • Generated x86 assembly with make asm-check and produced AVX2 and SSE2 assembly outputs successfully for inspection.
  • All automated build/benchmark steps completed successfully in the validation run (no failing tests were observed).

Codex Task

@falseywinchnet falseywinchnet merged commit de07e81 into main Jun 21, 2026
4 checks passed
@falseywinchnet falseywinchnet deleted the bdjlrn-main/improve-simd-optimization-for-inverse-fft branch June 21, 2026 09:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant