Skip to navigation

Custom Pipeline Model Parallel Layout

View as MarkdownOpen in Claude

This is an experimental feature and may be changed.

--pipeline-model-parallel-layout takes a string that defines pipeline parallel partitioning. Use it to balance partitioning for an imbalanced model. For example, to partition a DeepSeek-V3-style stack (61 decoder layers and one MTP layer) with PP16 and VPP2, pass arguments similar to the following:

--pipeline-model-parallel-size 16
--pipeline-model-parallel-layout "Et*3|(tt|)*29,m|L"

The table below shows one possible rank map for that layout:

PP \ VPP rank01
0embedding + 3 × decoder2 × decoder
1~132 × decoder2 × decoder
142 × decodermtp
152 × decoderloss

In the layout string, stages are split by |. Replicated stages or layers use multiplication (for example, t*3). Commas are optional for readability. Symbols:

  • E: embedding layer
  • t: transformer decoder layer
  • m: MTP layer
  • L: loss calculation layer

Note: Empty stages are allowed, for example E||t|L (the second stage is empty).