Archived
The v1 rows grid by row: shrink is one block a row walking K serially, and expand one block a (row, 256 columns) that re-reads all of B[s] for every row, so a prefill chunk reads it M times and a chunk of base rows still launches M * ceil(N/256) blocks that read a slot and leave. lora_shrink_wmma (bf16 a) and lora_shrink_wmma_q (fp8 / i8 codes whose scale group is whole 32-wide steps) run WMMA bf16 over 16-row x 16-j tiles: K in 32-wide steps over 4 waves, the waves summed in fixed order in LDS, and a K split fixed by K and R alone (sh_plan) whose partials live in the op's scratch and are summed in split order by the last block to arrive; the arrival counters are a small block keyed on (device, t). Codes are exact in bf16 and each step's partial is scaled by its group's f32 scale; f16 / f32 activations and other groups stay on the scalar kernel. lora_expand_tiled stages B[s]'s [128 columns, 32 j] slab in LDS as f32 for a 32-row tile and keeps v1's per-output sequence (j ascending, no FMA), so its bytes are libref's. Both grid by row tiles; a tile of base rows leaves on one ballot before any barrier or operand load, a mixed tile runs one pass per distinct slot, and a small grid spreads a tile's passes over blockIdx.z. No choice depends on M but which block runs a pass. The scalar rows stay, by name and as the f16 / f32 shrink, below R4D_PRIO_LORA_TILED.