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_view
dcp_view()
max.nn.common_layers.context_parallel.dcp_view(mesh, dcp)
Returns mesh with its attention TP axis split into DCP groups.
The view holds the same devices in the same order, with the tp axis
(dcp_axis()) split into a tp
axis of tp / dcp groups and an innermost dcp axis of each
group’s ranks: (dp, tp) becomes (dp, tp / dcp, dcp). A
collective along dcp runs within each group, and a weight sharded
along the view’s tp axis and replicated along dcp gives each
group its own heads. With dcp == tp the view’s tp axis has one
group. A view is its own view.
-
Raises:
-
NotImplementedError – If
dcpdoes not tile the mesh’s attention TP axis (seecheck_dcp_mesh()). -
Parameters:
-
- mesh (DeviceMesh)
- dcp (int)
-
Return type: