fix the moe loss as none for panel_metrics (#379)

pull/391/head
Ryan (张磊) 2023-09-27 20:29:50 +08:00 committed by GitHub
parent e34e7307c9
commit c8242572f2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 1 deletions

View File

@ -485,7 +485,8 @@ def record_current_batch_training_metrics(
"perplexity": acc_perplex["perplexity"],
"fwd_bwd_time": fwd_bwd_time,
}
panel_metrics["moe_loss"] = moe_loss.item()
if moe_loss is not None:
panel_metrics["moe_loss"] = moe_loss.item()
for norm_key, norm_value in grad_norm.items():
panel_metrics[norm_key] = norm_value