Module Tolk_uop.Ops
UOp operation tags.
Constructor declaration order is part of the semantics: compare, toposort stability, and commutative-operand canonicalisation use the constructor ordinal. Do not add, remove, or reorder constructors without updating the parity tests.
Types
type t = | Bind| Special(*Hardware index, such as group, local, or global ids.
*)| Buffer(*Buffer allocation or buffer identity.
*)| Noop(*Pass-through scheduling marker.
*)| Rewrite_error(*Rewrite failure marker.
*)| Param(*Function, symbolic, or buffer parameter.
*)| Function(*Gradient-able function body.
*)| Call(*Opaque kernel invocation.
*)| Program(*Program root.
*)| Linear(*Linearized uop sequence.
*)| Source(*Human-readable rendered source.
*)| Binary(*Compiled machine-code bytes.
*)| Sink(*Graph or kernel root gathering children.
*)| After(*Passes
*)src.(0)through aftersrc.(1..).| Group(*Merges dependencies without producing a value.
*)| Stack(*Constructs value vectors and shape tuples.
*)| Tuple(*Multi-result function body.
*)| Gettuple| Getaddr(*HCQ address extraction op.
*)| Index(*Pointer arithmetic over a base pointer and offsets.
*)| Shrink(*Trims edges per axis; declared in tinygrad's load/store block.
*)| Load(*Loads from an indexed pointer.
*)| Store(*Stores through an indexed pointer.
*)| Wmma(*Tensor-core matrix multiply-accumulate.
*)| Shaped_wmma| Cast(*Value-preserving type conversion.
*)| Bitcast(*Bit-preserving reinterpretation.
*)| Exp2(*Base-2 exponential.
*)| Log2(*Base-2 logarithm.
*)| Sin(*Sine.
*)| Sqrt(*Square root.
*)| Reciprocal(*Reciprocal,
*)1 / x.| Neg(*Arithmetic negation.
*)| Trunc(*Truncation toward zero.
*)| Add(*Addition.
*)| Mul(*Multiplication.
*)| Shl(*Bitwise left shift.
*)| Shr(*Bitwise right shift.
*)| Cdiv(*C-style truncating integer division.
*)| Max(*Pointwise maximum.
*)| Cmod(*C-style integer remainder.
*)| Cmplt(*Less-than comparison.
*)| Cmpne(*Inequality comparison.
*)| Cmpeq(*Equality comparison.
*)| Xor(*Bitwise XOR.
*)| Or(*Bitwise OR.
*)| And(*Bitwise AND.
*)| Threefry(*Threefry counter-based RNG round.
*)| Sub(*Subtraction.
*)| Fdiv(*Floating-point division.
*)| Pow(*Exponentiation.
*)| Floordiv(*Floor integer division.
*)| Floormod(*Floor integer modulo.
*)| Where(*Ternary select.
*)| Mulacc(*Fused multiply-accumulate.
*)| Barrier(*Workgroup barrier.
*)| Range(*Loop variable.
*)| If(*Predicated control-flow gate.
*)| End(*Closes one or more loops around a value.
*)| Endif| Wait(*Wait/synchronisation point.
*)| Const(*Compile-time constant.
*)| Custom(*Backend-specific statement.
*)| Customi(*Backend-specific inline expression.
*)| Ins(*Backend machine instruction.
*)| Contiguous(*Forces contiguous layout.
*)| Contiguous_backward(*Backward-pass contiguous marker.
*)| Detach(*Detaches from gradient tracking.
*)| Stage(*Staged buffer before final buffer materialisation.
*)| Copy(*Cross-device copy.
*)| Slice(*Slice of a buffer identity.
*)| Mselect(*Selects one shard of a sharded value.
*)| Mstack(*Stacks per-device shards.
*)| Custom_function(*User-defined tensor-stage function.
*)| Reshape(*Rearranges elements into a new shape.
*)| Permute(*Permutes axes.
*)| Expand(*Broadcasts to a target shape.
*)| Pad(*Pads per axis.
*)| Flip(*Reverses selected axes.
*)| Multi(*Distributes a value across devices.
*)| Reduce(*Reduction by
*)Add,Mul, orMax.| Allreduce(*Cross-device reduction.
*)
One flat tag per tinygrad uop kind.
val name : t -> stringname op is the uppercase tinygrad operator name.
Groups
Group exposes operation families used by validation and rewrites. Lists use stable declaration-oriented order; predicates and lists agree.
module Group : sig ... end