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
PerShardDim
PerShardDim
class max.experimental.sharding.PerShardDim(per_shard=(), *, global_dim=None)
Bases: Dim
A Dim whose per_shard tuple lists one cell per mesh shard.
Used on Sharded axes when shards hold different per-device
sizes (uneven static splits, dynamic axes minted per-shard). The
wrapper must be projected per shard via local_dim_at() before
reaching MLIR.
Allocates the wrapper, returning per_shard itself on a plain re-wrap.
-
Parameters:
-
Return type:
is_static
property is_static: bool
True if this axis’s global extent is a static size.
Folds to the global dim first (see global_dim()), so a sharded
axis whose global is static reports True even though
isinstance(self, StaticDim) is False.
is_symbolic
property is_symbolic: bool
True if this axis’s global extent is a symbolic (named) dim.
parameters
property parameters: Iterable[SymbolicDim]
Distinct symbolic-dim parameters referenced across all cells.
per_shard
to_mlir()
to_mlir()
Raises; wrappers must be projected per shard before reaching MLIR.
-
Return type:
Was this page helpful?
Thank you! We'll create more content like this.
Thank you for helping us improve!