Add a 'mem_throughput[GB/s]' column: model_bytes / kernel_time.
(df: pd.DataFrame, vocab_size: int, hidden_size: int)
| 249 | |
| 250 | |
| 251 | def assign_col_mem_throughput(df: pd.DataFrame, vocab_size: int, hidden_size: int) -> pd.DataFrame: |
| 252 | """Add a 'mem_throughput[GB/s]' column: model_bytes / kernel_time.""" |
| 253 | nbytes = df["n_hidden_states"].apply(lambda h: model_bytes(vocab_size, hidden_size, h)) |
| 254 | throughput = nbytes / (df["time[ms]"] / 1000) / 1e9 |
| 255 | return df.assign(**{"mem_throughput[GB/s]": throughput}) |
| 256 | |
| 257 | |
| 258 | def plot_memory_throughput(bdf_long: pd.DataFrame, peak_bw_gbs: float | None = None): |
nothing calls this directly
no test coverage detected