Struct Mamba3SingleSsdCache Copy item path Source pub struct Mamba3SingleSsdCache {
pub ssm_bhpr: Tensor<4>,
pub k_state_bmhr: Tensor<4>,
pub v_state_bhp: Tensor<3>,
pub rotation: RotationState ,
}Expand description Mutable state for a single Mamba-3 layer running the single-ssd form algorithm.
Tensor shapes match Mamba3Cache . The semantic difference lives entirely
in ssm_bhpr (see the module-level documentation).
SingleSsd-form SSM accumulator h'ₜ.
Update rule: h'ₜ = αₜ h'ₜ₋₁ + scaleₜ · sumₘ Bₜ[m] ⊗ (xₜ ⊙ mimo_xₘ).
Different from Mamba3Cache::ssm_bhpr.
Shape: [batch, nheads, per_head_dim, state_rank]
Previous token’s K per mimo rank = post-RoPE, post-bias Bₜ₋₁[m].
Used at the start of the next forward_single_ssd call to seed the boundary β
contribution (1 − λ₀) · Δ₀ · Bₜ₋₁ ⊗ xₜ₋₁ (which the previous call could
not yet add because it did not know λ₀, Δ₀).
Shape: [batch, mimo_rank, nheads, state_rank]
Previous token’s x = xₜ₋₁.
Paired with Self::k_state_bmhr to form the boundary β term.
Shape: [batch, nheads, per_head_dim]
Cumulative data-dependent rotation up to the current position
(RotationState ).
Same role as in Mamba3Cache : continued across calls for streaming.
Carries the same value as the double-ssd cache’s field (the From impls
move it across), so the two caches still inter-convert by field identity.
Returns the same module, but on the inner backend without auto-differentiation.
Wraps an inner module back into an auto-diff module.
Performs copy-assignment from
source.
Read more Formats the value using the given formatter.
Read more Formats the value using the given formatter.
Read more Converts to this type from the input type.
Converts to this type from the input type.
Converts to this type from the input type.
Type to save and load the module.
Load the module state from a record.
Convert the module into a record containing the state.
Get the number of parameters the module has, including all of its sub-modules.
Visit each tensor parameter in the module with a
visitor .
Map each tensor parameter in the module with a
mapper .
Return all the devices found in the underneath module tree added to the given vector
without duplicates.
Move the module and all of its sub-modules to the given device.
Read more Fork the module and all of its sub-modules to the given device.
Read more Return all the devices found in the underneath module tree without duplicates.
Each tensor in the module tree will not require grad.
Read more Move the module and all of its sub-modules to the autodiff backend.
Read more Quantize the weights of the module.
Formats the module with provided display settings.
Read more Custom display settings for the module.
Read more Attributes of the module used for display purposes.
Read more Gets the number of the parameters of the module.
Immutably borrows from an owned value.
Read more Mutably borrows from an owned value.
Read more 🔬 This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from
self to
dest.
Read more Returns the argument unchanged.
Calls U::from(self).
That is, this conversion is whatever the implementation of
From <T> for U chooses to do.
The resulting type after obtaining ownership.
Creates owned data from borrowed data, usually by cloning.
Read more Uses borrowed data to replace owned data, usually by cloning.
Read more Converts the given value to a
String.
Read more The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.