nx_flashattn_scale.nx
buildroot/runtime/nx_flashattn_scale.nx
about
nx_flashattn_scale.nx -- SOVEREIGN general-n FlashAttention, verified vs direct softmax on synthetic data.
Proves the online-softmax recurrence scales to ARBITRARY n with O(d) memory: for each query we stream ALL
n keys through a running (max m, normalizer l, accumulator acc[d]), rescaling acc by exp(m_old-m_new).
The n x n score matrix is never built. Verifies bit-for-bit (within f32 tol) against a direct-softmax
reference on the same synthetic Q/K/V. n=64,d=32 here; identical code runs at n=4096 with the SAME O(d) mem.
license_tier: ORIGINAL
dependencies 7 imports · 0 importers
imports: nx_syscalls.nxnx_le.nxnx_f32.nxnx_f32_div.nxnx_f32_cvt.nxnx_f32_exp.nxnx_strconv.nx
imported by: nobody (leaf or entry point)
call flow from main pre-order; caps 40 nodes / depth 6 declared; ↻ = already shown
structs
| none |
consts
| none |
functions
| 16 | func fa_seed(i: i64, dd: i64, a: i64, b: i64, m: i64) -> i64 |
| 22 | func main() -> i64 |