Expand description
The step-local memory of a lane’s forms. Every array a step computes and reads within the step — a tensor’s f32
(or i32) buffer, or its quantized form — lives in one arena the program allocates once, placed by its lifetime:
from the launch that first writes it whole to the last launch that touches it, through any view of it. A launch’s
scratch lives there while the launch runs. The forms share the arena, one form running at a time.
Structs§
- Arena
- A form’s arena: its placed arrays, its launches’ placed scratch, and the bytes they span.
- Placed
- An array placed in the arena:
bytesfromoffset, live from launchfirstto launchlastof its form. - Placed
Scratch - A launch’s scratch placed in the arena:
bytesfromoffset, live while launchlaunchof its form runs. - Scratch
- A launch’s scratch:
tagnames it beside the launch’s result,tyis its element type andbytesits size. A counter — an arrival count the launch’s last block resets — is zero before the launch and left zero by it, so it keeps a zeroed buffer of its own; the rest live in the arena while the launch runs.
Constants§
- ALIGN
- Every array’s alignment in the arena:
cudaMalloc’s, past every vector load the kernels make.
Functions§
- array_
bytes - The bytes of a tensor of
lenelements’ array: itsf32buffer, or its quantized form — the int8 words, then the low words under two words, then a scale a block — each part aligned. - home
- The tensor whose array a touch of tensor
namelands in: an alias’s — a view’s — is the tensor it is a part of, through every alias, but the quantized form of an alias whose rows start inside a block is its own. - place
- Place the arrays of
sthat live within its step: a computed tensor’s that is not one of the step’s inputs or outputs, all of it written before any launch reads it — whole, or part by part over every unit (join_in_place) — so nothing the step reads of it was left by another array, or by an earlier step. Each lives from its first touch to its last, through any view of it. The largest first, each at the lowest aligned offset clear of every array placed live beside it. - quant_
parts - Where the parts of a quantized array placed at
offsetstart: its words, its low words under two words, its scales. - scratch
- The scratch launch
ltakes undernumerics: the delta rule’s unnormed outputs; an expert mixture’s router logits, choices and weights, and over a block’s rows its choices grouped by expert, each choice’s gathered activation row, hidden row (gate and up rows apart on the tensor cores, the hidden row quantized alone when they are paired) and weighed result; a tensor-core projection’s parts of the tiles its last wave cuts alongk, and their counts; anf32GEMM’s parts of the tiles it cuts alongk; the arg-max’s block maxima; a split attention’s chunk partials (none in tiles); an attention in two words’ keys and values in two words and their scales — and the arrival counts.