nx_fft_f32.nx
buildroot/runtime/nx_fft_f32.nx
about
nx_fft_f32.nx -- f32 radix-2 FFT + f32 FNet 2D-DFT token mixer. The bridge that lets the sub-quadratic FNet
mixer (FNET-001/002, which ran in i64 Q14 fixed-point) plug into the f32 autograd tape so the block becomes
TRAINABLE. Twiddles are synthesized by the sovereign CORDIC (fx_cos/fx_sin, Q16.16) then converted to f32;
because f32 twiddles are unit-magnitude actual values, the butterfly needs NO per-stage descaling -- cleaner
(and more accurate) than the fixed-point version. DRY: reuses nx_fft_log2 + nx_fft_bit_reverse.
license_tier: ORIGINAL
dependencies 6 imports · 1 importers
imports: nx_fft.nxfx.nxnx_f32.nxnx_f32_div.nxnx_f32_cvt.nxnx_syscalls.nx
imported by: nx_autograd_tensor.nx
call flow from main pre-order; caps 40 nodes / depth 6 declared; ↻ = already shown
structs
| none |
consts
| 13 | const FFTF_MAGIC_65536: i64 = 65536 |
| 15 | const FFTF_F32_ZERO: i64 = 0 |
functions
| 18 | func fftf_q16_to_f32(q: i64) -> i64 { return nx_f32_div(nx_i32_to_f32(q), nx_i32_to_f32(FFTF_MAGIC_65536)) } |
| 21 | func fftf_twiddles(n: i64, tw_re: *i64, tw_im: *i64) -> i64 |
| 34 | func fftf_fwd(re: *i64, im: *i64, n: i64, tw_re: *i64, tw_im: *i64) -> i64 called by 3: fnet_mix_f32mainmain calls 5: nx_fft_log2nx_fft_bit_reversenx_f32_subnx_f32_mulnx_f32_add |
| 74 | func fnet_mix_f32(x_re: *i64, x_im: *i64, n: i64, d: i64) -> i64 |
| 107 | func main() -> i64 |