Skip to content

MFU Calculation has potential precision issues #364

Closed

Description

@le1nux

The test_compute_mfu test had a hardcoded expected_mfu of 0.4275 given a world_size of 8 ranks and 532 samples/s throughput. Varying the world size therefore lead to failing the test, as we were not compensating for different world sizes.

For instance, if the same throughput would have been achieved on a single GPU, we would exceed the GPUs peak performance resulting in a MFU of 0.4275*8=3.42. Note, wile this would be infeasible in practice, the calculation would be still correct.

I adapted the code by replacing the expected_mfu with expected_single_gpu_mfu, to support arbitrary world sizes: d309a83

While the changes seem to be correct up to a small percentage, I had to increase the tolerance a bit. We should check where the discrepancy is originating from.

Activity

  1. added theissue type on May 1, 2025
  2. flxst commented on May 5, 2025

    @flxst
    Contributor

    The reason why the tolerance had to be increased is simply due to the fact that MFU is computed for 2 GPUs instead of 8, which leads to an overall factor 4.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions