TorchedUp
LearnBetaProblemsSystem DesignSoonPremium
TorchedUp
LearnBetaProblemsSystem DesignSoonPremium
←

137. Model FLOPs Utilization (MFU)

Medium

Compute MFU — the fraction of peak hardware FLOPs your training run is actually using.

Signature: def mfu(achieved_tokens_per_sec: float, n_params: int, peak_flops: float) -> float

Using the 6N rule for FLOPs per token:

MFU = (6 * n_params * tokens_per_sec) / peak_flops

Return a float in [0, 1].

Math

MFU=Fpeak​6N⋅TPS​

Asked at

NumPy

import numpy as np

 

def mfu(...):

    pass

🔒

Premium problem

Free accounts include problems #1–20. Upgrade to unlock the editor, hidden test cases, and reference solutions for every problem.

Upgrade to PremiumBack to problems

Already premium?