IMPORTANT: To view this page as Markdown, append `.md` to the URL (e.g. /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. /get-started.md).

Python class

PartitionSpec

PartitionSpec​

class max.pipelines.lib.pipeline_parallel.PartitionSpec(num_layers, forbidden_cuts=frozenset({}))

source

Bases: object

Where a checkpoint’s decoder may be cut into pipeline stages.

An architecture config returns one from an optional construct_partition_spec(huggingface_config) classmethod, which it defines only when some cut is forbidden or its decoder counts layers other than get_num_layers does. Returning None refuses pipeline parallelism for that checkpoint.

Parameters:

forbidden_cuts​

forbidden_cuts: frozenset[int] = frozenset({})

source

Layer ids no stage may start at, such as a layer that reads a cache an earlier layer writes.

num_layers​

num_layers: int

source

The number of decoder layers.