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

Function assign_col_mem_throughput

benchmarking/plot-triton-bench.py:251–255  ·  view source on GitHub ↗

Add a 'mem_throughput[GB/s]' column: model_bytes / kernel_time.

(df: pd.DataFrame, vocab_size: int, hidden_size: int)

Source from the content-addressed store, hash-verified

249
250
251def 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
258def plot_memory_throughput(bdf_long: pd.DataFrame, peak_bw_gbs: float | None = None):

Callers

nothing calls this directly

Calls 1

model_bytesFunction · 0.85

Tested by

no test coverage detected