# Total\_flos vs C = 6 \* N \* D

**URL:** </static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Ftotal-flos-vs-c-6-n-d%2F65593%3E%5C
**Category:** 🤗Transformers\
**Created:** [December 13, 2023, 12:02am UTC](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Ftotal-flos-vs-c-6-n-d%2F65593 "2023-12-13T00:02:37Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![ricdomolm](https://avatars.discourse-cdn.com/v4/letter/r/a9a28c/32.png) [@ricdomolm](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Fu%2Fricdomolm)%5C
**Post date:** [December 13, 2023, 12:02am UTC](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Ftotal-flos-vs-c-6-n-d%2F65593%2F1 "2023-12-13T00:02:37Z")

</div>

As far as I am aware, `total_flos`, returned by `trainer.train`, is supposed to indicate the total number of floating point operations performed to train some given model. However, this value can vary substantially compared to that of the commonly used formula C \approx 6 \* N \* D, where N is number of model parameters and D is model size.

For instance, as a quick experiment, training a freshly initialized 106M parameter Llama model on 52M tokens results in total\_flos=2.7e16, whereas using the formula we obtain C=3.3e16 FLOPS.

My question is whether the returned `total_flos` is indeed accurate (specially for Llama-type models).

Tagging @teven since I believe he wrote the relevant code.

---

<div class="post-metadata">

**Author:** ![ricdomolm](https://avatars.discourse-cdn.com/v4/letter/r/a9a28c/32.png) [@ricdomolm](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Fu%2Fricdomolm)%5C
**Post date:** [December 13, 2023, 12:31pm UTC](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Ftotal-flos-vs-c-6-n-d%2F65593%2F2 "2023-12-13T12:31:38Z")

</div>

Currently, trainer does not include the embedding parameters in the FLOP computation, which is the source of the discrepancy observed 🙂
