From 6c8b834f5c7a9da025dfae2064c22797648169be Mon Sep 17 00:00:00 2001 From: vedithal-amd Date: Tue, 22 Jul 2025 17:49:16 -0400 Subject: [PATCH] Fix tests and formatting (#826) [ROCm/rocprofiler-compute commit: 068e5aaef4fcf6442c610156e9059988d4691c00] --- projects/rocprofiler-compute/src/utils/gui.py | 4 +--- .../tests/test_TCP_counters.py | 2 +- .../tests/test_analyze_commands.py | 15 --------------- .../rocprofiler-compute/tests/test_gpu_specs.py | 6 +++--- 4 files changed, 5 insertions(+), 22 deletions(-) diff --git a/projects/rocprofiler-compute/src/utils/gui.py b/projects/rocprofiler-compute/src/utils/gui.py index f2634b2b3b..6972ae89bb 100644 --- a/projects/rocprofiler-compute/src/utils/gui.py +++ b/projects/rocprofiler-compute/src/utils/gui.py @@ -197,9 +197,7 @@ def build_bar_chart(display_df, table_config, barchart_elements, norm_filt): # Speed-of-light bar chart elif table_config["id"] in barchart_elements["sol"]: - display_df["Avg"] = [ - float(x) if x != "" else float(0) for x in display_df["Avg"] - ] + display_df["Avg"] = [float(x) if x != "" else float(0) for x in display_df["Avg"]] if table_config["id"] == 1701: # special layout for L2 Cache SOL d_figs.append( diff --git a/projects/rocprofiler-compute/tests/test_TCP_counters.py b/projects/rocprofiler-compute/tests/test_TCP_counters.py index 73f1e5e7ff..5728257cfa 100644 --- a/projects/rocprofiler-compute/tests/test_TCP_counters.py +++ b/projects/rocprofiler-compute/tests/test_TCP_counters.py @@ -144,7 +144,7 @@ def test_L1_cache_counters( # set up two apps: sequential and random access app_names = ["vseq", "vrand"] - options = ["-b", "TCP"] + options = ["-b", "16"] result = {} metrics = ["Read Req", "Write Req", "Cache Hit Rate"] diff --git a/projects/rocprofiler-compute/tests/test_analyze_commands.py b/projects/rocprofiler-compute/tests/test_analyze_commands.py index 68b105ffc4..835d77eeed 100644 --- a/projects/rocprofiler-compute/tests/test_analyze_commands.py +++ b/projects/rocprofiler-compute/tests/test_analyze_commands.py @@ -79,21 +79,6 @@ def test_list_metrics_gfx90a(binary_handler_analyze_rocprof_compute): test_utils.clean_output_dir(config["cleanup"], workload_dir) -@pytest.mark.list_metrics -def test_list_metrics_gfx906(binary_handler_analyze_rocprof_compute): - code = binary_handler_analyze_rocprof_compute(["analyze", "--list-metrics", "gfx906"]) - assert code == 1 - - for dir in indirs: - workload_dir = test_utils.setup_workload_dir(dir) - code = binary_handler_analyze_rocprof_compute( - ["analyze", "--path", workload_dir, "--list-metrics", "gfx906"] - ) - assert code == 0 - - test_utils.clean_output_dir(config["cleanup"], workload_dir) - - @pytest.mark.list_metrics def test_list_metrics_gfx908(binary_handler_analyze_rocprof_compute): code = binary_handler_analyze_rocprof_compute(["analyze", "--list-metrics", "gfx908"]) diff --git a/projects/rocprofiler-compute/tests/test_gpu_specs.py b/projects/rocprofiler-compute/tests/test_gpu_specs.py index 87238294ab..a2df04b041 100644 --- a/projects/rocprofiler-compute/tests/test_gpu_specs.py +++ b/projects/rocprofiler-compute/tests/test_gpu_specs.py @@ -403,11 +403,11 @@ def test_normal_functionality_still_works(): """Ensure that normal paths still work after adding error handling tests""" from src.utils.mi_gpu_spec import MIGPUSpecs - result = MIGPUSpecs.get_gpu_model("gfx906", None) + result = MIGPUSpecs.get_gpu_model("gfx90a", None) assert result is not None - result = MIGPUSpecs.get_gpu_series("gfx906") + result = MIGPUSpecs.get_gpu_series("gfx90a") assert result is not None - result = MIGPUSpecs.get_num_xcds(gpu_arch="gfx906") + result = MIGPUSpecs.get_num_xcds(gpu_arch="gfx90a") assert result == 1