Skip to main content

Module cost

Module cost 

Source
Expand description

The calibrated cycle model — what makes “streamed vs multicast vs blocked” an EMERGENT plan decision.

Every quantity is computed FROM a candidate plan’s structure (tile-MACs, DRAM tile reads, circular-buffer hand-offs, multicast blocks, semaphores, kernel classes); the model turns them into predicted device cycles with a handful of constants. On Wormhole those constants are FITTED to the rows of the ttsim GEMM ledger (benchmarks/silicon/tenstorrent_gemm.json, written only by scripts/tt-gemm-ledger.py from real runs — never typed), within matched-knob groups only. Other targets carry an uncalibrated model whose absolute numbers are never asserted — only its structural monotonicity is. No strategy enum exists anywhere: the tile pass enumerates candidate plans and keeps the minimum of this function, and fuse_readers re-derives the same comparison for the fused/unfused pair.

Structs§

CalibrationPoint
One ttsim ledger row as a calibration point.
CostBreakdown
A plan’s cost, term by term, with the initiation interval its steady state runs at.
CycleModel
Per-cycle-model constants. Names mirror the terms of CycleModel::cycles.
GemmPlan
A candidate plan for a GEMM of mt × nt × kt tiles: the streaming point family or a blocked point.
MeasuredWork
The work meter recorded beside a calibration point: what the machine did, in counts it can report.
PlanDesc
The plan a ledger row printed.
PlanQuantities
The structural quantities of one candidate plan (per the busiest site, plus whole-program totals).

Enums§

OperandSharing
How an arrangement shares its operands across the mesh — the thing that decides DRAM traffic.
PaceBound
Which resource sets the pipeline’s pace.

Constants§

CALIBRATION_JSON
Path of the ttsim GEMM ledger, relative to the repo root.

Functions§

dram_tiles
How many DRAM tile-reads an arrangement costs, given the output tile grid and the reduction depth.
is_streaming
load_calibration_points
Parse the ledger’s CURRENT rows into calibration points. A row whose printed plan the model cannot quantify (a vendor example with an unknown blocking, a ttnn op) is kept with block: None and excluded from the fit by quantities_for_point.
quantities_for_gemm
Structural quantities of a candidate plan, analytically from the plan (the same formulas PlanSummary::dram_tiles_read reproduces from the built structure).
quantities_for_point
The quantities of a recorded point on target, when its plan is fully specified AND its knobs are ones the compiler emits on this target (the target’s declared fidelity; fp32 accumulate on or off). A row at a fidelity the pipeline never chooses is a comparison, not a calibration point.
streaming_plan
The streaming plan (one tile per work item, per-tile FIFOs).
vendor_example_blocking
The blocking the tt-metal matmul_multicore_reuse[_mcast] programming examples choose for a shape: a transcription of bmm_op_utils::get_large_matmul_params (the examples’ shared bmm_op.hpp helper under tt_metal/programming_examples/matmul) at the examples’ fixed in0_block_w = 2, so those ledger rows (whose host prints no config line) become fully specified calibration points. Returns (per_core_M, per_core_N, out_subblock_h, out_subblock_w); None where the vendor returns all zeros.