For the complete documentation index, see llms.txt. Markdown versions of all pages are available by appending .md to any URL (e.g. /get-started.md).
Python class
Sharded
Sharded
class max.experimental.sharding.Sharded(axis, even=True)
Bases: Placement
Every device on this mesh axis holds a slice along axis.
-
Parameters:
axis
axis: int
even
even: bool = True
global_dim()
global_dim(cells)
Sums per-shard cells along this mesh axis.
local_dim()
local_dim(parent, mesh, mesh_axis, *, allow_symbolic_mint=True)
Splits parent along mesh_axis into per-shard cells.
StaticDim parents use uneven divmod; SymbolicDim parents
mint fresh per-shard cells; AlgebraicDim parents raise.
Wrapper parents pass through verbatim. When
allow_symbolic_mint is False, a bare SymbolicDim
raises instead of minting.
localized_axis()
localized_axis()
Returns the tensor axis this Sharded localizes.
-
Return type:
-
int | None
transition_to()
transition_to(other)
Sharded-to-Replicated is allgather; Sharded-to-Sharded is all-to-all.
-
Parameters:
-
other (Placement)
-
Return type: