ttnn.verify_shards_match_topology

ttnn.verify_shards_match_topology(tensor: ttnn.Tensor, *, compare_replica_contents: bool = ``True``) → None

Check that a host tensor’s topology label describes its shards.

Every populated shard must sit at a coordinate the label lists and every labelled coordinate must hold a shard (or be remote to this host); shards the label calls replicas of each other (mesh coordinates that differ only along Replicate axes) must have the same size and, unless compare_replica_contents is False, the same values (tile padding is not compared). dump_tensor runs this check before it writes one copy per replica group; it is exposed so that any other caller that keeps one copy per group, such as a checkpoint gather that composes a tensor by its label, can run it for the same reason.

Parameters:

tensor (ttnn.Tensor)a host tensor (tensor.cpu()).

Keyword Arguments:

compare_replica_contents (bool, optional)byte-compare replicas, not only their sizes. Defaults to True.

Raises:

RuntimeErrornaming the mesh coordinates and the label when the label does not describe the shards.