Skip to main content

Module serial_recalculated

Module serial_recalculated 

Source
Expand description

§Serial SSD with a custom, memory-efficient backward (Mamba-3 single-SSD)

The SerialRecalculated path for the single-SSD pathway. The forward is the same serial scan as super::super::serial, routed through the Mamba3SingleSsdBackendExt trait so Autodiff backends substitute a custom backward that recomputes per-chunk intermediates rather than storing them (see super::backward / super::combined_backward). Unlike the double-SSD form, the kernels here apply the trapezoid gamma/scale and the boundary-β seed internally, so the backward also returns d_gamma/d_scale.

The default body runs under a generic backend B, where the high-level Tensor (pinned to Dispatch) is unavailable, so the K1–K5 math goes through the rank-tagged F primitive wrapper. K1–K4 are mode-agnostic and reused from the double-SSD forward; only the single-SSD K5 (strict-lower intra-chunk + γ-correction) is owned here, and it is forward-only.

Traits§

Mamba3SingleSsdAutodiffBackendExt
Marker for an autodiff-capable backend that also implements the SSD extension trait (so the custom memory-efficient backward is available).
Mamba3SingleSsdBackendExt
Extends the backend for the memory-efficient single-ssd form serial SSD.

Functions§

k5_single_ssd_chunk_scan 🔒
SingleSsd chunk scan, on primitives.