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

gather_columns

gather_columns()​

max.nn.common_layers.context_parallel.gather_columns(x, dcp)

source

All-gathers each rank’s [T, c] columns into [T, dcp * c].

Rank r of a DCP group gets its columns at [r * c, (r + 1) * c), so a tensor whose columns are a rank’s run of heads gathers into all of its group’s heads in order. Each group gathers only its own ranks’ columns, and on a (dp, tp) mesh only within its replica. The result is on x’s mesh, Replicated along tp when one group spans it, else Unknown there: the groups gathered different columns.

Parameters:

Return type:

Tensor