Skip to main content

encode

Function encode 

Source
pub fn encode(jobs: &[Job]) -> Vec<u64>
Expand description

A job as the sequencer reads it: 64-bit words, a header and then the job’s own.

The header’s [3:0] is the unit — 0 the embedding, 1 the array, 2 the vector unit, 3 the recurrence unit, 4 the attention unit, 5 the step’s advance — [4] a vector job’s order (heads first when set), [12:5] the layer, [20:13] a vector job’s fresh slots, [28:21] its loads, [36:29] its stores, [52:37] its instructions. The embedding’s word is its tensor; the array’s its tensor [19:0], its slots [24:20] and [29:25] and its fold [31:30] (Fold::code); the recurrence unit’s its seven slots five bits each from bit 0 and the values’ element [54:35]; a vector job’s header its chunk flag at [53] (VectorJob::chunked: run a chunk of its vectors at a time) and its group flag at [54] (VectorJob::grouped: its passes stand alone); the attention unit’s its query and output slots [4:0] and [9:5], its heads [25:10] and its score scale’s bits [57:26]. A vector job’s words are its heads, each fresh slot ([4:0] the slot, [36:5] its width), each load and each store in two words, and each instruction (super::rtl::simd::encode). A load’s first word holds its register [3:0], its source [7:4] (0 a slot, 1 a tensor, 2 a rotary table, 3 a ring), the slot, tensor, table or layer [23:8], the ring row’s age, the sines’ flag or a tensor’s kept flag (VectorJob::kept: loaded on the job’s first pass alone) [31:24] and its length [63:32]; a store’s its register [3:0], scalar [4], its sink [7:5] (0 a slot, 1 a ring, 2 a cache), the slot or layer [23:8], values [24], the cache part [26:25] (halves, codes, scale) and its length [63:32]; the second word of each its element [31:0] and its stride a head [63:32].