From 9a08bb4edb63ded661fa418b7d668815959f1e73 Mon Sep 17 00:00:00 2001 From: Azekowka Date: Tue, 14 Oct 2025 17:09:04 +0500 Subject: [PATCH] Reapply "Refactor: Improve DDP detection in common.py" This reverts commit 1a45e5b78a3b05ea193f04214f76d5371137f0d8. --- nanochat/common.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/nanochat/common.py b/nanochat/common.py index 8b10df9..fb6c49a 100644 --- a/nanochat/common.py +++ b/nanochat/common.py @@ -76,7 +76,8 @@ def print_banner(): print0(banner) def is_ddp(): - # TODO is there a proper way + if dist.is_initialized(): + return True return int(os.environ.get('RANK', -1)) != -1 def get_dist_info():