pub struct MlaEngine {
pub embedding: WeightMatrix,
pub layers: Vec<MlaLayerWeights>,
pub final_norm: Vec<f32>,
pub output_head: WeightMatrix,
pub mla_cfg: MlaConfig,
pub rms_norm_eps: f32,
pub hidden_dim: usize,
pub moe: Option<MlaMoeRuntime>,
}Expand description
Multi-layer MLA stack for DeepSeek-2 / Mistral-4-style GGUF serve.
Uses crate::mla::mla_forward_token with asymmetric K/V caches
(plain Vec<f32>, not KvCache). Layers
[0, leading_dense) use dense SwiGLU; later layers use MoE
(ferrox_moe) when the GGUF carries experts — fail-closed at load if
expert tensors are missing.
Fields§
§embedding: WeightMatrix§layers: Vec<MlaLayerWeights>§final_norm: Vec<f32>§output_head: WeightMatrix§mla_cfg: MlaConfig§rms_norm_eps: f32§moe: Option<MlaMoeRuntime>Present when any layer uses MlaLayerFfn::Moe.
Implementations§
Trait Implementations§
Source§impl Engine for MlaEngine
impl Engine for MlaEngine
type State = MlaDecodeState
Source§fn new_state(&self) -> MlaDecodeState
fn new_state(&self) -> MlaDecodeState
Builds fresh (empty) per-layer state for a new request.
fn vocab_size(&self) -> usize
fn forward_token( &self, token_id: usize, _pos: usize, state: &mut Self::State, ) -> Vec<f32>
Auto Trait Implementations§
impl Freeze for MlaEngine
impl RefUnwindSafe for MlaEngine
impl Send for MlaEngine
impl Sync for MlaEngine
impl Unpin for MlaEngine
impl UnsafeUnpin for MlaEngine
impl UnwindSafe for MlaEngine
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
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more