From d6c0ebb557375cbea4fac8c5ef199f93c037067d Mon Sep 17 00:00:00 2001 From: Emery Berger Date: Fri, 23 Aug 2024 20:59:42 +0000 Subject: [PATCH] Fix GPU function reporting. --- scalene/scalene_json.py | 3 +-- scalene/scalene_statistics.py | 5 ----- 2 files changed, 1 insertion(+), 7 deletions(-) diff --git a/scalene/scalene_json.py b/scalene/scalene_json.py index 862203c1f..5cd371a65 100644 --- a/scalene/scalene_json.py +++ b/scalene/scalene_json.py @@ -196,8 +196,6 @@ def output_profile_line( n_cpu_percent_c = 0 n_cpu_percent_python = 0 - # n_gpu_percent = n_gpu_samples * 100 - if True: if stats.n_gpu_samples[fname][line_no]: n_gpu_percent = ( @@ -539,6 +537,7 @@ def output_profiles( all_samples |= set(fn_stats.cpu_samples_c.keys()) all_samples |= set(fn_stats.memory_malloc_samples.keys()) all_samples |= set(fn_stats.memory_free_samples.keys()) + all_samples |= set(fn_stats.gpu_samples.keys()) print_fn_summary = any(fn != fname for fn in all_samples) output["files"][fname_print]["functions"] = [] if print_fn_summary: diff --git a/scalene/scalene_statistics.py b/scalene/scalene_statistics.py index 06742b7b3..2d5e78e9d 100644 --- a/scalene/scalene_statistics.py +++ b/scalene/scalene_statistics.py @@ -329,11 +329,6 @@ def build_function_stats(self, filename: Filename) -> ScaleneStatistics: first_line_no ] += self.memory_aggregate_footprint[filename][line_no] - for fn_name in fn_stats.gpu_samples: - n_gpu_samples = fn_stats.n_gpu_samples[fn_name][first_line_no] - if n_gpu_samples != 0: - fn_stats.gpu_samples[fn_name][first_line_no] /= n_gpu_samples - return fn_stats payload_contents = [