Files
TheRock/rocm-systems/projects/rocprofiler/tests-v2/featuretests/profiler/test_histogram.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

74 lines
2.3 KiB
Python

import numpy as np
import pandas
import os
import glob
current_dir = os.getcwd()
rocprof = "rocprofv2"
expected_filename = "pmc_1/results_histo.csv"
output_folder = "/tmp/tests-v2/pmc"
def test_grbm(csvfile):
count = np.array(csvfile["GRBM_COUNT"])
active = np.array(csvfile["GRBM_GUI_ACTIVE"])
assert np.all(active > 0) # GPU must always be active
assert np.all(count >= active) # Count always increments more than active
assert np.all(
count * 0.5 < active
) # We can reasonably expect an active GPU during the kernel execution
def test_insts(csvfile):
waves = np.array(
csvfile["SQ_WAVES"]
) # TODO: 256 for wave32, need to check for wave64
lds = np.array(csvfile["SQ_INSTS_LDS"])
valu = np.array(csvfile["SQ_INSTS_VALU"])
salu = np.array(csvfile["SQ_INSTS_SALU"])
smem = np.array(csvfile["SQ_INSTS_SMEM"])
assert np.all(waves == 256) or np.all(waves == 128)
# Each have executes at least one of these
assert np.all(lds > waves)
assert np.all(valu > waves)
assert np.all(salu > waves)
assert np.all(smem >= waves)
def test_sqcycles(csvfile):
tabusy = np.array(csvfile["TA_BUSY_max"])
grbm = np.array(csvfile["GRBM_GUI_ACTIVE"])
waves = np.array(csvfile["SQ_WAVES"])
wait_any = np.array(csvfile["SQ_WAIT_ANY"])
wave_cycles = np.array(csvfile["SQ_WAVE_CYCLES"])
vmem_cycles = np.array(csvfile["SQ_INST_CYCLES_VMEM"])
lds = np.array(csvfile["SQ_INSTS_LDS"])
valu = np.array(csvfile["SQ_INSTS_VALU"])
salu = np.array(csvfile["SQ_INSTS_SALU"])
smem = np.array(csvfile["SQ_INSTS_SMEM"])
ALU = lds + valu + salu + smem
assert np.all(
wave_cycles >= ALU + wait_any
) # Each ALU inst takes at least one cycle
assert np.all(wave_cycles / grbm <= waves) # Mean occupancy cannot exceed waves
assert np.all(wait_any >= tabusy) # Waves are waiting for ta
assert np.all(
vmem_cycles >= waves
) # Each wave takes at least one cycle to issue vmem
if __name__ == "__main__":
csv = pandas.read_csv(f"{output_folder}/{expected_filename}")
test_grbm(csv)
test_insts(csv)
# test_sqcycles(csv)
# if its reached this point, then all tests apssed
print("Test Passed: All counter correctness tests passed.")