torchx icon indicating copy to clipboard operation
torchx copied to clipboard

dist.ddp: tweaks to make torchelastic + lightning behave better on slurm

Open d4l3k opened this issue 2 years ago • 2 comments

This changes dist.ddp so the torchelastic rank matches the replica_id.

This is important when using slurm w/ lightning and NCCL+IB since NCCL errors can occur leading to crashes or deadlocks. It's not fully clear why this is the case.

This also updates compute_world_size to support running with NCCL since the tensors need to be on a GPU device.

Test plan:

CI

https://docs.google.com/document/d/10VSIVBlnmQ8na4pNXc9bS-HKvKco7JGDXiUsF9h3zwE/edit?usp=sharing

d4l3k avatar Apr 13 '22 22:04 d4l3k

@d4l3k has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator.

facebook-github-bot avatar Apr 13 '22 22:04 facebook-github-bot

Codecov Report

Merging #459 (7bcc23f) into main (289eff0) will not change coverage. The diff coverage is n/a.

@@           Coverage Diff           @@
##             main     #459   +/-   ##
=======================================
  Coverage   94.60%   94.60%           
=======================================
  Files          65       65           
  Lines        3834     3834           
=======================================
  Hits         3627     3627           
  Misses        207      207           
Impacted Files Coverage Δ
torchx/components/dist.py 79.06% <ø> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update 289eff0...7bcc23f. Read the comment docs.

codecov[bot] avatar Apr 13 '22 22:04 codecov[bot]

Hi @d4l3k!

Thank you for your pull request.

We require contributors to sign our Contributor License Agreement, and yours needs attention.

You currently have a record in our system, but the CLA is no longer valid, and will need to be resubmitted.

Process

In order for us to review and merge your suggested changes, please sign at https://code.facebook.com/cla. If you are contributing on behalf of someone else (eg your employer), the individual CLA may not be sufficient and your employer may need to sign the corporate CLA.

Once the CLA is signed, our tooling will perform checks and validations. Afterwards, the pull request will be tagged with CLA signed. The tagging process may take up to 1 hour after signing. Please give it that time before contacting us about it.

If you have received this in error or have any questions, please contact us at [email protected]. Thanks!

facebook-github-bot avatar Jan 21 '23 08:01 facebook-github-bot