pub struct MoeExpertRoute {
pub a_table: DevicePtr,
pub b_table: DevicePtr,
pub scale_table: DevicePtr,
pub n_experts: u32,
pub k_in: u32,
pub n_out: u32,
pub max_rank: u32,
}Expand description
2026-09-25: Device tables for one projection’s expert LoRA pairs, indexed by
expert id: the expert-keyed counterpart of the slot-keyed
super::lora_delta::LoraRoute. MoeLayer::build_expert_route builds one
per projection (down, gate, up) at adapter install, and the router fold
builds a one-entry route whose expert 0 is the router pair.
n_experts is the table length, max adapted expert id + 1, not the layer’s
expert count. The grouped launcher uses it as grid.z.
Fields§
§a_table: DevicePtr2026-09-25: [n_experts] u64 device array of A_e addresses (0 = expert unadapted).
b_table: DevicePtr2026-09-25: [n_experts] u64 device array of B_e addresses (0 = expert unadapted).
scale_table: DevicePtr2026-09-25: [n_experts] f32 device array of per-expert scale_e (0.0 where unadapted).
n_experts: u32§k_in: u322026-09-25: Contraction dim of the shrink stage: the projection’s input width.
n_out: u322026-09-25: Output dim of the expand stage: the projection’s output width.
max_rank: u322026-09-25: Padded rank: the contraction dim of the expand stage and the
row stride of B_e.
Trait Implementations§
Source§impl Clone for MoeExpertRoute
impl Clone for MoeExpertRoute
Source§fn clone(&self) -> MoeExpertRoute
fn clone(&self) -> MoeExpertRoute
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more