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 function

dcp_axis

dcp_axis()​

max.nn.common_layers.mesh_axis.dcp_axis(mesh)

source

Returns the index of the mesh axis a DCP group spans.

Decode context parallelism (DCP, see max.nn.common_layers.context_parallel) spans the dcp axis of a mesh’s DCP view. On a mesh without one it spans the tp axis, or the only axis of a one-axis mesh, of which a DCP group is a run of consecutive devices.

Raises:

NotImplementedError – If a mesh of several axes has no tp axis.

Parameters:

mesh (DeviceMesh)

Return type:

int