Skip to content

Commit

Permalink
bugfix for load_imbalance
Browse files Browse the repository at this point in the history
  • Loading branch information
adityaranjan committed Apr 9, 2024
1 parent bf974ff commit ebe0f35
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions pipit/trace.py
Original file line number Diff line number Diff line change
Expand Up @@ -585,10 +585,14 @@ def load_imbalance(self, metric="time.exc", num_processes=1):
for function in functions:
curr_series = flat_profile.loc[function]

top_n = curr_series.sort_values(ascending=False).iloc[0:num_display]
top_n = curr_series.sort_values(by=metric, ascending=False).iloc[
0:num_display
]

imbalance_dict[mean_metric].append(curr_series.mean())
imbalance_dict[imb_metric].append(top_n.values[0] / curr_series.mean())
imbalance_dict[mean_metric].append(curr_series.mean().values[0])
imbalance_dict[imb_metric].append(
(top_n.values[0] / curr_series.mean()).values[0]
)
imbalance_dict[imb_ranks].append(list(top_n.index))

imbalance_df = pd.DataFrame(imbalance_dict)
Expand Down

0 comments on commit ebe0f35

Please sign in to comment.