Skip to main content

tiling_cost

Function tiling_cost 

Source
pub fn tiling_cost(kt: usize, cfg: &TileConfig) -> u64
Expand description

Estimated per-site cost of a tiling (lower = faster) — a heuristic RANKING model, not an absolute cycle count. It captures the three levers that move blocked-matmul time: (1) parallelism — the per-site output-tile work per_core_m·per_core_n, minimized by using more sites (dominant term); (2) reuse — the number of accumulator acquires per site (per_core_m/osh)·(per_core_n/osw)·(kt/in0_block_w), minimized by a bigger sub-block and wider inner block; (3) reload — the spill/reload traffic when the contraction is blocked.