pub enum RouterInput {
NormedFfnInput,
RawLayerInput,
NormedLayerInput,
}Expand description
The operand of the MoE router’s matmul.
Variants§
NormedFfnInput
gate_inp · ffn_norm(ffn_inp) – the normed FFN input, the
same vector the experts read. build_moe_ffn’s own
computation, and every generic-path graph but one.
RawLayerInput
gate_inp · inpL – the residual stream as it enters the
layer, unnormed, before attention (smallthinker.cpp:111). The
experts still read the normed FFN input.
NormedLayerInput
gate_inp · ffn_norm_exps(inpSA) – the residual stream as it
enters the layer, normed by blk.N.ffn_norm_exps (REQUIRED,
arctic.cpp:45,136-139). The routed experts read the SAME
vector; the layer’s dense FFN reads ffn_norm(ffn_inp).
Implementations§
Source§impl RouterInput
impl RouterInput
Sourcepub fn experts_read_router_operand(self) -> bool
pub fn experts_read_router_operand(self) -> bool
Whether the routed experts read the router’s operand rather
than the normed FFN input: true for Self::NormedLayerInput
alone. RawLayerInput’s experts read ffn_norm(ffn_inp)
(smallthinker.cpp:151), as the default’s do.
Sourcepub fn needs_exps_norm(self) -> bool
pub fn needs_exps_norm(self) -> bool
Whether the layer carries a ffn_norm_exps weight for the
operand.
Trait Implementations§
Source§impl Clone for RouterInput
impl Clone for RouterInput
impl Copy for RouterInput
Source§impl Debug for RouterInput
impl Debug for RouterInput
Source§impl Default for RouterInput
impl Default for RouterInput
impl Eq for RouterInput
Source§impl PartialEq for RouterInput
impl PartialEq for RouterInput
impl StructuralPartialEq for RouterInput
Auto Trait Implementations§
impl Freeze for RouterInput
impl RefUnwindSafe for RouterInput
impl Send for RouterInput
impl Sync for RouterInput
impl Unpin for RouterInput
impl UnsafeUnpin for RouterInput
impl UnwindSafe for RouterInput
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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> ⓘ
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> ⓘ
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