pub enum OpKind {
MatMul,
MatMulId,
Norm,
Rope,
Elementwise,
Copy,
Gather,
Sdpa,
Softmax,
MoeGate,
Other,
}Expand description
Classification of a compute operation for reorder safety analysis.
Operations marked as reorderable can be freely reordered by the graph optimizer (Phase 4e.3) as long as their data dependencies allow it. Non-reorderable operations have side effects or dependencies that require them to stay in their original sequential position.
Variants§
MatMul
Matrix multiplication (reorderable).
MatMulId
Expert-routed matrix multiplication (reorderable).
Norm
Normalization — RMS norm, layer norm (reorderable).
Rope
Rotary position embedding (reorderable).
Elementwise
Elementwise ops — add, mul, scale, gelu, softcap, etc. (reorderable).
Copy
Memory copy — KV cache copy, embedding gather (reorderable).
Gather
Gather/scatter (reorderable).
Sdpa
Scaled dot-product attention (NOT reorderable).
Softmax
Softmax (NOT reorderable).
MoeGate
MoE gate with CPU readback dependency (NOT reorderable).
Other
Anything else (NOT reorderable).