Interactive JavaScript ports of tt-metal's data-layout model — how a tensor's elements end up scattered across device cores.
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.
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.
Step-through walkthroughs of how pages and shards land on cores — one animation per distribution style.
Watch interleaved mapping unfold: a tensor is sliced into pages
(ROW_MAJOR or TILE) and dealt round-robin onto cores.
Classic height / width / block:
input → align (pad) → flatten (ND→2D) →
slice → shards→cores. Driven by
tensor_mapping.js.
Arbitrary N-D via TensorSpec::sharded:
input → pad → shard align →
slice ND (no flatten) → shards→cores.
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.