File tree Expand file tree Collapse file tree 1 file changed +8
-3
lines changed Expand file tree Collapse file tree 1 file changed +8
-3
lines changed Original file line number Diff line number Diff line change @@ -70,8 +70,13 @@ def log(message):
70
70
logger .info (f"[rank { os .environ ['LOCAL_RANK' ]} ] { message } " )
71
71
72
72
73
- def check_checkpoint_path_access (checkpoint_path : str , rank : int ):
74
- dummy_file_path = os .path .join (checkpoint_path , f"dummy_file_{ rank } .txt" )
73
+ def check_checkpoint_path_access (checkpoint_path : str , rank : int , world_rank_hv : int | None = None ):
74
+ if world_rank_hv :
75
+ dummy_file_path = os .path .join (
76
+ checkpoint_path , get_diloco_rank_dir_name (world_rank_hv ), f"dummy_file_{ rank } .txt"
77
+ )
78
+ else :
79
+ dummy_file_path = os .path .join (checkpoint_path , f"dummy_file_{ rank } .txt" )
75
80
with fsspec .open (dummy_file_path , "w" ) as f :
76
81
f .write ("This is a dummy file for testing access." )
77
82
gfs = GenericFileSystem ()
@@ -221,7 +226,7 @@ def train(config: Config):
221
226
log_visible_maddrs (dht .get_visible_maddrs (), only_p2p = False )
222
227
223
228
if local_rank == 0 :
224
- check_checkpoint_path_access (config .checkpoint_path , rank )
229
+ check_checkpoint_path_access (config .checkpoint_path , rank , config . hv . world_rank if config . hv else None )
225
230
226
231
# DataLoader preparation
227
232
tokenizer = AutoTokenizer .from_pretrained ("mistralai/Mistral-7B-v0.1" , use_fast = True )
You can’t perform that action at this time.
0 commit comments