ruvllm_sparse_attention v0.1.1 — FastGRNN-gated near-linear attention + no_std/ESP32-S3
What's new
ruvllm_sparse_attention v0.1.1 is the first release that runs on bare-metal ESP32-class hardware and drops attention's per-token cost from O(N log N) to near-linear O(N) via a FastGRNN salience gate.
📦 crates.io · 📚 docs.rs · 🧪 tutorial gist · 📋 PR #429
Highlights
FastGrnnGate+forward_gated(new public API) — recurrent O(N · D_h²) salience pass + gated attention forward. Combined costO(N · (D_h² + W + G + K_keep + dim))is linear in seq whenK_keepis constant. Critical invariant:forward_gatedwith all-true mask is bit-identical toforward.no_std+allocsupport (ADR-192) — newstdfeature default-on, so existing consumers see zero behavioural change. Bare-metal targets opt out viadefault-features = false. Verified on attached ESP32-S3 (Xtensa LX7 @ 240 MHz, 16 MB flash) — release build1.02 s, 376 KB rlib.- ADR-191 (proposed) — Pi Zero 2W production hardening: decode-deadline API, warm-up hook,
pi_zero_2w()config preset. - Plain-language README with FAQ, scaling table, and SEO keywords. New end-to-end tutorial.
libm 0.2added as always-on dep (~60 KB pure Rust). Restoresf32::exp/sqrt/tanh/powimethod syntax in no_std mode via anF32Exttrait — all 46 math call sites unchanged.
Verification matrix
| Build | Result |
|---|---|
cargo test --lib |
38/38 pass |
cargo build --no-default-features |
clean |
cargo build --no-default-features --features fp16 |
clean |
cargo +esp build --release --target xtensa-esp32s3-none-elf -Z build-std=core,alloc |
clean (1.02 s, 376 KB rlib) |
Native run of examples/esp32s3_smoke |
esp32s3_smoke: all checks passed |
Migration
Zero action for std consumers — std is the default feature. New no_std consumers (ESP32 / Cortex-M / RISC-V MCU):
ruvllm_sparse_attention = { version = "0.1.1", default-features = false, features = ["fp16"] }Bring your own allocator + panic handler + #[entry] (embedded-alloc, linked_list_allocator, esp-hal, xtensa-lx-rt).
What's next
- ADR-191 implementation (decode-deadline API, warm-up hook, Pi Zero 2W preset)
- Flash-able example app crate (
embedded-alloc+esp-halscaffolding aroundexamples/esp32s3_smoke.rs)