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_view

dcp_view()​

max.nn.common_layers.context_parallel.dcp_view(mesh, dcp)

source

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 dcp does not tile the mesh’s attention TP axis (see check_dcp_mesh()).

Parameters:

Return type:

DeviceMesh