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
Placement
Placement
class max.experimental.sharding.Placement
Bases: ABC
Abstract base for all placement types.
Each placement describes what a single mesh axis does to a tensor:
Replicated (full copy), Sharded (split along a tensor dim),
Partial (partial result needing reduction), or Unknown (per-device
values with no known relation).
local_dim()
local_dim(parent, mesh, mesh_axis, *, allow_symbolic_mint=True)
Returns the per-shard local cells of parent along mesh axes.
The default returns parent unchanged; Sharded overrides to
split. A wrapper parent is passed through verbatim.
-
Parameters:
-
- parent (int | str | Dim | integer | TypedAttr) – The global dim to localize.
- mesh (DeviceMesh) – The device mesh.
- mesh_axis (int | Sequence[int]) – The mesh axis that splits
parent, or every mesh axis that splits it. - allow_symbolic_mint (bool) – When
False, refuse to mint fresh per-shard symbols from a bareSymbolicDim. Reshape propagation passesFalse.
-
Return type:
localized_axis()
localized_axis()
Tensor axis this placement localizes, or None if it doesn’t.
-
Return type:
-
int | None
transition_to()
transition_to(other)
Returns the Collective for self -> other.
-
Parameters:
-
other (Placement)
-
Return type:
-
Collective