File tree Expand file tree Collapse file tree 1 file changed +5
-2
lines changed
aiu_fms_testing_utils/utils Expand file tree Collapse file tree 1 file changed +5
-2
lines changed Original file line number Diff line number Diff line change @@ -518,14 +518,17 @@ def sample_sharegpt_requests(
518518) -> List [Tuple [str , int ]]:
519519 if not os .path .exists (dataset_path ):
520520 print ("downloading share-gpt dataset as it does not exist" )
521- if rank < 1 :
521+ is_distributed_initialized = torch .distributed .is_initialized ()
522+ if not is_distributed_initialized or rank < 1 :
522523 __download_file (
523524 "https://huggingface.co/datasets/anon8231489123/ShareGPT_Vicuna_unfiltered/resolve/main/ShareGPT_V3_unfiltered_cleaned_split.json" ,
524525 dataset_path ,
525526 )
526527 else :
527528 print ("waiting for rank0 to complete download" )
528- torch .distributed .barrier ()
529+
530+ if is_distributed_initialized :
531+ torch .distributed .barrier ()
529532
530533 if enforce_sizes is None :
531534 enforce_sizes = []
You can’t perform that action at this time.
0 commit comments