# Clarification on training metrics

**URL:** </static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Fclarification-on-training-metrics%2F31468%3E%5C
**Category:** 🤗Accelerate\
**Created:** [February 10, 2023, 7:07pm UTC](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Fclarification-on-training-metrics%2F31468 "2023-02-10T19:07:12Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![alex-hh](https://avatars.discourse-cdn.com/v4/letter/a/c6cbf5/32.png) [@alex-hh](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Fu%2Falex-hh)%5C
**Post date:** [February 10, 2023, 7:07pm UTC](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Fclarification-on-training-metrics%2F31468%2F1 "2023-02-10T19:07:12Z")

</div>

In the example scripts (e.g. [accelerate/complete\_cv\_example.py at main · huggingface/accelerate · GitHub](https://github.com/huggingface/accelerate/blob/main/examples/complete_cv_example.py)), a variable total\_loss is used to compute the average loss on training datapoints, which is then logged using accelerator.log

Is the resulting metric process-specific, or is the loss somehow aggregated across processes.

In the former case (in which the metric is the average loss for a single process), is there an alternative suggested way to compute the metric across all processes in training. I assume gather\_for\_metrics could be used, but will this induce any additional cost?

Thanks!
