IMPORTANT: To view this page as Markdown, append `.md` to the URL (e.g. /max/get-started.md). For the complete documentation index, see llms.txt.
Skip to main content
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 function

build_action_set

build_action_set()​

max.experimental.sharding.build_action_set(rows, *, layouts, extras=(), result_shape=None, finalize=None, finalize_ctx=None)

source

Wraps rule-emitted rows into a feasibility-filtered ActionSet.

Filters rows to entries feasible on at least one mesh axis and appends the universal (R,...,R) -> R fallback if absent.

Parameters:

  • rows (Iterable[AxisAssignment]) – Per-axis decisions the rule wants on the menu. Order is preserved as the cost-model tie-breaker.
  • layouts (tuple[TensorLayout, ...]) – Tensor input layouts, one per tensor positional arg.
  • extras (tuple[Any, ...]) – Non-tensor positional args forwarded to the picked Action.
  • result_shape (Sequence[Dim] | None) – Output shape constraint for reshape-style rules.
  • finalize (Callable[[Action, Any], Action] | None) – Optional post-pick transform of shape (action, ctx) -> action.
  • finalize_ctx (Any) – Opaque per-op context forwarded to finalize.

Return type:

ActionSet