mirror of
https://github.com/karpathy/nanochat.git
synced 2026-01-03 10:12:42 +00:00
Refactor: Improve DDP detection in common.py
This commit is contained in:
parent
dd6812c83e
commit
b724190f2a
|
|
@ -76,7 +76,8 @@ def print_banner():
|
||||||
print0(banner)
|
print0(banner)
|
||||||
|
|
||||||
def is_ddp():
|
def is_ddp():
|
||||||
# TODO is there a proper way
|
if dist.is_initialized():
|
||||||
|
return True
|
||||||
return int(os.environ.get('RANK', -1)) != -1
|
return int(os.environ.get('RANK', -1)) != -1
|
||||||
|
|
||||||
def get_dist_info():
|
def get_dist_info():
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user