pub enum Command {
Show 18 variants
Embed {
table: String,
},
Norm {
weight: String,
from: Slot,
to: Slot,
},
Matvec {
tensor: String,
from: Slot,
to: Slot,
},
Add {
from: Slot,
to: Slot,
},
SwiGlu {
gate: Slot,
up: Slot,
to: Slot,
},
Conv {
layer: usize,
kernel: String,
taps: usize,
from: Slot,
to: Slot,
},
L2Heads {
from: Slot,
at: usize,
heads: usize,
width: usize,
to: Slot,
},
Gates {
alpha: Slot,
beta: Slot,
dt: String,
a: String,
log_decay: Slot,
decay: Slot,
gate: Slot,
},
Delta {
layer: usize,
query: Slot,
key: Slot,
value: Slot,
value_at: usize,
log_decay: Slot,
decay: Slot,
gate: Slot,
k_heads: usize,
v_heads: usize,
width: usize,
to: Slot,
},
GatedNorm {
weight: String,
from: Slot,
z: Slot,
width: usize,
to: Slot,
},
Split {
from: Slot,
heads: usize,
width: usize,
query: Slot,
gate: Slot,
},
RmsHeads {
weight: String,
slot: Slot,
width: usize,
},
Rotate {
slot: Slot,
width: usize,
rope: Rope,
},
Hadamard {
slot: Slot,
width: usize,
},
CacheAppend {
layer: usize,
key: Slot,
value: Slot,
kv_heads: usize,
width: usize,
value_width: usize,
},
Attend {
layer: usize,
query: Slot,
heads: usize,
kv_heads: usize,
width: usize,
value_width: usize,
scale: f32,
to: Slot,
},
SigmoidGate {
slot: Slot,
gate: Slot,
},
Advance,
}Expand description
One command of a step.
Variants§
Embed
Each row’s Slot::Residual starts as its token’s row of the embedding table.
Norm
RMSNorm of each row of from by the weights weight into to.
Matvec
The matrix tensor times each row of from, into to.
Add
Each row of from added into to, element by element.
SwiGlu
silu(gate)·up into to, element by element.
Conv
Layer layer’s causal convolution through SiLU of each row of from into to, against each row’s sequence’s
ring of the rows before it; the row as the state stores it then joins the ring.
L2Heads
heads heads of width elements from element at of each row of from, each L2-normalized, into to.
Gates
Per value head, from each row’s alpha and beta: the decay’s exponent softplus(α + dt)·a, the decay, the
update gate σ(β).
Delta
Layer layer’s memory through each row, a value head a memory: its query and key group’s query and key,
its values from element value_at of value, its decay and gate; each value head’s read-out into to.
Fields
GatedNorm
Each head of width elements of from RMS-normed by weight and gated by silu(z), into to.
Split
Each row of from, heads heads of width queries each followed by its width gates, split into query
and gate.
RmsHeads
Each head of width elements of slot RMS-normed by weight, in place.
Rotate
Each head of width elements of slot turned by its row’s position (super::numerics::rope).
Hadamard
Each head of width elements of slot rotated by the Walsh–Hadamard transform, in place.
CacheAppend
Each row’s keys and values, kv_heads heads each, appended to layer layer’s cache of the row’s sequence in
the cache’s format.
Attend
Layer layer’s attention of each row’s heads query heads over its sequence’s cache to the row’s own
position, the heads in groups over the kv_heads cached heads, scores scaled by scale; each head’s attended
values into to, rotated back when the cache is.
Fields
SigmoidGate
Each element of slot times σ(gate), in place.
Advance
The positions of every sequence the step advances move past its rows.
Trait Implementations§
impl StructuralPartialEq for Command
Auto Trait Implementations§
impl Freeze for Command
impl RefUnwindSafe for Command
impl Send for Command
impl Sync for Command
impl Unpin for Command
impl UnsafeUnpin for Command
impl UnwindSafe for Command
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,
§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.