Files
TheRock/rocm-systems/projects/rocprofiler-compute/tests/test_analysis_base.py
T
derek.holloway 7502bf64a4
CodeQL / Analyze (actions) (push) Canceled after 0s
CodeQL / Analyze (python) (push) Canceled after 0s
pre-commit / pre-commit (push) Canceled after 0s
Multi-Arch CI / setup (push) Canceled after 0s
Publish build_manylinux_x86_64 images / publish_build_manylinux_x86_64 (push) Canceled after 0s
Setup (Multi-Arch) / setup (push) Canceled after 0s
Multi-Arch CI / Linux::${{ fromJSON(needs.setup.outputs.linux_build_config || '{}').build_variant_label || 'skip' }} (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Publish no_rocm_image_ubi10 image / publish_no_rocm_image_ubi10 (push) Canceled after 0s
Multi-Arch CI / Windows::${{ fromJSON(needs.setup.outputs.windows_build_config || '{}').build_variant_label || 'skip' }} (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Multi-Arch CI / Manifest Diff (push) Canceled after 0s
TheRock Manifest Diff Report / Generate Manifest Diff Report (push) Canceled after 0s
Multi-Arch CI / CI Summary (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04 (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04_ocl_rt images / publish_no_rocm_image_ubuntu24_04_ocl_rt (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_rocgdb (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04_rocgdb images / publish_no_rocm_image_ubuntu24_04_rocgdb (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_ocl_rt (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Unit Tests / Unit Tests :: ubuntu-24.04 (push) Canceled after 0s
Unit Tests / Unit Tests :: windows-2022 (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_media (push) Canceled after 0s
Unit Tests / Unit Tests Summary (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_openmpi (push) Canceled after 0s
Flatten subprojects into a single base monorepo
2026-09-02 16:34:47 -07:00

49 lines
1.6 KiB
Python

# Copyright (c) Advanced Micro Devices, Inc.
# SPDX-License-Identifier: MIT
"""Unit tests for src/rocprof_compute_analyze/analysis_base.py."""
import common
import pandas as pd
from rocprof_compute_analyze.analysis_base import OmniAnalyze_Base
MODULE = "rocprof_compute_analyze.analysis_base"
def test_join_prof_renames_sq_accum_prev_hires_to_bucket_target(
tmp_path, monkeypatch
) -> None:
"""join_prof renames the generic SQ_ACCUM_PREV_HIRES column to the bucket target."""
common.patch_console(monkeypatch, MODULE, "debug", "warning")
(tmp_path / "profiling_config.yaml").write_text(
"format_rocprof_output: csv\njoin_type: kernel\n"
)
header = (
"GPU_ID,Kernel_Name,Dispatch_ID,Grid_Size,Workgroup_Size,"
"LDS_Per_Workgroup,Scratch_Per_Workitem,SGPR,vgpr,{counter}\n"
)
acc = tmp_path / "results_pmc_perf_SQ_LEVEL_WAVES_ACCUM.csv"
acc.write_text(
header.format(counter="SQ_ACCUM_PREV_HIRES")
+ "0,kernel_a,0,1024,64,32,0,8,4,100\n"
+ "0,kernel_a,1,1024,64,32,0,8,4,200\n"
)
other = tmp_path / "results_pmc_perf_0.csv"
other.write_text(
header.format(counter="SQ_WAVES")
+ "0,kernel_a,0,1024,64,32,0,8,4,10\n"
+ "0,kernel_a,1,1024,64,32,0,8,4,20\n"
)
inst = OmniAnalyze_Base.__new__(OmniAnalyze_Base)
inst.join_prof(tmp_path, out=str(tmp_path / "pmc_perf.csv"))
merged = pd.read_csv(tmp_path / "pmc_perf.csv")
assert "SQ_LEVEL_WAVES_ACCUM" in merged.columns
assert "SQ_ACCUM_PREV_HIRES" not in merged.columns
assert set(merged["SQ_LEVEL_WAVES_ACCUM"].tolist()) == {100, 200}
assert "SQ_WAVES" in merged.columns