mirror of
https://github.com/osmarks/nanogpt-experiments.git
synced 2024-11-14 05:44:51 +00:00
local rank -> rank
This commit is contained in:
parent
cf99914886
commit
f5e6ac8b02
6
train.py
6
train.py
@ -70,11 +70,11 @@ config = {k: globals()[k] for k in config_keys} # will be useful for logging
|
|||||||
# -----------------------------------------------------------------------------
|
# -----------------------------------------------------------------------------
|
||||||
|
|
||||||
# various inits, derived attributes, I/O setup
|
# various inits, derived attributes, I/O setup
|
||||||
ddp = int(os.environ.get('LOCAL_RANK', -1)) != -1 # is this a ddp run?
|
ddp = int(os.environ.get('RANK', -1)) != -1 # is this a ddp run?
|
||||||
if ddp:
|
if ddp:
|
||||||
init_process_group(backend=backend)
|
init_process_group(backend=backend)
|
||||||
gpu_id = int(os.environ["LOCAL_RANK"])
|
gpu_id = int(os.environ['RANK'])
|
||||||
device = f"cuda:{gpu_id}"
|
device = f'cuda:{gpu_id}'
|
||||||
else:
|
else:
|
||||||
gpu_id = 0 # gpu_id 0 means this is the (single) master process, basically
|
gpu_id = 0 # gpu_id 0 means this is the (single) master process, basically
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user