Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[nsys-jax] Add ratio of hidden communication time to total communication time #1241

Open
wants to merge 6 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 5 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 24 additions & 0 deletions .github/container/nsys_jax/nsys_jax/analyses/communication.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
load_profiler_data,
)
from math import sqrt
from prettytable import PrettyTable
import pathlib
from uncertainties import ufloat # type: ignore

Expand Down Expand Up @@ -95,6 +96,29 @@ def format_bandwidth(data, collective):
)
)

collective_types = set()
summary_data = defaultdict(dict)
for collective, df in steady_state.communication.groupby(["Collective"]):
collective_types.add(collective)
summary_data[collective] = df["DurHiddenMsToDurMs"].mean()

table = PrettyTable()
table.field_names = ["Collective", "Mean HiddenToTotalMs"]

for collective in collective_types:
mean_value = summary_data[collective]
table.add_row([collective[0], mean_value])
print(table)
sfvaroglu marked this conversation as resolved.
Show resolved Hide resolved

overall_hidden_ms_to_total_ms = (
steady_state.communication["ProjDurHiddenMs"].sum()
/ (
steady_state.communication["ProjDurMs"]
+ steady_state.communication["ProjDurHiddenMs"]
).sum()
)
print(f"Overall HiddenMs to TotalMs: {overall_hidden_ms_to_total_ms}")


if __name__ == "__main__":
main()
3 changes: 3 additions & 0 deletions .github/container/nsys_jax/nsys_jax/analysis.py
Original file line number Diff line number Diff line change
Expand Up @@ -331,6 +331,9 @@ def calculate_collective_metrics(
comm_df["BusBandwidthGBPerSec"] = (
comm_df["AlgorithmBandwidthGBPerSec"] * comm_df["BusBandwidthCorrection"]
)
comm_df["DurHiddenMsToDurMs"] = comm_df["ProjDurHiddenMs"] / (
comm_df["ProjDurMs"] + comm_df["ProjDurHiddenMs"]
)
sfvaroglu marked this conversation as resolved.
Show resolved Hide resolved
return comm_df.drop(columns=["BandwidthCorrection", "BusBandwidthCorrection"])


Expand Down
1 change: 1 addition & 0 deletions .github/container/nsys_jax/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ dependencies = [
"pyarrow",
"requests", # for install-protoc
"uncertainties", # communication analysis recipe
"prettytable",
]
requires-python = ">= 3.10"

Expand Down
Loading