Skip to main content

LayerDev

Struct LayerDev 

Source
pub struct LayerDev {
Show 41 fields pub il: u32, pub ratio: usize, pub expert_kind: ExpertKind, pub wq_a: DenseBf16, pub wq_b: DenseBf16, pub wkv: DenseBf16, pub wo_a: DenseBf16, pub wo_b: DenseBf16, pub q_norm: CudaSlice<f32>, pub kv_norm: CudaSlice<f32>, pub attn_norm: CudaSlice<f32>, pub ffn_norm: CudaSlice<f32>, pub sink: CudaSlice<f32>, pub cmp: Option<CmpDev>, pub idx: Option<IdxDev>, pub hc_attn_fn: CudaSlice<f32>, pub hc_ffn_fn: CudaSlice<f32>, pub hc_attn_base: Vec<f32>, pub hc_attn_scale: Vec<f32>, pub hc_ffn_base: Vec<f32>, pub hc_ffn_scale: Vec<f32>, pub hc_attn_base_dev: CudaSlice<f32>, pub hc_attn_scale_dev: CudaSlice<f32>, pub hc_ffn_base_dev: CudaSlice<f32>, pub hc_ffn_scale_dev: CudaSlice<f32>, pub gate_bias_dev: Option<CudaSlice<f32>>, pub tid2eid_dev: Option<CudaSlice<i32>>, pub experts_s2_dev: CudaSlice<f32>, pub gate_w: CudaSlice<f32>, pub gate_bias: Option<Vec<f32>>, pub tid2eid: Option<Vec<i64>>, pub experts_w: CudaSlice<u8>, pub experts_sc: CudaSlice<u8>, pub experts_s2: Vec<f32>, pub shared_w: [DenseBf16; 3], pub wq_a_fp8: Option<Fp8Dense>, pub wq_b_fp8: Option<Fp8Dense>, pub wkv_fp8: Option<Fp8Dense>, pub wo_a_fp8: Option<Fp8Dense>, pub wo_b_fp8: Option<Fp8Dense>, pub shared_fp8: [Option<Fp8Dense>; 3],
}

Fields§

§il: u32§ratio: usize§expert_kind: ExpertKind§wq_a: DenseBf16§wq_b: DenseBf16§wkv: DenseBf16§wo_a: DenseBf16§wo_b: DenseBf16§q_norm: CudaSlice<f32>§kv_norm: CudaSlice<f32>§attn_norm: CudaSlice<f32>§ffn_norm: CudaSlice<f32>§sink: CudaSlice<f32>§cmp: Option<CmpDev>§idx: Option<IdxDev>§hc_attn_fn: CudaSlice<f32>§hc_ffn_fn: CudaSlice<f32>§hc_attn_base: Vec<f32>§hc_attn_scale: Vec<f32>§hc_ffn_base: Vec<f32>§hc_ffn_scale: Vec<f32>§hc_attn_base_dev: CudaSlice<f32>§hc_attn_scale_dev: CudaSlice<f32>§hc_ffn_base_dev: CudaSlice<f32>§hc_ffn_scale_dev: CudaSlice<f32>§gate_bias_dev: Option<CudaSlice<f32>>§tid2eid_dev: Option<CudaSlice<i32>>

i32 cast of tid2eid, range- and distinctness-validated at LOAD (the legacy path asserts per token at route time; the device route kernel cannot).

§experts_s2_dev: CudaSlice<f32>§gate_w: CudaSlice<f32>§gate_bias: Option<Vec<f32>>§tid2eid: Option<Vec<i64>>§experts_w: CudaSlice<u8>§experts_sc: CudaSlice<u8>§experts_s2: Vec<f32>§shared_w: [DenseBf16; 3]§wq_a_fp8: Option<Fp8Dense>§wq_b_fp8: Option<Fp8Dense>§wkv_fp8: Option<Fp8Dense>§wo_a_fp8: Option<Fp8Dense>§wo_b_fp8: Option<Fp8Dense>§shared_fp8: [Option<Fp8Dense>; 3]

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.