tt-metal sharding visualizers

Interactive JavaScript ports of tt-metal's data-layout model — how a tensor's elements end up scattered across device cores.

Tensor sharding →

The full story: a logical N-D tensor shape, a layout (row-major or 32×32 tile), and a sharding scheme map every element to a page, then to a core. Ported from tensor_spec.hpp.

elements → pages → cores
row majortile 32×32 interleaveheight widthblockND

Buffer page-mapping →

The lower layer: given a list of pages, which bank/core does each land in, and at what shard offset? Ported from buffer.hpp — the page → core step the tensor model builds on.

pages → shards → banks
interleavecontinuous (height) grid (width / block)ND

Animated mappings

Step-through walkthroughs of how pages and shards land on cores — one animation per distribution style.

Interleaved →

Watch interleaved mapping unfold: a tensor is sliced into pages (ROW_MAJOR or TILE) and dealt round-robin onto cores.

tensor → pages → cores (round-robin)
interleaverow major tilestep-through

2D sharding →

Classic height / width / block: input → align (pad) → flatten (ND→2D) → slice → shards→cores. Driven by tensor_mapping.js.

input → pad → flatten → slice → cores
heightwidth blockstep-through

ND sharding →

Arbitrary N-D via TensorSpec::sharded: input → pad → shard align → slice ND (no flatten) → shards→cores.

input → pad → shard-align → slice ND → cores
NdShardSpecround-robin grid 2Dstep-through

How they relate

The buffer model assumes shapes are already in pages. The tensor model adds the missing step in front of it: folding an element shape into pages via the layout (compute_physical_shape → get_page_shape), then handing the resulting page grid + shard shape to the very same page → core logic. Animated mappings walk through that story per distribution — interleaved round-robin, classic 2D height / width / block, or arbitrary ND sharding. Sources: tensor_spec.hpp, buffer.hpp.