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
NamedMapping
NamedMappingβ
class max.experimental.sharding.NamedMapping(mesh, spec=(), *, unreduced=())
Bases: DeviceMapping
Builds a DeviceMapping from a JAX-style named spec.
Each spec entry corresponds to a tensor dim and names the mesh
axis that shards it (or None for replicated). Mesh-axis names
not present on the target mesh resolve to Replicated.
unreduced names mesh axes carrying a pending reduction; each
becomes a Partial placement. After construction this is
a regular DeviceMapping; the spec is forgotten.
-
Parameters:
-
- mesh (DeviceMesh) β The target device mesh.
- spec (tuple[SpecEntry, ...]) β One entry per tensor dimension.
- unreduced (Iterable[str]) β Mesh axes carrying pending reductions.
original_specβ
property original_spec: tuple[str | tuple[str, ...] | None, ...]
Returns the caller-supplied spec before mesh resolution.
Preserved so _resolve() can rebind this mapping against
another mesh.
original_unreducedβ
The caller-supplied unreduced axes, preserved for re-resolution.
Was this page helpful?
Thank you! We'll create more content like this.
Thank you for helping us improve!