MCPcopy
hub / github.com/deepspeedai/DeepSpeedExamples / update_learning_rate

Function update_learning_rate

bing_bert/deepspeed_train.py:237–249  ·  view source on GitHub ↗
(config, current_global_step, optimizer)

Source from the content-addressed store, hash-verified

235
236
237def update_learning_rate(config, current_global_step, optimizer):
238 global last_global_step_from_restore
239
240 global_step_for_lr = current_global_step - last_global_step_from_restore
241 lr_this_step = config["training"]["learning_rate"] * warmup_linear_decay_exp(global_step_for_lr,
242 config["training"]["decay_rate"],
243 config["training"]["decay_step"],
244 config["training"]["total_training_steps"],
245 config["training"]["warmup_proportion"])
246 for param_group in optimizer.param_groups:
247 param_group['lr'] = lr_this_step
248
249 return lr_this_step
250
251def report_step_metrics(args, lr, loss, step, data_sample_count):
252 ##### Record the LR against global_step on tensorboard #####

Callers 1

trainFunction · 0.85

Calls 1

warmup_linear_decay_expFunction · 0.90

Tested by

no test coverage detected