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])
| 53 | |
| 54 | |
| 55 | def _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 | |
| 75 | def parse_ncu_csv(path: Path) -> pd.DataFrame: |