@@ -103,8 +103,8 @@ def __init__(
103103 tasks : str ,
104104 pipeline_parameters : PipelineParameters ,
105105 evaluation_tracker : EvaluationTracker ,
106- model = None ,
107106 model_config = None ,
107+ model = None ,
108108 ):
109109 if not (model or model_config ):
110110 raise ValueError ("Must provide either a model or model config when creating a pipeline." )
@@ -116,10 +116,9 @@ def __init__(
116116 "WARNING: --max_samples WAS SET. THESE NUMBERS ARE ONLY PARTIAL AND SHOULD NOT BE USED FOR COMPARISON UNLESS YOU KNOW WHAT YOU ARE DOING."
117117 )
118118
119- self .accelerator , self .parallel_context = self ._init_parallelism_manager ()
120-
121- self .evaluation_tracker = evaluation_tracker
122119 self .model_config = model_config
120+ self .evaluation_tracker = evaluation_tracker
121+ self .accelerator , self .parallel_context = self ._init_parallelism_manager ()
123122 self .model = self ._init_model (model_config , model )
124123
125124 self .evaluation_tracker .general_config_logger .log_model_info (self .model .model_info )
@@ -141,9 +140,9 @@ def _init_parallelism_manager(self):
141140 raise ValueError ("You are trying to launch a nanotron model, but nanotron is not installed" )
142141 dist .initialize_torch_distributed ()
143142 parallel_context = ParallelContext (
144- tensor_parallel_size = self .model_config .parallelism .tp ,
145- pipeline_parallel_size = self .model_config .parallelism .pp ,
146- data_parallel_size = self .model_config .parallelism .dp ,
143+ tensor_parallel_size = self .model_config .lighteval . parallelism .tp ,
144+ pipeline_parallel_size = self .model_config .lighteval . parallelism .pp ,
145+ data_parallel_size = self .model_config .lighteval . parallelism .dp ,
147146 )
148147 test_all_gather (parallel_context = parallel_context )
149148
@@ -156,7 +155,7 @@ def _init_model(self, model_config, model):
156155 return NanotronLightevalModel (
157156 checkpoint_path = os .path .dirname (self .pipeline_parameters .nanotron_checkpoint_path ),
158157 nanotron_config = self .model_config ,
159- parallel_context = self .accelerator ,
158+ parallel_context = self .parallel_context ,
160159 debug_one_layer_model = False ,
161160 model_class = None ,
162161 env_config = self .pipeline_parameters .env_config ,
0 commit comments