Skip to main content

TensorOpSpec

Enum TensorOpSpec 

Source
pub enum TensorOpSpec {
Show 29 variants Matmul(MatmulSpec), Elementwise(ElementwiseSpec), SwiGlu(SwiGluSpec), FusedRow(FusedRowSpec), Rope(RopeSpec), Silu(SiluSpec), Sigmoid(SigmoidSpec), Gelu(GeluSpec), Scale(ScaleSpec), Softcap(SoftcapSpec), Decay(DecaySpec), L2Norm(L2NormSpec), Transpose(TransposeSpec), HeadSlice(HeadSliceSpec), Join(JoinSpec), HeadMatmul(HeadMatmulSpec), CausalConv(CausalConvSpec), GatedDelta(GatedDeltaSpec), Attention(AttentionSpec), FullAttention(FullAttentionSpec), Moe(MoeSpec), RowGather(RowGatherSpec), RowsGather(RowsGatherSpec), ArgMax(ArgMaxSpec), SetRow(SetRowSpec), IntRequant(IntRequantSpec), IntClamp(IntClampSpec), Relu(ReluSpec), LutAttention(LutAttentionSpec),
}
Expand description

One recognized tensor op — the typed spec the shared recognizers lift. The variant set is the language’s tensor sugar; the lowering of each to a spatial template lives with the composer.

Variants§

§

Matmul(MatmulSpec)

§

Elementwise(ElementwiseSpec)

§

SwiGlu(SwiGluSpec)

§

FusedRow(FusedRowSpec)

§

Rope(RopeSpec)

§

Silu(SiluSpec)

§

Sigmoid(SigmoidSpec)

§

Gelu(GeluSpec)

§

Scale(ScaleSpec)

§

Softcap(SoftcapSpec)

§

Decay(DecaySpec)

§

L2Norm(L2NormSpec)

§

Transpose(TransposeSpec)

§

HeadSlice(HeadSliceSpec)

§

Join(JoinSpec)

§

HeadMatmul(HeadMatmulSpec)

§

CausalConv(CausalConvSpec)

§

GatedDelta(GatedDeltaSpec)

§

Attention(AttentionSpec)

§

FullAttention(FullAttentionSpec)

§

Moe(MoeSpec)

§

RowGather(RowGatherSpec)

§

RowsGather(RowsGatherSpec)

§

ArgMax(ArgMaxSpec)

§

SetRow(SetRowSpec)

§

IntRequant(IntRequantSpec)

§

IntClamp(IntClampSpec)

§

Relu(ReluSpec)

§

LutAttention(LutAttentionSpec)

Implementations§

Source§

impl TensorOpSpec

Source

pub fn kind(&self) -> &'static str

The variant’s name — the kind a ledger or a schedule reads.

Source

pub fn out(&self) -> Symbol

The tensor the op binds.

Source

pub fn ins(&self) -> Vec<Symbol>

The tensors the op reads, in the spec’s operand order: matmul [a, b]; elementwise [a, b]; swiglu [gate, up]; fused row [x, weight?, residual?, bias?] (the present ones); rope [q, rc, rs, position?]; the unary maps and a scale [x]; decay [ar, dt, alog]; l2norm / transpose / head slice [x]; join [a, b]; per-head matmul [x, w]; causal conv [x, wc, cs]; gated delta [q, k, v, z, b, a, st, gn]; attention [q, k, v, position?, sinks?] and full attention [q, k, v]; moe [x, wr, wg, wu, wd, router bias?, gate, up and down biases?]; row gather [table, index?]; rows gather [table, indices]; arg-max [x]; set row [table, source, index?] (a NAMED index is an operand — the data the row comes from; a literal one is part of the op).

Source

pub fn state_inputs(&self) -> Vec<usize>

The positions in Self::ins of the operands the op writes back in place — its carried state: the conv ring, the GDN memory, and the table a row is written into (the KV cache’s append). An attention only READS its cache — masked or not — so it carries nothing; the cache is carried because Set row writes it.

Source

pub fn assembled_rows(&self) -> Option<usize>

The rows of a result the op writes a row at a time into a table it builds, or None: a block gated delta, whose rows each take the step in turn and write their output row. The table is state inside the step — each row’s write updates it in place — which the step assembles whole.

Trait Implementations§

Source§

impl Clone for TensorOpSpec

Source§

fn clone(&self) -> TensorOpSpec

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 TensorOpSpec

Source§

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

Formats the value using the given formatter. Read more

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,