Skip to main content

Command

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.

Fields

§table: String
§

Norm

RMSNorm of each row of from by the weights weight into to.

Fields

§weight: String
§from: Slot
§to: Slot
§

Matvec

The matrix tensor times each row of from, into to.

Fields

§tensor: String
§from: Slot
§to: Slot
§

Add

Each row of from added into to, element by element.

Fields

§from: Slot
§to: Slot
§

SwiGlu

silu(gate)·up into to, element by element.

Fields

§gate: Slot
§up: Slot
§to: Slot
§

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.

Fields

§layer: usize
§kernel: String
§taps: usize
§from: Slot
§to: Slot
§

L2Heads

heads heads of width elements from element at of each row of from, each L2-normalized, into to.

Fields

§from: Slot
§heads: usize
§width: usize
§to: Slot
§

Gates

Per value head, from each row’s alpha and beta: the decay’s exponent softplus(α + dt)·a, the decay, the update gate σ(β).

Fields

§alpha: Slot
§beta: Slot
§log_decay: Slot
§decay: Slot
§gate: Slot
§

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

§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

Each head of width elements of from RMS-normed by weight and gated by silu(z), into to.

Fields

§weight: String
§from: Slot
§width: usize
§to: Slot
§

Split

Each row of from, heads heads of width queries each followed by its width gates, split into query and gate.

Fields

§from: Slot
§heads: usize
§width: usize
§query: Slot
§gate: Slot
§

RmsHeads

Each head of width elements of slot RMS-normed by weight, in place.

Fields

§weight: String
§slot: Slot
§width: usize
§

Rotate

Each head of width elements of slot turned by its row’s position (super::numerics::rope).

Fields

§slot: Slot
§width: usize
§rope: Rope
§

Hadamard

Each head of width elements of slot rotated by the Walsh–Hadamard transform, in place.

Fields

§slot: Slot
§width: usize
§

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.

Fields

§layer: usize
§key: Slot
§value: Slot
§kv_heads: usize
§width: usize
§value_width: usize
§

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

§layer: usize
§query: Slot
§heads: usize
§kv_heads: usize
§width: usize
§value_width: usize
§scale: f32
§to: Slot
§

SigmoidGate

Each element of slot times σ(gate), in place.

Fields

§slot: Slot
§gate: Slot
§

Advance

The positions of every sequence the step advances move past its rows.

Trait Implementations§

Source§

impl Clone for Command

Source§

fn clone(&self) -> Command

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for Command

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl PartialEq for Command

Source§

fn eq(&self, other: &Command) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl StructuralPartialEq for Command

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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
§

impl<T> Downcast for T
where T: Any,

§

fn into_any(self: Box<T>) -> Box<dyn Any>

Convert 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>

Convert 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)

Convert &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)

Convert &mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot generate &mut Any’s vtable from &mut Trait’s.
§

impl<T> DowncastSync for T
where T: Any + Send + Sync,

§

fn into_any_arc(self: Arc<T>) -> Arc<dyn Any + Send + Sync>

Convert Arc<Trait> (where Trait: Downcast) to Arc<Any>. Arc<Any> can then be further downcast into Arc<ConcreteType> where ConcreteType implements Trait.
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> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
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.
§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,