fix ddp for incorrect steps (#2915)

* fix ddp for incorrect steps

* add test
This commit is contained in:
Wing Lian
2025-07-14 07:51:16 -04:00
committed by GitHub
parent 9a8073e73d
commit 41664c7c4c
2 changed files with 45 additions and 0 deletions

View File

@@ -115,6 +115,7 @@ def normalize_config(cfg):
"chrf",
]
choose_device(cfg)
cfg.ddp = cfg.ddp if cfg.ddp is not None else cfg.world_size != 1
if cfg.world_size != 1:
cfg.device_map = {"": int(os.environ.get("LOCAL_RANK", 0))}
if cfg.fsdp or cfg.fsdp_config or cfg.ddp: