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_ranks
dcp_ranks()
max.nn.common_layers.context_parallel.dcp_ranks(mesh, dcp)
Returns each device’s rank in its DCP group, for call_on_mesh.
A device’s rank is its coordinate along the DCP axis
(dcp_axis()). That axis is innermost, so DCP groups are runs of
dcp consecutive devices in the mesh’s row-major order, and device
i is rank i % dcp.
-
Parameters:
-
- mesh (DeviceMesh)
- dcp (int)
-
Return type:
-
PerShard[int]