Upload train.py with huggingface_hub
Browse files
train.py
CHANGED
@@ -73,7 +73,12 @@ from modelforseminat_v3 import *
|
|
73 |
################################# FSDP Config #####################################
|
74 |
def setup():
|
75 |
# initialize the process group
|
76 |
-
|
|
|
|
|
|
|
|
|
|
|
77 |
|
78 |
|
79 |
def cleanup():
|
|
|
73 |
################################# FSDP Config #####################################
|
74 |
def setup():
|
75 |
# initialize the process group
|
76 |
+
local_rank = int(os.environ['LOCAL_RANK'])
|
77 |
+
torch.cuda.set_device(local_rank)
|
78 |
+
dist.init_process_group(
|
79 |
+
backend='nccl',
|
80 |
+
init_method='env://',
|
81 |
+
)
|
82 |
|
83 |
|
84 |
def cleanup():
|