Skip to content

Commit

Permalink
Generate CSV report in NCCL test
Browse files Browse the repository at this point in the history
  • Loading branch information
TaekyungHeo committed May 24, 2024
1 parent f1117a4 commit b7b1b8a
Showing 1 changed file with 18 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
import pandas as pd

from cloudai.report_generator.tool.bokeh_report_tool import BokehReportTool
from cloudai.report_generator.tool.csv_report_tool import CSVReportTool
from cloudai.report_generator.util import add_human_readable_sizes
from cloudai.schema.core.strategy import ReportGenerationStrategy, StrategyRegistry
from cloudai.schema.system import SlurmSystem
Expand Down Expand Up @@ -76,7 +77,8 @@ def generate_report(self, test_name: str, directory_path: str, sol: Optional[flo
df["Algbw (GB/s) In-place"] = df["Algbw (GB/s) In-place"].astype(float)
df["Busbw (GB/s) In-place"] = df["Busbw (GB/s) In-place"].astype(float)
df = add_human_readable_sizes(df, "Size (B)", "Size Human-readable")
self._generate_plots(test_name, df, directory_path, sol)
self._generate_bokeh_report(test_name, df, directory_path, sol)
self._generate_csv_report(df, directory_path)

def _parse_output(self, directory_path: str) -> Tuple[List[List[str]], Optional[float]]:
"""
Expand All @@ -99,7 +101,9 @@ def _parse_output(self, directory_path: str) -> Tuple[List[List[str]], Optional[
return data, avg_bus_bw
return [], None

def _generate_plots(self, test_name: str, df: pd.DataFrame, directory_path: str, sol: Optional[float]) -> None:
def _generate_bokeh_report(
self, test_name: str, df: pd.DataFrame, directory_path: str, sol: Optional[float]
) -> None:
"""
Create and saves plots to visualize NCCL test metrics.
Expand Down Expand Up @@ -138,3 +142,15 @@ def _generate_plots(self, test_name: str, df: pd.DataFrame, directory_path: str,
)

report_tool.finalize_report("cloudai_nccl_test_bokeh_report.html")

def _generate_csv_report(self, df: pd.DataFrame, directory_path: str) -> None:
"""
Generate a CSV report from the DataFrame.
Args:
df (pd.DataFrame): DataFrame containing the NCCL test data.
directory_path (str): Output directory path for saving the CSV report.
"""
csv_report_tool = CSVReportTool(directory_path)
csv_report_tool.set_dataframe(df)
csv_report_tool.finalize_report("cloudai_nccl_test_csv_report.csv")

0 comments on commit b7b1b8a

Please sign in to comment.