From 41bd7b16f2eef9ff8624e3368c163eacf9ea8787 Mon Sep 17 00:00:00 2001 From: geronimi73 Date: Wed, 15 Oct 2025 04:42:46 +0200 Subject: [PATCH] ddp check --- nanochat/common.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/nanochat/common.py b/nanochat/common.py index 8b10df9..747669b 100644 --- a/nanochat/common.py +++ b/nanochat/common.py @@ -76,8 +76,7 @@ def print_banner(): print0(banner) def is_ddp(): - # TODO is there a proper way - return int(os.environ.get('RANK', -1)) != -1 + return dist.is_available() and dist.is_initialized() def get_dist_info(): if is_ddp():