For the complete documentation index, see llms.txt. Markdown versions of all pages are available by appending .md to any URL (e.g. /get-started.md).
Python function
split_layers
split_layers()
max.pipelines.lib.pipeline_parallel.split_layers(spec, num_stages, sizes=None)
Returns each pipeline stage’s decoder layer count.
-
Parameters:
-
- spec (PartitionSpec) – Where the decoder may be cut.
- num_stages (int) – The number of pipeline stages.
- sizes (list[int] | None) – Layer counts to validate. When
None, the split closest to an even one, with the remainder on the earliest stages, whose cuts the spec allows.
-
Raises:
-
ValueError – If
num_stagesis not positive,sizesis invalid, or no allowed cuts leave every stage a layer. -
Return type: