facebookresearch/fairseq

Add support for OpenMPI Rank Assignment

Open

#4,645 建立於 2022年8月11日

在 GitHub 查看
 (0 留言) (0 反應) (0 負責人)Python (6,224 fork)batch import
enhancementhelp wantedneeds triage

倉庫指標

Star
 (29,107 star)
PR 合併指標
 (30 天內沒有已合併 PR)

描述

🚀 Feature Request

Currently, there is no way to read the variables OMPI_COMM_WORLD_SIZE, OMPI_COMM_WORLD_RANK, and OMPI_COMM_WORLD_LOCAL_RANK to assign ranks to any individual processes launched with OpenMPI

Motivation

I'd like to launch jobs with OpenMPI without using multiple-data mode, which can cause issues with command length if I have to specify all of the ranks manually.

Pitch

Add _infer_ompi_init function in fairseq/distributed/utils.py which reads the environment variables:

MASTER_ADDR
MASTER_PORT
OMPI_COMM_WORLD_SIZE
OMPI_COMM_WORLD_RANK
OMPI_COMM_WORLD_LOCAL_RANK

and updates the distributed config accordingly.

Alternatives

N/A

Additional context

N/A

貢獻者指南