Time kernel execution using CUDA events.
(case: Case)
| 109 | |
| 110 | |
| 111 | def benchmark(case: Case) -> pd.DataFrame: |
| 112 | """Time kernel execution using CUDA events.""" |
| 113 | fn = _prepare_case(case) |
| 114 | is_distributed = case.tp.size > 1 |
| 115 | times_ms = bench_cuda_events( |
| 116 | fn, |
| 117 | warmup_iters=case.n_runs_warmup, |
| 118 | rep_iters=case.n_runs_benchmark, |
| 119 | is_distributed=is_distributed, |
| 120 | ) |
| 121 | results = { |
| 122 | "name": case.name, |
| 123 | "total[s]": sum(times_ms) / 1_000, |
| 124 | "time[s]": [t / 1_000 for t in times_ms], |
| 125 | "time[ms]": times_ms, |
| 126 | "time[µs]": [t * 1_000 for t in times_ms], |
| 127 | } |
| 128 | return pd.DataFrame(results) |
| 129 | |
| 130 | |
| 131 | def nsys_profile(case: Case) -> None: |
no test coverage detected