mstar.worker.spec_rows#
A speculative step’s per-row objects, built as columns.
Used for a speculation whose continuing rows take all their inputs from the step in flight, which covers a decode loop’s next step. Those rows need no per-row decisions when the step is built, so everything the model and the engine read per row is built here with C-level maps over the runtime’s columns, rather than by a Python loop per row.
Functions
|
Per row, |
Classes
|
|
- class mstar.worker.spec_rows.DeferredRowInputs(request_ids, signals=())[source]#
Bases:
MutableMappingper_request_input_tensorsof a speculative step built before the step in flight has produced its outputs. A row with no inputs of its own maps every signal insignalsto an empty list, built the first time the row is read.When every continuing row’s inputs stayed on the device, threading N’s outputs in only names the signals (
set_signals), and a step the engine prepares throughuniform_row_inputsnever builds a row. Otherwise threadingmaterialize``s the rows and splices them one by one. Fresh rows are given the inputs their pop gathered (``rows[rid] = inputs), whichset_signalsleaves alone.
- mstar.worker.spec_rows.loop_counter_snapshots(infos, loop_name, n_next_iter)[source]#
Per row,
InputMetadatacarrying its own copy of the loop counters.The first
n_next_iterrows run one iteration past the shared counters inloop_name; the rest run at them. A copy, not a view: the shared counters move when the in-flight step is routed, which can happen while this step is being prepared.- Parameters:
infos (list[CurrentForwardPassInfo])
loop_name (str | None)
n_next_iter (int)
- Return type: