2024-03-27 序列并行

序列并行

Sequence parallelism is a memory-efficient parallelism method used in the training of Transformer models with long sequences on GPUs. It breaks the input sequence length limitation and allows for efficient training with longer sequences.

Here's how it works:

  • The input sequence is split into multiple chunks.
  • Each chunk is fed into its corresponding device (e.g., a GPU).
  • Ring-style communication is integrated with self-attention calculation.

With sequence parallelism, a single device no longer needs to hold the entire sequence. Moreover, with efficient attention mechanisms that have linear complexity, sequence parallelism can enable the training of a Transformer with an infinitely long sequence.

Experiments have shown that sequence parallelism performs well when scaling with batch size and sequence length. It's also compatible with most existing parallelisms (e.g., data parallelism, pipeline parallelism, and tensor parallelism), making 4D parallelism possible.

4D并行

四个维度:数据、流水线、张量、序列。

©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容