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
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),
or Partial (partial result needing reduction).
global_dim()β
global_dim(cells)
Combines per-shard cells along this mesh axis into one global Dim.
The default returns cells unchanged (every shard holds the
same dim). Sharded overrides to sum the cells.
local_dim()β
local_dim(parent, mesh, mesh_axis, *, allow_symbolic_mint=True)
Returns the per-shard local cells of parent along this mesh axis.
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) β The mesh axis index being localized.
- 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:
Was this page helpful?
Thank you! We'll create more content like this.
Thank you for helping us improve!