(sys_metrics)
return '%.2E' % Decimal(num_flops.item())
Prints the largest amount of flops required to complete training.

    To calculate this metric, we:
        1. For each round, pick the client that required the largest amount
            of local training.
        2. Sum the FLOPS from the clients picked in step 1 across rounds.

    TODO: This metric would make more sense with seconds instead of FLOPS.

    Args:
        sys_metrics: pd.DataFrame as written by writer.py.
Prints the largest amount of flops required to complete training.
Prints the largest amount of flops required to complete training .
def get_longest_flops_path(sys_metrics):
    """Prints the largest amount of flops required to complete training.

    To calculate this metric, we:
        1. For each round, pick the client that required the largest amount
            of local training.
        2. Sum the FLOPS from the clients picked in step 1 across rounds.

    TODO: This metric would make more sense with seconds instead of FLOPS.

    Args:
        sys_metrics: pd.DataFrame as written by writer.py."""
    num_rounds = sys_metrics[NUM_ROUND_KEY].max()
    clients = sys_metrics[CLIENT_ID_KEY].unique()

    comp_matrix = []

    for c in clients:
        client_rows = sys_metrics.loc[sys_metrics[CLIENT_ID_KEY] == c]
        client_rows = client_rows.groupby(NUM_ROUND_KEY, as_index=False).sum()
        client_computations = [0 for _ in range(num_rounds)]

        for i in range(num_rounds):
            computation_row = client_rows.loc[client_rows[NUM_ROUND_KEY] == i]
            if not computation_row.empty:
                client_computations[i] = computation_row.iloc[0][LOCAL_COMPUTATIONS_KEY]
        comp_matrix.append(client_computations)

    comp_matrix = np.asarray(comp_matrix)
    num_flops = np.sum(np.max(comp_matrix, axis=0))
    return '%.2E' % Decimal(num_flops.item())
def get_longest_flops_path ( sys_metrics ) : num_rounds = sys_metrics [ NUM_ROUND_KEY ] . max ( ) clients = sys_metrics [ CLIENT_ID_KEY ] . unique ( ) comp_matrix = [ ] for c in clients : client_rows = sys_metrics . loc [ sys_metrics [ CLIENT_ID_KEY ] == c ] client_rows = client_rows . groupby ( NUM_ROUND_KEY , as_index = False ) . sum ( ) client_computations = [ 0 for _ in range ( num_rounds ) ] for i in range ( num_rounds ) : computation_row = client_rows . loc [ client_rows [ NUM_ROUND_KEY ] == i ] if not computation_row . empty : client_computations [ i ] = computation_row . iloc [ 0 ] [ LOCAL_COMPUTATIONS_KEY ] comp_matrix . append ( client_computations ) comp_matrix = np . asarray ( comp_matrix ) num_flops = np . sum ( np . max ( comp_matrix , axis = 0 ) ) return '%.2E' % Decimal ( num_flops . item ( ) )