kernel_input_gradient.bend checks
raw source on the hub · import stelliferous@0.0.4.0/kernel_input_gradient.bend as Kernel_input_gradient
The input gradient of a convolution by phases: output positions congruent modulo the stride read the same taps. Every row of every output channel of the output gradient is cut into eight-lane tiles once for each column shift the phases read, zero outside; a phase entry is then a tile, and a job is a GEMM block that stores its tiles at the final strided positions of its piece. The cells of both gradients are those of a tensor: the groups of a position side by side, position after position. Every task copies the rows of the output gradient its pieces read and computes its pieces from them.
26 imports
import Base import ./storage_buffer.bend as Storage import ./kernel_tile.bend as Tile import ./kernel_gemm.bend as Gemm import ./kernel_gemm_buffer.bend as GemmBuffer import ./proofs/kernel_gemm_certificate.bend as GemmCertificate import ./storage_copy.bend as StorageCopy import ./storage_clone.bend as StorageClone import ./kernel_input_gradient_fill.bend as Fill import ./proofs/storage_certificate.bend as Certificate import ./proofs/traversal_certificate.bend as TraversalCertificate import ./proofs/kernel_input_gradient_fill_certificate.bend as FillCertificate import ./tensor_view.bend as Views import ./kernel_pipeline.bend as Pipeline import ./traversal_array.bend as Traversal import ./traversal_partition.bend as Partition import ./tensor.bend as Tensors import ./tensor_tiled.bend as Tiled import ./tensor_tiled_map.bend as TiledMap import ./tensor_grid.bend as Grid import ./tensor_pieces.bend as Pieces import ./tensor_tasks.bend as Tasks import ./tensor_halo.bend as Halo import ./tensor_move.bend as Move import ./kernel_cost.bend as Cost import ./default_kernel_cost.bend as DefaultCost
Types
type Geometry source · line 36 · raw
Data
Geometry@channels:U32 -> @outputs:U32 -> @height:U32 -> @width:U32 -> @kernel:U32 -> @stride:U32 -> @padding:U32 -> @rows:U32 -> @columns:U32 -> Geometry
type Axis source · line 39 · raw
Data
Axis@first:U32 -> @count:U32 -> @tap:U32 -> @taps:U32 -> @source:U32 -> Axis
type Phase source · line 48 · raw
Data
Phase@geometry:Geometry -> @y:Axis -> @x:Axis -> @inner:U32 -> Phase
type Tiling source · line 84 · raw
Data
The tiling cuts every row of every output channel of the output gradient into eight-lane tiles, once for each column shift the phases read, zero outside. It is built in chunks of at most chunk_rows output rows and chunk_groups groups, about one pipeline block of tiles; one output row of one group is the smallest chunk, and fits bounds it by the capacity. A chunk holds tile rows * chunk_groups blocks of outputs * shifts tiles (output channel outer, shift inner) and one unused tile, so that the rows a step reads do not share cache sets. Tile row t is gradient row t - kernel; shift i starts at gradient column 8 * group + i + column_low - kernel.
Tiling@groups:U32 -> @shifts:U32 -> @outputs:U32 -> @column_low:U32 -> @kernel:U32 -> @height:U32 -> @width:U32 -> @chunk_groups:U32 -> @chunk_rows:U32 -> Tiling
type Band source · line 91 · raw
Data
The outputs [first, last) of an axis of the given size. Over the phases that read a tap for one of them: what 0 the lowest tile (lowest output + source + kernel), what 1 one past the highest tile (highest output + source + kernel + taps), what 2 the most outputs of a phase.
Band@size:U32 -> @kernel:U32 -> @stride:U32 -> @padding:U32 -> @first:U32 -> @last:U32 -> @what:U32 -> Band
type Source source · line 141 · raw
Type
Rows [first, first + rows) of the output gradient of one image, from cell base of data on.
Source@data:0xa2af805348d03b11eb853850859654f6/storage_buffer.Buffer<0xa2af805348d03b11eb853850859654f6/kernel_tile.Tile8> -> @base:U32 -> @first:U32 -> @rows:U32 -> Source
type Jobs source · line 157 · raw
Type
Jobs@tiles:0xa2af805348d03b11eb853850859654f6/storage_buffer.Buffer<0xa2af805348d03b11eb853850859654f6/kernel_tile.Tile8> -> @weights:0xa2af805348d03b11eb853850859654f6/storage_buffer.Buffer<0xa2af805348d03b11eb853850859654f6/kernel_tile.Tile8> -> @output:0xa2af805348d03b11eb853850859654f6/storage_buffer.Buffer<0xa2af805348d03b11eb853850859654f6/kernel_tile.Tile8> -> Jobs
type Plan source · line 173 · raw
Data
One job is eight consecutive outputs of one phase row, its rows a stride apart, at the eight input channels of one group, its lanes: the cell of group g at local position p is at p * cells + g. Its steps run over the phase entries, the weights from weight_base.
Plan@units:U32 -> @groups:U32 -> @inner:U32 -> @source_base:U32 -> @row_step:U32 -> @group_step:U32 -> @target_base:U32 -> @target_row:U32 -> @step:U32 -> @cells:U32 -> @channels:U32 -> @columns:U32 -> @weight_base:U32 -> @tap_columns:U32 -> @tap_rows:U32 -> @row_jump:U32 -> @output_jump:U32 -> Plan
type Packed source · line 203 · raw
Type
Every phase weights, side by side in phase order.
Packed@source:0xa2af805348d03b11eb853850859654f6/storage_buffer.Buffer<0xa2af805348d03b11eb853850859654f6/kernel_tile.Tile8> -> @weights:0xa2af805348d03b11eb853850859654f6/storage_buffer.Buffer<0xa2af805348d03b11eb853850859654f6/kernel_tile.Tile8> -> @weight_base:U32 -> Packed
type Task source · line 252 · raw
Data
Task@geometry:Geometry -> @layout:Tiling -> Task
type Leaf source · line 255 · raw
Type
Leaf@tiles:0xa2af805348d03b11eb853850859654f6/storage_buffer.Buffer<0xa2af805348d03b11eb853850859654f6/kernel_tile.Tile8> -> @weights:0xa2af805348d03b11eb853850859654f6/storage_buffer.Buffer<0xa2af805348d03b11eb853850859654f6/kernel_tile.Tile8> -> @output:0xa2af805348d03b11eb853850859654f6/storage_buffer.Buffer<0xa2af805348d03b11eb853850859654f6/kernel_tile.Tile8> -> @weight_base:U32 -> Leaf
type LeafContext source · line 261 · raw
Data
Output rows [first, first + count) go to the cells from target on: the cell of group g at row and column is target + ((row - first) * width + column) * groups + g.
LeafContext@task:Task -> @first:U32 -> @count:U32 -> @target:U32 -> LeafContext
type Chunk source · line 266 · raw
Data
Output rows [row, row + rows) and groups [group, group + chunk_groups) of a leaf, over a chunk of the tiling that starts at tile row low.
Chunk@leaf:LeafContext -> @row:U32 -> @rows:U32 -> @low:U32 -> @group:U32 -> Chunk
type Part source · line 305 · raw
Type
The gradient a leaf read, the weights and the output it wrote.
Part@gradient:0xa2af805348d03b11eb853850859654f6/storage_buffer.Buffer<0xa2af805348d03b11eb853850859654f6/kernel_tile.Tile8> -> @weights:0xa2af805348d03b11eb853850859654f6/storage_buffer.Buffer<0xa2af805348d03b11eb853850859654f6/kernel_tile.Tile8> -> @output:0xa2af805348d03b11eb853850859654f6/storage_buffer.Buffer<0xa2af805348d03b11eb853850859654f6/kernel_tile.Tile8> -> Part
type Sweep source · line 309 · raw
Type
A leaf runs its chunks in turn with the source and the weights.
Sweep@source:Source -> @weights:0xa2af805348d03b11eb853850859654f6/storage_buffer.Buffer<0xa2af805348d03b11eb853850859654f6/kernel_tile.Tile8> -> @output:0xa2af805348d03b11eb853850859654f6/storage_buffer.Buffer<0xa2af805348d03b11eb853850859654f6/kernel_tile.Tile8> -> Sweep
type Rows source · line 391 · raw
Type
A task between images: the gradient pieces it holds, the spare its bands are assembled in, the weights and the output.
Rows@gradient:0xa2af805348d03b11eb853850859654f6/tensor_move.Holding<0xa2af805348d03b11eb853850859654f6/kernel_tile.Tile8> -> @spare:0xa2af805348d03b11eb853850859654f6/tensor_move.Spare<0xa2af805348d03b11eb853850859654f6/kernel_tile.Tile8> -> @weights:0xa2af805348d03b11eb853850859654f6/storage_buffer.Buffer<0xa2af805348d03b11eb853850859654f6/kernel_tile.Tile8> -> @output:0xa2af805348d03b11eb853850859654f6/storage_buffer.Buffer<0xa2af805348d03b11eb853850859654f6/kernel_tile.Tile8> -> Rows
type Work source · line 497 · raw
Data
What every task reads: the work and the grid of the input gradient.
Work@task:Task -> @grid:0xa2af805348d03b11eb853850859654f6/tensor_grid.Grid -> Work
type Outcome source · line 558 · raw
Type
Outcome@weights:0xa2af805348d03b11eb853850859654f6/storage_buffer.Buffer<0xa2af805348d03b11eb853850859654f6/kernel_tile.Tile8> -> @output:0xa2af805348d03b11eb853850859654f6/tensor_pieces.Pieces(0xa2af805348d03b11eb853850859654f6/kernel_tile.Tile8) -> Outcome
Definitions
def axis source · line 42 · raw
@+first:U32 -> @+size:U32 -> @+kernel:U32 -> @+stride:U32 -> @+padding:U32 -> Axis
def phase_axes source · line 51 · raw
@geometry:Geometry -> @a:Axis -> @b:Axis -> Phase
def phase source · line 57 · raw
@+geometry:Geometry -> @+y:U32 -> @+x:U32 -> Phase
def window_jobs source · line 61 · raw
@geometry:Geometry -> Nat
def phase_of source · line 65 · raw
@geometry:Geometry -> @index:U32 -> Phase
def phase_inner source · line 71 · raw
@context:Phase -> U32
def band_pick source · line 94 · raw
@used:Bool -> @+low:U32 -> @+high:U32 -> @+count:U32 -> @+value:U32 -> @what:U32 -> U32
def band_measure source · line 99 · raw
@+context:Axis -> @+kernel:U32 -> @+stride:U32 -> @+first:U32 -> @+last:U32 -> @+value:U32 -> @what:U32 -> U32
def band_phase source · line 105 · raw
@index:U32 -> @context:Band -> @value:U32 -> U32
def band_fold source · line 109 · raw
@+context:Band -> @value:U32 -> U32
def taps source · line 115 · raw
@+kernel:U32 -> @+stride:U32 -> U32
Output rows [first, first + rows) read at most rows - 1 + taps tile rows, taps = ceil(kernel / stride), and shifts is at most taps + 1.
def fits source · line 118 · raw
@+geometry:Geometry -> @+capacity:U32 -> Bool
def chunked source · line 123 · raw
@+groups:U32 -> @+shifts:U32 -> @+outputs:U32 -> @+column_low:U32 -> @+kernel:U32 -> @+stride:U32 -> @+height:U32 -> @+width:U32 -> @+limit:U32 -> Tiling
def tiling source · line 132 · raw
@geometry:Geometry -> Tiling
Column shifts come from the first output of every column phase; groups from the most outputs of a column phase.
def fill_buffers source · line 144 · raw
@source_length:Nat -> @length:Nat -> @result:Pair(Array<0xa2af805348d03b11eb853850859654f6/kernel_tile.Tile8>, Array<0xa2af805348d03b11eb853850859654f6/kernel_tile.Tile8>) -> @certificates:0xa2af805348d03b11eb853850859654f6/proofs/traversal_certificate.Certificates<Array<0xa2af805348d03b11eb853850859654f6/kernel_tile.Tile8>, 0xa2af805348d03b11eb853850859654f6/kernel_tile.Tile8, 0xa2af805348d03b11eb853850859654f6/proofs/storage_certificate.family(0xa2af805348d03b11eb853850859654f6/kernel_tile.Tile8), result> -> Pair(0xa2af805348d03b11eb853850859654f6/storage_buffer.Buffer<0xa2af805348d03b11eb853850859654f6/kernel_tile.Tile8>, 0xa2af805348d03b11eb853850859654f6/storage_buffer.Buffer<0xa2af805348d03b11eb853850859654f6/kernel_tile.Tile8>)
def filled_tiles source · line 151 · raw
@+call:0xa2af805348d03b11eb853850859654f6/kernel_input_gradient_fill.Call -> @owners:Pair(0xa2af805348d03b11eb853850859654f6/storage_buffer.Buffer<0xa2af805348d03b11eb853850859654f6/kernel_tile.Tile8>, 0xa2af805348d03b11eb853850859654f6/storage_buffer.Buffer<0xa2af805348d03b11eb853850859654f6/kernel_tile.Tile8>) -> Pair(0xa2af805348d03b11eb853850859654f6/storage_buffer.Buffer<0xa2af805348d03b11eb853850859654f6/kernel_tile.Tile8>, 0xa2af805348d03b11eb853850859654f6/storage_buffer.Buffer<0xa2af805348d03b11eb853850859654f6/kernel_tile.Tile8>)
The tiles of a chunk and the source they are read from, both certified.
def Cursor source · line 163 · raw
Data
The gradient tile of phase entry (output o, tap row a, tap column b) is the first tile + a * row_step + o * shifts + b: a grid of tap_columns by tap_rows entries for each output. The weights are consecutive.
def entries source · line 166 · raw
@cursor:Cursor -> 0xa2af805348d03b11eb853850859654f6/kernel_gemm.Step<Cursor>
def job source · line 178 · raw
@plan:Plan -> @index:U32 -> 0xa2af805348d03b11eb853850859654f6/kernel_gemm.Job<Cursor>
def jobs_kept source · line 190 · raw
@kept:0xa2af805348d03b11eb853850859654f6/kernel_gemm_buffer.Kept<0xa2af805348d03b11eb853850859654f6/kernel_tile.Tile8> -> Jobs
def jobs source · line 196 · raw
@+count:Nat -> @+plan:Plan -> @state:Jobs -> Jobs
Each cell is its ordered fold, the gradient times the weight, then + 0.0. The gradient tiles are the rows, the weights the lanes.
def packed_copied source · line 206 · raw
@+weight_base:U32 -> @+count:U32 -> @copies:Pair(0xa2af805348d03b11eb853850859654f6/storage_buffer.Buffer<0xa2af805348d03b11eb853850859654f6/kernel_tile.Tile8>, 0xa2af805348d03b11eb853850859654f6/storage_buffer.Buffer<0xa2af805348d03b11eb853850859654f6/kernel_tile.Tile8>) -> Packed
def weight_view source · line 211 · raw
@context:Phase -> 0xa2af805348d03b11eb853850859654f6/tensor_view.View
Cells [C/8,O,K,K], the groups outermost, in phase order [C/8,O,tap row,tap column].
def packed_phase source · line 216 · raw
@+context:Phase -> @+weight_base:U32 -> @source:0xa2af805348d03b11eb853850859654f6/storage_buffer.Buffer<0xa2af805348d03b11eb853850859654f6/kernel_tile.Tile8> -> @weights:0xa2af805348d03b11eb853850859654f6/storage_buffer.Buffer<0xa2af805348d03b11eb853850859654f6/kernel_tile.Tile8> -> Packed
def pack_selected source · line 222 · raw
@empty:Bool -> @+context:Phase -> @state:Packed -> Packed
def pack_phase source · line 230 · raw
@index:U32 -> @geometry:Geometry -> @state:Packed -> Packed
def weight_total source · line 234 · raw
@index:U32 -> @geometry:Geometry -> @total:U32 -> U32
def band_low source · line 239 · raw
@+geometry:Geometry -> @+first:U32 -> @+last:U32 -> U32
The tile rows that output rows [first, last) read.
def band_high source · line 243 · raw
@+geometry:Geometry -> @+first:U32 -> @+last:U32 -> U32
def band_rows source · line 247 · raw
@+geometry:Geometry -> @+first:U32 -> @+count:U32 -> U32
def leaf_jobs source · line 271 · raw
@+context:Phase -> @+chunk:Chunk -> @+weight_base:U32 -> @state:Jobs -> Jobs
A tile row of the chunk is one gradient row, so a phase line and a tap row both move by row_step; the first entry reads shift xs + k - column_low.
def leaf_finished source · line 287 · raw
@+weight_base:U32 -> @state:Jobs -> Leaf
def leaf_selected source · line 291 · raw
@empty:Bool -> @+context:Phase -> @+chunk:Chunk -> @state:Leaf -> Leaf
def leaf_phase source · line 299 · raw
@index:U32 -> @chunk:Chunk -> @state:Leaf -> Leaf
def chunk_leaf source · line 312 · raw
@+base:U32 -> @+first:U32 -> @+rows:U32 -> @data:0xa2af805348d03b11eb853850859654f6/storage_buffer.Buffer<0xa2af805348d03b11eb853850859654f6/kernel_tile.Tile8> -> @state:Leaf -> Sweep
def chunk_finished source · line 316 · raw
@+base:U32 -> @+first:U32 -> @+rows:U32 -> @pair:Pair(0xa2af805348d03b11eb853850859654f6/storage_buffer.Buffer<0xa2af805348d03b11eb853850859654f6/kernel_tile.Tile8>, Leaf) -> Sweep
def chunk_run source · line 320 · raw
@+chunk:Chunk -> @weights:0xa2af805348d03b11eb853850859654f6/storage_buffer.Buffer<0xa2af805348d03b11eb853850859654f6/kernel_tile.Tile8> -> @output:0xa2af805348d03b11eb853850859654f6/storage_buffer.Buffer<0xa2af805348d03b11eb853850859654f6/kernel_tile.Tile8> -> @owners:Pair(0xa2af805348d03b11eb853850859654f6/storage_buffer.Buffer<0xa2af805348d03b11eb853850859654f6/kernel_tile.Tile8>, 0xa2af805348d03b11eb853850859654f6/storage_buffer.Buffer<0xa2af805348d03b11eb853850859654f6/kernel_tile.Tile8>) -> Pair(0xa2af805348d03b11eb853850859654f6/storage_buffer.Buffer<0xa2af805348d03b11eb853850859654f6/kernel_tile.Tile8>, Leaf)
def chunk_step source · line 326 · raw
@index:U32 -> @context:LeafContext -> @state:Sweep -> Sweep
Chunk index: row chunk outer, group chunk inner.
def swept source · line 344 · raw
@state:Sweep -> Part
def leaf_band source · line 349 · raw
@+context:LeafContext -> @source:Source -> @weights:0xa2af805348d03b11eb853850859654f6/storage_buffer.Buffer<0xa2af805348d03b11eb853850859654f6/kernel_tile.Tile8> -> @output:0xa2af805348d03b11eb853850859654f6/storage_buffer.Buffer<0xa2af805348d03b11eb853850859654f6/kernel_tile.Tile8> -> Part
Output rows [first, first + count) from a source holding the gradient rows they read.
def copy_start source · line 356 · raw
@+geometry:Geometry -> @+first:U32 -> @+rows:U32 -> U32
The gradient rows [start, start + count) that output rows [first, first + rows) read.
def copy_stop source · line 361 · raw
@+geometry:Geometry -> @+first:U32 -> @+rows:U32 -> U32
def copy_count source · line 366 · raw
@+geometry:Geometry -> @+first:U32 -> @+rows:U32 -> U32
def row_cells source · line 373 · raw
@+geometry:Geometry -> U32
def gradient_row_cells source · line 377 · raw
@+geometry:Geometry -> U32
def image_height source · line 381 · raw
@+geometry:Geometry -> U32
def gradient_height source · line 385 · raw
@+geometry:Geometry -> U32
def rows_back source · line 394 · raw
@returned:Pair(0xa2af805348d03b11eb853850859654f6/tensor_move.Holding<0xa2af805348d03b11eb853850859654f6/kernel_tile.Tile8>, 0xa2af805348d03b11eb853850859654f6/tensor_move.Spare<0xa2af805348d03b11eb853850859654f6/kernel_tile.Tile8>) -> @weights:0xa2af805348d03b11eb853850859654f6/storage_buffer.Buffer<0xa2af805348d03b11eb853850859654f6/kernel_tile.Tile8> -> @output:0xa2af805348d03b11eb853850859654f6/storage_buffer.Buffer<0xa2af805348d03b11eb853850859654f6/kernel_tile.Tile8> -> Rows
def image_returned source · line 398 · raw
@lent:0xa2af805348d03b11eb853850859654f6/tensor_move.Lent<0xa2af805348d03b11eb853850859654f6/kernel_tile.Tile8> -> @part:Part -> Rows
def image_banded source · line 402 · raw
@+task:Task -> @+first:U32 -> @+count:U32 -> @+target:U32 -> @banded:0xa2af805348d03b11eb853850859654f6/tensor_move.Band<0xa2af805348d03b11eb853850859654f6/kernel_tile.Tile8> -> @weights:0xa2af805348d03b11eb853850859654f6/storage_buffer.Buffer<0xa2af805348d03b11eb853850859654f6/kernel_tile.Tile8> -> @output:0xa2af805348d03b11eb853850859654f6/storage_buffer.Buffer<0xa2af805348d03b11eb853850859654f6/kernel_tile.Tile8> -> Rows
def image_rows source · line 410 · raw
@+task:Task -> @+image:U32 -> @+first:U32 -> @+count:U32 -> @+target:U32 -> @rows:Rows -> Rows
Rows [first, first + count) of one image, written from cell target of the output, from the gradient rows they read, lent from the pieces that hold them.
def batch_rows source · line 419 · raw
@fuel:Nat -> @+task:Task -> @+row:U32 -> @+end:U32 -> @+target:U32 -> @rows:Rows -> Rows
Rows [row, end) of the batch, image by image, from cell target on.
def images_between source · line 429 · raw
@+geometry:Geometry -> @+row:U32 -> @+end:U32 -> Nat
def first_row source · line 434 · raw
@+geometry:Geometry -> @+first:U32 -> U32
The rows of the batch that hold the cells [first, first + count).
def end_row source · line 437 · raw
@+geometry:Geometry -> @+first:U32 -> @+count:U32 -> U32
def Operands source · line 441 · raw
Type
def rows_whole source · line 444 · raw
@rows:Rows -> Pair(0xa2af805348d03b11eb853850859654f6/storage_buffer.Buffer<0xa2af805348d03b11eb853850859654f6/kernel_tile.Tile8>, Operands)
def rows_cut source · line 448 · raw
@+offset:U32 -> @+count:U32 -> @rows:Rows -> Pair(0xa2af805348d03b11eb853850859654f6/storage_buffer.Buffer<0xa2af805348d03b11eb853850859654f6/kernel_tile.Tile8>, Operands)
def piece_kept source · line 453 · raw
@whole:Bool -> @+offset:U32 -> @+count:U32 -> @rows:Rows -> Pair(0xa2af805348d03b11eb853850859654f6/storage_buffer.Buffer<0xa2af805348d03b11eb853850859654f6/kernel_tile.Tile8>, Operands)
def piece_padded source · line 459 · raw
@+geometry:Geometry -> @+first:U32 -> @+count:U32 -> @pair:Pair(0xa2af805348d03b11eb853850859654f6/storage_buffer.Buffer<0xa2af805348d03b11eb853850859654f6/kernel_tile.Tile8>, Operands) -> Pair(0xa2af805348d03b11eb853850859654f6/storage_buffer.Buffer<0xa2af805348d03b11eb853850859654f6/kernel_tile.Tile8>, Operands)
The cells of a piece with +0 in the lanes past the channels.
def piece_cells source · line 467 · raw
@+task:Task -> @+first:U32 -> @+count:U32 -> @operands:Operands -> Pair(0xa2af805348d03b11eb853850859654f6/storage_buffer.Buffer<0xa2af805348d03b11eb853850859654f6/kernel_tile.Tile8>, Operands)
The cells [first, first + count) of the input gradient: the rows that hold them, computed whole, and the cells cut from them when the piece holds part of a row.
def reach source · line 481 · raw
@+task:Task -> @+first:U32 -> @+count:U32 -> 0xa2af805348d03b11eb853850859654f6/tensor_tasks.Span
The output gradient cells that the cells [first, first + count) read: from the first row the first image reads to the last row the last image reads. Rows of an image that read no gradient row start at the end of its rows and stop at its first row.
def task_tree source · line 502 · raw
@remaining:Nat -> @+task:Task -> @+grid:0xa2af805348d03b11eb853850859654f6/tensor_grid.Grid -> @+piece:U32 -> @ready:0xa2af805348d03b11eb853850859654f6/tensor_pieces.Walking<0xa2af805348d03b11eb853850859654f6/storage_buffer.Buffer<0xa2af805348d03b11eb853850859654f6/kernel_tile.Tile8>, Operands> -> 0xa2af805348d03b11eb853850859654f6/tensor_pieces.Walked<0xa2af805348d03b11eb853850859654f6/storage_buffer.Buffer<0xa2af805348d03b11eb853850859654f6/kernel_tile.Tile8>, Operands>
The pieces from piece on, remaining more after it. Each piece waits on the left for the pieces after it, so the task calls no closure.
def task_finished source · line 517 · raw
@+first:U32 -> @+count:U32 -> @walked:0xa2af805348d03b11eb853850859654f6/tensor_pieces.Walked<0xa2af805348d03b11eb853850859654f6/storage_buffer.Buffer<0xa2af805348d03b11eb853850859654f6/kernel_tile.Tile8>, Operands> -> Pair(0xa2af805348d03b11eb853850859654f6/traversal_partition.Tree<&1, 0xa2af805348d03b11eb853850859654f6/tensor_pieces.Pieces(0xa2af805348d03b11eb853850859654f6/kernel_tile.Tile8), Unit>, 0xa2af805348d03b11eb853850859654f6/storage_buffer.Buffer<0xa2af805348d03b11eb853850859654f6/kernel_tile.Tile8>)
def task_leaf source · line 524 · raw
@work:Work -> @first:U32 -> @count:U32 -> @window:0xa2af805348d03b11eb853850859654f6/tensor_move.Holding<0xa2af805348d03b11eb853850859654f6/kernel_tile.Tile8> -> @weights:0xa2af805348d03b11eb853850859654f6/storage_buffer.Buffer<0xa2af805348d03b11eb853850859654f6/kernel_tile.Tile8> -> Pair(0xa2af805348d03b11eb853850859654f6/traversal_partition.Tree<&1, 0xa2af805348d03b11eb853850859654f6/tensor_pieces.Pieces(0xa2af805348d03b11eb853850859654f6/kernel_tile.Tile8), Unit>, 0xa2af805348d03b11eb853850859654f6/storage_buffer.Buffer<0xa2af805348d03b11eb853850859654f6/kernel_tile.Tile8>)
A task: its pieces from the gradient pieces it holds and its copy of the weights.
def reach_of source · line 533 · raw
@+task:Task -> @+first:U32 -> @+count:U32 -> 0xa2af805348d03b11eb853850859654f6/tensor_tasks.Span
def windowed_tasks source · line 540 · raw
@+work:Work -> @+gradient_grid:0xa2af805348d03b11eb853850859654f6/tensor_grid.Grid -> @decision:0xa2af805348d03b11eb853850859654f6/tensor_tasks.Decision -> @gradient:0xa2af805348d03b11eb853850859654f6/tensor_pieces.Pieces(0xa2af805348d03b11eb853850859654f6/kernel_tile.Tile8) -> @weights:0xa2af805348d03b11eb853850859654f6/storage_buffer.Buffer<0xa2af805348d03b11eb853850859654f6/kernel_tile.Tile8> -> 0xa2af805348d03b11eb853850859654f6/tensor_pieces.Pieces(0xa2af805348d03b11eb853850859654f6/kernel_tile.Tile8)
def windowed_when source · line 547 · raw
@empty:Bool -> @+task:Task -> @+grid:0xa2af805348d03b11eb853850859654f6/tensor_grid.Grid -> @+gradient_grid:0xa2af805348d03b11eb853850859654f6/tensor_grid.Grid -> @decision:0xa2af805348d03b11eb853850859654f6/tensor_tasks.Decision -> @gradient:0xa2af805348d03b11eb853850859654f6/tensor_pieces.Pieces(0xa2af805348d03b11eb853850859654f6/kernel_tile.Tile8) -> @weights:0xa2af805348d03b11eb853850859654f6/storage_buffer.Buffer<0xa2af805348d03b11eb853850859654f6/kernel_tile.Tile8> -> 0xa2af805348d03b11eb853850859654f6/tensor_pieces.Pieces(0xa2af805348d03b11eb853850859654f6/kernel_tile.Tile8)
def windowed source · line 554 · raw
@+work:Work -> @+gradient_grid:0xa2af805348d03b11eb853850859654f6/tensor_grid.Grid -> @decision:0xa2af805348d03b11eb853850859654f6/tensor_tasks.Decision -> @gradient:0xa2af805348d03b11eb853850859654f6/tensor_pieces.Pieces(0xa2af805348d03b11eb853850859654f6/kernel_tile.Tile8) -> @weights:0xa2af805348d03b11eb853850859654f6/storage_buffer.Buffer<0xa2af805348d03b11eb853850859654f6/kernel_tile.Tile8> -> 0xa2af805348d03b11eb853850859654f6/tensor_pieces.Pieces(0xa2af805348d03b11eb853850859654f6/kernel_tile.Tile8)
An empty input gradient has no task.
def cell_inner source · line 564 · raw
@+geometry:Geometry -> F32
One cell of the input gradient: a multiply-add row of its eight channels for every output channel of every tap of its phase, its store, and its share of the packed gradient tiles over its groups.
def cell_rows source · line 573 · raw
@+geometry:Geometry -> F32
def cell_steps source · line 576 · raw
@+geometry:Geometry -> F32
def extra_of source · line 581 · raw
@+geometry:Geometry -> @+whole:U32 -> @+weight_tiles:U32 -> 0xa2af805348d03b11eb853850859654f6/tensor_tasks.Extra
What a task beyond the first adds: its own weights, and a halo of the gradient rows that two tasks of one image both read.
def packed_run source · line 586 · raw
@+geometry:Geometry -> @+grid:0xa2af805348d03b11eb853850859654f6/tensor_grid.Grid -> @+gradient_grid:0xa2af805348d03b11eb853850859654f6/tensor_grid.Grid -> @+whole:U32 -> @+workers:U32 -> @gradient:0xa2af805348d03b11eb853850859654f6/tensor_pieces.Pieces(0xa2af805348d03b11eb853850859654f6/kernel_tile.Tile8) -> @packed:Packed -> Outcome
def tiled source · line 591 · raw
@+geometry:Geometry -> @+grid:0xa2af805348d03b11eb853850859654f6/tensor_grid.Grid -> @+gradient_grid:0xa2af805348d03b11eb853850859654f6/tensor_grid.Grid -> @+whole:U32 -> @+workers:U32 -> @gradient:0xa2af805348d03b11eb853850859654f6/tensor_pieces.Pieces(0xa2af805348d03b11eb853850859654f6/kernel_tile.Tile8) -> @weights:0xa2af805348d03b11eb853850859654f6/storage_buffer.Buffer<0xa2af805348d03b11eb853850859654f6/kernel_tile.Tile8> -> Outcome
def run_selected source · line 598 · raw
@empty:Bool -> @+geometry:Geometry -> @+cells:List<&2, U32> -> @+gradient_grid:0xa2af805348d03b11eb853850859654f6/tensor_grid.Grid -> @+whole:U32 -> @+workers:U32 -> @gradient:0xa2af805348d03b11eb853850859654f6/tensor_pieces.Pieces(0xa2af805348d03b11eb853850859654f6/kernel_tile.Tile8) -> @weights:0xa2af805348d03b11eb853850859654f6/storage_buffer.Buffer<0xa2af805348d03b11eb853850859654f6/kernel_tile.Tile8> -> Outcome
def run source · line 608 · raw
@+geometry:Geometry -> @+cells:List<&2, U32> -> @+gradient_grid:0xa2af805348d03b11eb853850859654f6/tensor_grid.Grid -> @+whole:U32 -> @+workers:U32 -> @gradient:0xa2af805348d03b11eb853850859654f6/tensor_pieces.Pieces(0xa2af805348d03b11eb853850859654f6/kernel_tile.Tile8) -> @weights:0xa2af805348d03b11eb853850859654f6/storage_buffer.Buffer<0xa2af805348d03b11eb853850859654f6/kernel_tile.Tile8> -> Outcome
The output gradient cells [N][Ho][Wo][O / 8] on gradient_grid and the weight cells [C / 8][O][k][k] give the input gradient cells of the cell shape cells, [N][H][W][C / 8]. A task holds the cells of whole images in runs of whole.