← Lab
neonswiglu
confirmedC++ · NEON / Apple M4Systems & data structuresJuly 9, 2026
the question
How much does hand-vectorizing SwiGLU on NEON beat scalar libm?
what came out
3.5-4.4x -- because the scalar sigmoid needs a non-inlinable expf call per element that blocks vectorization; replacing it with an inlined vector exp poly (~5e-8 accuracy) unblocks it. The gate-multiply fusion barely helps (compute-bound, not memory-bound). asm-confirmed, independently verified.
method & receipts
- Result: confirmed
- Pre-registered — the prediction was written down and committed before the run.
- Reproducible — one script re-runs the whole thing from scratch.
- Independently reviewed — an adversarial review pass, kept in the repo.
- Machine-readable claims — every reported number, in a checkable file.
→ read the code and re-run it
github.com/v-code01/neonswiglu