pub struct K3LayerCtx<'a> {
pub kda: &'a KdaConfig,
pub mla: &'a MlaConfig,
pub moe: &'a LatentMoeConfig,
pub situ_beta: f32,
pub situ_linear_beta: f32,
pub hidden: usize,
pub dense_intermediate: usize,
pub eps: f32,
pub rope_theta: f32,
pub reduce_hidden: Option<HiddenReduce<'a>>,
pub dense_mlp: Option<DenseMlpCore<'a>>,
}Expand description
Per-layer geometry the GPU wrapper and forward_token share.
K3BoundLayer::decode copies hidden D2H, runs this math, copies H2D.
LinearAttention injects CUDA conv+recurrent unless K3_CUDA_KDA=0.
FullAttention injects CUDA gated-NoPE MLA unless K3_CUDA_MLA=0.
Fields§
§kda: &'a KdaConfig§mla: &'a MlaConfig§moe: &'a LatentMoeConfig§situ_beta: f32§situ_linear_beta: f32§dense_intermediate: usize§eps: f32§rope_theta: f32After row-parallel o_proj (and dense MLP down). None at TP=1.
dense_mlp: Option<DenseMlpCore<'a>>Implementations§
Source§impl<'a> K3LayerCtx<'a>
impl<'a> K3LayerCtx<'a>
pub fn from_model(model: &'a K3CpuModel) -> Self
Auto Trait Implementations§
impl<'a> Freeze for K3LayerCtx<'a>
impl<'a> !RefUnwindSafe for K3LayerCtx<'a>
impl<'a> !Send for K3LayerCtx<'a>
impl<'a> !Sync for K3LayerCtx<'a>
impl<'a> Unpin for K3LayerCtx<'a>
impl<'a> !UnwindSafe for K3LayerCtx<'a>
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