pub enum OpKind {
Show 31 variants
Embed,
RmsNorm,
GatedRmsNorm,
ResidualAdd,
Copy,
Concat,
Split,
Linear(LinearRole),
SiluMul,
Relu2,
ActQuant(Format),
QkNorm,
Rope,
KvWrite,
PagedAttention,
SigmoidGateMul,
GdnGates,
Conv1dUpdate,
L2Norm,
GdnRecurrence,
SsmUpdate,
Router,
TopK,
ExpertGateUp,
ExpertDown,
Blend,
EpReduce,
FinalNorm,
LmHead,
Argmax,
StateSnapshot,
}Expand description
2026-09-28: The closed op vocabulary.
Variants§
Embed
2026-09-28: Token embedding lookup; a source node.
RmsNorm
2026-09-28: RMSNorm with a learned weight.
GatedRmsNorm
2026-09-28: RMSNorm of one input gated by SiLU of another (GDN output norm).
ResidualAdd
2026-09-28: Elementwise sum of two streams.
Copy
2026-09-28: A copy between buffers.
Concat
2026-09-28: Concatenate inputs along the feature dim.
Split
2026-09-28: Split or deinterleave a packed projection output.
Linear(LinearRole)
2026-09-28: A weight-bearing projection.
SiluMul
2026-09-28: silu(gate) * up over a packed gate|up input.
Relu2
2026-09-29: relu(x)^2 of an ungated up projection.
ActQuant(Format)
2026-09-28: Quantize activations to the given format.
QkNorm
2026-09-28: Per-head RMSNorm of Q or K.
Rope
2026-09-28: Rotary position embedding.
KvWrite
2026-09-28: Append K and V to the paged cache.
PagedAttention
2026-09-28: Paged softmax attention over the cache.
SigmoidGateMul
2026-09-28: x * sigmoid(gate) (attention output gate).
GdnGates
2026-09-28: GDN beta and decay from the ba projection.
Conv1dUpdate
2026-09-28: Causal depthwise conv1d step with its rolling state.
L2Norm
2026-09-28: L2 normalisation of Q and K heads.
GdnRecurrence
2026-09-28: The gated delta rule recurrence over the recurrent state.
SsmUpdate
2026-09-29: The Mamba2 selective state-space update: one step of the SSM state per row
(dt softplus, A, the grouped B/C projections and the D skip).
Router
2026-09-28: MoE router logits.
TopK
2026-09-28: Top-k expert selection and weights.
ExpertGateUp
2026-09-28: Routed experts’ gate and up projections.
ExpertDown
2026-09-28: Routed experts’ down projections.
Blend
2026-09-28: Weighted sum of the routed experts and the gated shared expert.
EpReduce
2026-09-28: Cross-rank reduction of an expert-parallel FFN output.
FinalNorm
2026-09-28: The model’s final RMSNorm.
LmHead
2026-09-28: Vocabulary projection.
Argmax
2026-09-28: Greedy token selection over the logits.
StateSnapshot
2026-09-29: A snapshot of the recurrent state its input’s producer updates, taken after each row but the last into the step’s checkpoint slots (the verify’s rollback points). It has no output.
Implementations§
Source§impl OpKind
impl OpKind
Sourcepub fn parse(
name: &str,
role: Option<&str>,
format: Option<Format>,
) -> Result<Self, OpParseError>
pub fn parse( name: &str, role: Option<&str>, format: Option<Format>, ) -> Result<Self, OpParseError>
2026-09-28: Resolve an op name. linear needs role, act_quant needs format;
every other op refuses both.
Sourcepub fn base_name(&self) -> &'static str
pub fn base_name(&self) -> &'static str
2026-09-28: The op’s base name (linear, act_quant, rms_norm, …).
Sourcepub fn name(&self) -> String
pub fn name(&self) -> String
2026-09-28: The canonical spelling with its qualifier, e.g. linear:down,
act_quant:fp8/token.
Sourcepub fn is_heavy(&self) -> bool
pub fn is_heavy(&self) -> bool
2026-09-28: An op that is never generated: projections, attention, the recurrence, the experts and the vocabulary projection. Fusion happens at its edges.
Sourcepub fn reads_linear_weight(&self) -> bool
pub fn reads_linear_weight(&self) -> bool
2026-09-28: Ops that read a weight whose format the precision resolver answers.
Trait Implementations§
Source§impl Ord for OpKind
impl Ord for OpKind
Source§impl PartialOrd for OpKind
impl PartialOrd for OpKind
impl Copy for OpKind
impl Eq for OpKind
impl StructuralPartialEq for OpKind
Auto Trait Implementations§
impl Freeze for OpKind
impl RefUnwindSafe for OpKind
impl Send for OpKind
impl Sync for OpKind
impl Unpin for OpKind
impl UnwindSafe for OpKind
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<Q, K> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.