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
impl TensorOpSpec
Sourcepub fn ins(&self) -> Vec<Symbol>
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).
Sourcepub fn state_inputs(&self) -> Vec<usize>
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.
Sourcepub fn assembled_rows(&self) -> Option<usize>
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
impl Clone for TensorOpSpec
Source§fn clone(&self) -> TensorOpSpec
fn clone(&self) -> TensorOpSpec
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreAuto Trait Implementations§
impl Freeze for TensorOpSpec
impl RefUnwindSafe for TensorOpSpec
impl Send for TensorOpSpec
impl Sync for TensorOpSpec
impl Unpin for TensorOpSpec
impl UnsafeUnpin for TensorOpSpec
impl UnwindSafe for TensorOpSpec
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.