OpCapability
PythonOptimization contracts an operator may declare.
OpCapability()Optimization contracts an operator may declare.
Flags compose with |. The base operator declares
:attr:NONE; subclasses widen the set as they satisfy each contract.
NONE
PythonNONE = 0No declared contract. The operator is emitted inline, retains its
per-instance _init, is never interned, and is never statically
reordered. Always correct; the safe default.
STATELESS
PythonSTATELESS = enum.auto()The operator emits no per-instance _init and no mutable
file-scope (non-const) storage. Generalizes has_init is False.
DESCRIPTOR_DRIVEN
PythonDESCRIPTOR_DRIVEN = enum.auto()The operator’s _run body is a pure function of a
single const per-node descriptor plus ctx->tensor_ptrs. It
bakes no absolute addresses and holds no mutable state. Eligible for
kernel-body interning and direct static scheduling.
SHARED_KERNEL
PythonSHARED_KERNEL = enum.auto()The operator routes its _run body through a single
signature-keyed shared runtime helper (emitted once) rather than an
inlined per-node body. Generalizes a non-empty
shared_kernel_helpers / shared_activation_helpers.
STATIC_SCHEDULABLE
PythonSTATIC_SCHEDULABLE = enum.auto()The operator is safe to invoke via a direct static call site (no requirement for the runtime function-pointer table).
PURE
PythonPURE = enum.auto()The operator has no side effects beyond writing its output tensors. Reserved for future fusion/scheduling passes.
REORDERABLE
PythonREORDERABLE = enum.auto()The operator’s schedule position is flexible within its data dependencies. Reserved for future scheduling passes.