For the complete documentation index, see llms.txt. Markdown versions of all pages are available by appending .md to any URL (e.g. /max/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:
Was this page helpful?
Thank you! We'll create more content like this.
Thank you for helping us improve!