pub struct KdaSeqState {
pub conv: DevicePtr,
pub recurrent: DevicePtr,
}Expand description
The per-sequence state a KDA layer carries. Both buffers are read-modify-write.
🪤 The recurrent element is FP32 by reference semantics — HF stores it via
last_recurrent_state.to(torch.float32) and vLLM’s kda_state_dtype returns
(conv_dtype, torch.float32) regardless of mamba_cache_dtype. --ssm-h-dtype f16 is not
available to KDA without deviating from the reference.
🪤 The conv buffer is Atlas’s conv_kernel-wide convention, one slot wider than HF’s
conv_kernel - 1: Atlas shifts left before convolving, so slot 0 is shifted out and never
participates. HF[0..k-1] == Atlas[1..k] pre-shift. Any code moving state between the two
conventions must apply that offset.
Fields§
§conv: DevicePtr[conv_dim, conv_kernel] FP32.
recurrent: DevicePtr[heads, head_dim, head_dim] FP32, K-major.
Trait Implementations§
Source§impl Clone for KdaSeqState
impl Clone for KdaSeqState
Source§fn clone(&self) -> KdaSeqState
fn clone(&self) -> KdaSeqState
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for KdaSeqState
impl Debug for KdaSeqState
impl Copy for KdaSeqState
Auto Trait Implementations§
impl Freeze for KdaSeqState
impl RefUnwindSafe for KdaSeqState
impl Send for KdaSeqState
impl Sync for KdaSeqState
impl Unpin for KdaSeqState
impl UnwindSafe for KdaSeqState
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more