Unit test fix - calculate aggregate sum based on instance size (#410)

* Unit test fix- calculate aggregate sum based on instance size

* Update GRBM instance size

* aggregate sum

---------

Co-authored-by: Sushma Vaddireddy <svaddire@amd.com>
This commit is contained in:
Vaddireddy, Sushma
2025-05-22 13:35:38 -07:00
committed by GitHub
parent 3cb0c87f53
commit 7045a4c689
2 changed files with 11 additions and 6 deletions
@@ -112,6 +112,8 @@ def test_validate_counter_collection_pmc1_json(json_data):
dispatch_ids.append(dispatch_data["dispatch_id"])
if not re.search(r"__amd_rocclr_.*", kernel_name):
# Collect all SQ_WAVES values
sq_waves_values = []
for record in counter["records"]:
counter = get_counter(record["counter_id"])
assert counter is not None, f"record:\n\t{record}"
@@ -119,9 +121,10 @@ def test_validate_counter_collection_pmc1_json(json_data):
counter["name"] == "SQ_WAVES"
), f"record:\n\t{record}\ncounter:\n\t{counter}"
if agent["name"] not in skip_gfx:
assert (
record["value"] > 0
), f"record: {record}\ncounter: {counter}\nagent: {agent}"
sq_waves_values.append(record["value"])
# Check aggregate sum
assert sum(sq_waves_values) > 0, f"SQ_WAVES value is not > 0"
di_uniq = list(set(sorted(dispatch_ids)))
# make sure the dispatch ids are unique and ordered
@@ -102,6 +102,7 @@ def validate_json(json_data, counter_name, check_dispatch):
dispatch_ids.append(dispatch_data["dispatch_id"])
if not re.search(r"__amd_rocclr_.*", kernel_name):
values = []
for record in counter["records"]:
counter = get_counter(record["counter_id"])
assert counter is not None, f"record:\n\t{record}"
@@ -109,9 +110,10 @@ def validate_json(json_data, counter_name, check_dispatch):
counter["name"] == counter_name
), f"record:\n\t{record}\ncounter:\n\t{counter}"
if agent["name"] not in skip_gfx:
assert (
record["value"] > 0
), f"record: {record}\ncounter: {counter}\nagent: {agent}"
values.append(record["value"])
# Check aggregate sum
assert sum(values) > 0, f"{counter_name} value is not > 0"
if check_dispatch:
di_uniq = list(set(sorted(dispatch_ids)))