ykzhang721 commited on
Commit
5ebeec1
·
verified ·
1 Parent(s): 9e07d12

Upload train.py with huggingface_hub

Browse files
Files changed (1) hide show
  1. train.py +6 -1
train.py CHANGED
@@ -73,7 +73,12 @@ from modelforseminat_v3 import *
73
  ################################# FSDP Config #####################################
74
  def setup():
75
  # initialize the process group
76
- dist.init_process_group("nccl")
 
 
 
 
 
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():