For the complete documentation index, see llms.txt. Markdown versions of all pages are available by appending .md to any URL (e.g. /get-started.md).
Mojo module
tensor_arg_traits
Composable traits for graph-compiler kernel tensor arguments.
A kernel declares each tensor argument by combining small, orthogonal traits with trait composition instead of naming a single monolithic tensor type.
The traits fall into three groups:
- Role traits (
Input,Output,MutableInput) declare how the kernel uses the argument: read-only, write-only destination, or read-write in place. Exactly one role applies to each argument. - The
Fusedmarker declares that the operand participates in prologue or epilogue fusion. - The
Stablemarker declares that the argument's storage is a stable address slot, read throughStableAddrEngine(device only). - Metadata and access traits describe what the kernel can read off the argument
(
Tensor) and how it touches individual elements. The access markers carry no metadata; bindTensoralongside them to read the dtype, rank, or shape.
Element access is split into marker / capability pairs. A graph-visible marker
(LoadAccess, StoreAccess) records the access form in the distilled contract
but adds no method; the matching capability (Loadable, Storable)
additionally supplies the method the kernel body calls. A kernel typically binds
the marker in its signature and refines to the capability inside its body, so
the same argument type works whether it stays on the host or is projected to a
device.
_LegacyComputeOutput is the exception: it doesn't guarantee its capability
_LegacyComputable, and the graph compiler may deliver Storable instead. It
is legacy machinery; read its docstring before using it.
The interim tile epilogue traits live in legacy_tile_traits.
Traits
-
Fused: Marker trait: the operand participates in fusion. -
Input: Tells the graph compiler this argument is a read-only input. -
Loadable:LoadAccessrefined with the callableloadmethod. -
LoadAccess: Marker trait: this tensor supports SIMD loads. -
MutableInput: Tells the graph compiler this argument is a mutable input. -
Output: Tells the graph compiler this argument is an output. -
Stable: Marker trait: the argument's data pointer lives in a stable address slot. -
Storable:StoreAccessrefined with the callablestoremethod. -
StoreAccess: Marker trait: this tensor supports SIMD stores. -
Tensor: Metadata trait exposing a tensor's element type, known rank, and shape. -
TileTensorable: ATensorbacked by a dense layout that can project to aTileTensorview over its storage. -
UnsafeFusedView: Flags a fused trait argument whose host and device views share a byte-identical layout.
Functions
-
unsafe_fused_view: Rebinds a fused trait argument to its access-enabled projected view.