[QUESTION] How to overlap comms and computation with `--overlap-grad-reduce` & `--overlap-param-gather`?
- Dominant language
- Python
- Stars
- 17.9k
- Forks
- 4.5k
- Avg merge
- 4d 6h
- Merged PRs (30d)
- 271
Description
Hello Megatron team,
Visualising a trace setting `--overlap-grad-reduce` & `--overlap-param-gather` I observed that we aren't overlapping anything when setting those flags. Im running a 8B model with TP = 1, PP = 1, CP = 1 & DP = 64.
But, when I unset `CUDA_DEVICE_MAX_CONNECTIONS` (In the first image it was set to 1), I can clearly see that we are overlapping comms and computations
In [arguments.py](https://github.com/NVIDIA/Megatron-LM/blob/832f1d2915e2e56a0d81e02ad249f5c55a6210b8/megatron/training/arguments.py#L687-L690) we are checking that `CUDA_DEVICE_MAX_CONNECTIONS` as it's a requirement for TP & CP, but shouldn't we check/warn that when setting TP/CP > 1 the overlap features are useless? I think It would be a good idea to check and document this behaviour with `CUDA_DEVICE_MAX_CONNECTIONS` so users can leverage this great optimisations!
I could document this behaviour myself through a PR.
Toni
Contributor guide
Assessment
This issue has not been assessed yet.