Megatron-LM icon indicating copy to clipboard operation
Megatron-LM copied to clipboard

[QUESTION]Are there more efficient implementations for sliding window in Megatron?

Open oblivioncat opened this issue 1 year ago • 1 comments

I'm working on long-text pre-training with context parallelism (CP) using Megatron. Are there more efficient implementations for sliding window training in this scenario? Currently, we're using the all_gather strategy, but the forward pass is extremely slow.it has even led to timeout issues. Could this be because the single-layer communication volume of all_gather is CP times that of full attention, leading to excessive communication overhead?

Environment details: Megatron v0.12.0 Transformer Engine v1.12 CUDA 12.3 GPU: H100

oblivioncat avatar Nov 12 '25 11:11 oblivioncat

Sliding window attention is currently compatible with both all_gather and a2a (DeepSpeed Ulysses). You can specify the desired communication type using the --cp-comm-type argument.

This document from Megatron-Bridge is interesting too

asolergi-nv avatar Nov 13 '25 18:11 asolergi-nv