Module roofline

Module roofline 

Source
Expand description

2026-09-29: The roofline estimate of one node’s time in one step, from its edge shapes and formats: max(bytes / DRAM bandwidth, FLOPs / tensor peak). It ranks a Venn report’s rows until measured profiles replace it.

Owner: metrale-circuit (venn). Invariants:

  • Bytes are every edge the node reads or writes at rows rows, plus its weights, plus the state it reads and writes: the paged KV cache over context_tokens per sequence, the GatedDeltaNet and Mamba2 recurrent states (FP32, read and written once per sequence).
  • Routed experts read E * (1 - (1 - k/E)^T) distinct experts’ weights for T tokens (uniform routing).
  • The peak is the MMA class of the node’s input activation: FP8 or NVFP4 activations run the FP8 / NVFP4 MMA; anything else (W4A16, W8A16, BF16) runs the BF16 MMA.
  • Not counted: launch overhead, conv windows, KV writes beyond their input edges. A dim an op needs that the circuit lacks is an error, never a guess.

Structs§

Cost
2026-09-29: One node’s estimate.

Enums§

CostError
2026-09-29: Why a node could not be estimated.

Functions§

node_cost
2026-09-29: Estimate node at rows rows of mode.
nvfp4_mma
2026-10-01: n multiplies an NVFP4 activation by a linear weight: the node the NVFP4 peak costs.