mirror of
https://github.com/karpathy/nanochat.git
synced 2026-02-24 04:20:26 +00:00
chore: updated is_ddp to use more robust checks
Refactor is_ddp function to check whether ddp is being used or not
This commit is contained in:
parent
d6d86cbf4c
commit
1892172251
|
|
@ -76,8 +76,8 @@ def print_banner():
|
|||
print0(banner)
|
||||
|
||||
def is_ddp():
|
||||
# TODO is there a proper way
|
||||
return int(os.environ.get('RANK', -1)) != -1
|
||||
# check if DDP is available and initialized
|
||||
return dist.is_available() and dist.is_initialized()
|
||||
|
||||
def get_dist_info():
|
||||
if is_ddp():
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user