File tree Expand file tree Collapse file tree 1 file changed +6
-6
lines changed Expand file tree Collapse file tree 1 file changed +6
-6
lines changed Original file line number Diff line number Diff line change @@ -124,12 +124,6 @@ def train(config: Config):
124
124
model = torch .compile (model )
125
125
logger .debug ("model compiled and fsdped" )
126
126
127
- if config .diloco is not None :
128
- if world_info .local_world_size == 1 :
129
- raise ValueError ("Diloco is not supported for local_world_size == 1 because of a pytorch bug" )
130
-
131
- diloco = Diloco (config .diloco , model , sharding_strategy , elastic_device_mesh .global_pg )
132
-
133
127
# Setup optimizers
134
128
inner_optimizer = torch .optim .AdamW (
135
129
model .parameters (),
@@ -138,6 +132,12 @@ def train(config: Config):
138
132
betas = (config .optim .adam_betas1 , config .optim .adam_betas2 ),
139
133
)
140
134
135
+ if config .diloco is not None :
136
+ if world_info .local_world_size == 1 :
137
+ raise ValueError ("Diloco is not supported for local_world_size == 1 because of a pytorch bug" )
138
+
139
+ diloco = Diloco (config .diloco , model , sharding_strategy , elastic_device_mesh .global_pg )
140
+
141
141
scheduler = get_cosine_schedule_with_warmup (
142
142
inner_optimizer ,
143
143
num_warmup_steps = config .optim .warmup_steps ,
You can’t perform that action at this time.
0 commit comments