MCPcopy Create free account
hub / github.com/FlashSampling/FlashSampling / _load_sweep

Function _load_sweep

benchmarking/parse_ncu_sweep.py:55–72  ·  view source on GitHub ↗

Load all NCU CSV files into a single DataFrame. Columns: bsz, method, kernel_name, duration_us. TP>1 durations are averaged across ranks.

(base: Path, bsz_dirs: list[Path])

Source from the content-addressed store, hash-verified

53
54
55def _load_sweep(base: Path, bsz_dirs: list[Path]) -> pd.DataFrame:
56 """Load all NCU CSV files into a single DataFrame.
57
58 Columns: bsz, method, kernel_name, duration_us.
59 TP>1 durations are averaged across ranks.
60 """
61 frames = []
62 for d in bsz_dirs:
63 bsz = int(d.name[3:])
64 for fname, label in METHODS:
65 path = d / fname
66 if not path.exists():
67 continue
68 method_df = parse_ncu_csv(path).assign(bsz=bsz, method=label)
69 frames.append(method_df)
70 if not frames:
71 return pd.DataFrame()
72 return pd.concat(frames, ignore_index=True)
73
74
75def parse_ncu_csv(path: Path) -> pd.DataFrame:

Callers 1

mainFunction · 0.85

Calls 1

parse_ncu_csvFunction · 0.85

Tested by

no test coverage detected