@@ -149,9 +149,6 @@ def test_from_pretrained_registry_downloads_checkpoint_files_rank0(self):
149149 patch .object (transformers .AutoModelForCausalLM , "from_pretrained" ) as mock_hf_loader ,
150150 patch ("nemo_automodel._transformers.auto_model._get_resolved_checkpoint_files" ) as mock_get_files ,
151151 patch ("nemo_automodel._transformers.auto_model.os.path.isdir" , return_value = False ),
152- patch ("nemo_automodel._transformers.auto_model.dist.is_initialized" , return_value = True ),
153- patch ("nemo_automodel._transformers.auto_model.dist.get_world_size" , return_value = 1 ),
154- patch ("nemo_automodel._transformers.auto_model.dist.get_rank" , return_value = 0 ),
155152 patch ("nemo_automodel.components.distributed.utils.FirstRankPerNode" ) as mock_barrier ,
156153 ):
157154 # Prepare a fake config with architectures and commit hash
@@ -187,9 +184,6 @@ def test_from_pretrained_registry_downloads_when_dist_uninitialized(self):
187184 patch .object (transformers .AutoModelForCausalLM , "from_pretrained" ) as mock_hf_loader ,
188185 patch ("nemo_automodel._transformers.auto_model._get_resolved_checkpoint_files" ) as mock_get_files ,
189186 patch ("nemo_automodel._transformers.auto_model.os.path.isdir" , return_value = False ),
190- patch ("nemo_automodel._transformers.auto_model.dist.is_initialized" , return_value = False ),
191- patch ("nemo_automodel._transformers.auto_model.dist.get_world_size" , return_value = 1 ),
192- patch ("nemo_automodel._transformers.auto_model.dist.barrier" ) as mock_barrier ,
193187 ):
194188 # Prepare a fake config with architectures and commit hash
195189 cfg = Mock ()
@@ -213,8 +207,6 @@ def test_from_pretrained_registry_downloads_when_dist_uninitialized(self):
213207 _ , kwargs = mock_get_files .call_args
214208 assert kwargs ["pretrained_model_name_or_path" ] == "dummy/repo-id"
215209 assert kwargs ["commit_hash" ] == "commit456"
216- # No barrier when dist not initialized
217- mock_barrier .assert_not_called ()
218210
219211 def test_from_config_happy_path (self ):
220212 """Test the basic from_config functionality works."""
0 commit comments