fairseq icon indicating copy to clipboard operation
fairseq copied to clipboard

Slower speed with distributed multi-node training

Open okgrammer opened this issue 7 years ago • 7 comments

Hi, I am running the IWSLT'14 en-de translation example on 2 machines each with 4 Titan X GPUs. I am getting speed of about 10K wps with 2 machines, while running on a single machine gives a speed of ~38K wps. Any tips for optimizing the speed, or whether I am missing something here? Thanks.

okgrammer avatar Jun 10 '19 10:06 okgrammer

What version of NCCL are you using? There’s a known bug with the latest version of NCCL that makes it slow over Ethernet. Can you try using an older version of NCCL (2.3.x) or patching this: https://github.com/NVIDIA/nccl/pull/223

Some other settings you might explore:

  • ddp-backend=no_c10d: This maybe even slower, but please confirm
  • bucket-cap-mb: Try tuning this

myleott avatar Jun 10 '19 12:06 myleott

Hi, thank you for your reply and I'll try your suggestions. Is there an easy way to check the NCCL version, and also to downgrade it to version 2.3.x? If I'm not wrong it comes with the PyTorch installation with pip.

okgrammer avatar Jun 10 '19 13:06 okgrammer

If you rerun with the environment variable NCCL_DEBUG=INFO it will print debug information, including the version.

myleott avatar Jun 10 '19 14:06 myleott

Apparently the NCCL version is 2.3.7 for both machines..

okgrammer avatar Jun 11 '19 01:06 okgrammer

I also tried exploring the ddp-backend and bucket-cap-mb parameters (varying up to 150MB and more), but no significant differences in speed they are still ~4x slower than simply running on a single node with multi-gpu.

BTW, the 2 machines are interconnected through ethernet switch with 900M-1Gbps bandwidth, as I tested using iperf. Will I need to configure a cluster management like SLURM in order to make the distributed training work?

okgrammer avatar Jun 12 '19 08:06 okgrammer

Ah, that interconnect is quite slow. How many params are in the model? Probably the interconnect is the bottleneck, so you’re spending most of the time communicating gradients.

myleott avatar Jun 12 '19 21:06 myleott

The model has 42,864,640 params - it is the transformer_iwslt_de_en used in the example.

okgrammer avatar Jun 15 '19 05:06 okgrammer