pub struct MoeJob<'a> {
pub gate: (usize, usize, usize, &'a [f32]),
pub up: (usize, usize, usize, &'a [f32]),
pub down: (usize, usize, usize, &'a [f32]),
pub xs_gate: Vec<f32>,
pub xs_up: Vec<f32>,
pub down_col: &'a [f32],
pub w: f32,
pub q1: bool,
pub q4t: bool,
pub q4tp: bool,
pub gu_q2: bool,
pub swiglu_limit: f32,
}Expand description
A single MoE-FFN job (an expert with its own weight), executed in one submission: (rows, cols, idx, row_scale) for gate/up/down + prescaled inputs + the down θ-field + the blending weight.
Fields§
§gate: (usize, usize, usize, &'a [f32])§up: (usize, usize, usize, &'a [f32])§down: (usize, usize, usize, &'a [f32])§xs_gate: Vec<f32>§xs_up: Vec<f32>§down_col: &'a [f32]§w: f32§q1: boolq1 trio: scales live inside the 6-byte tiles (row_scale slices empty, xs raw f32). Backends without a q1 kernel refuse the job.
q4t: boolq4_tiled trio: scales inside the 18-byte tiles (row_scale slices empty, xs raw f32) — the MoE-hybrid coder class.
q4tp: boolq4tp trio: same raw-xs contract, 16-byte nibble stride and the scale on a per-row ladder. Without this the experts of a q4tp MoE model fall to the CPU while every other dtype rides the device.
gu_q2: boolMixed 2-bit profile: gate/up are q2tp (8-byte chunks, zero rung),
down stays q4tp. Set together with q4tp; a backend without the
2-bit kernel must refuse the whole job.
swiglu_limit: f32The reference’s swiglu_limit; 0 disables the clamp. A backend that
cannot apply it must REFUSE the job rather than drop it silently —
the difference only shows on saturating activations, which is the
hardest kind of divergence to notice.