# Clarification on training metrics

**URL:** <https://discuss.huggingface.co/t/clarification-on-training-metrics/31468>\
**Category:** 🤗Accelerate\
**Created:** [February 10, 2023, 7:07pm UTC](https://discuss.huggingface.co/t/clarification-on-training-metrics/31468 "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](https://discuss.huggingface.co/u/alex-hh)\
**Post date:** [February 10, 2023, 7:07pm UTC](https://discuss.huggingface.co/t/clarification-on-training-metrics/31468/1 "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!
