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

transition_cost

transition_cost()

max.experimental.sharding.transition_cost(source, dest, *, message_bytes, mesh, axis_index)

source

Returns the cost of redistributing source to dest on axis_index.

Dispatches on Placement.transition_to(), so custom Placement subclasses participate as long as they return one of the built-in collective names ("nop", "local_slice", "allgather", "allreduce", "reduce_scatter", "all_to_all", or "infeasible"). Anything else is reported as infeasible (+inf) so solvers reject it.

Parameters:

Return type:

float