Comply to Python formatting

Signed-off-by: colramos-amd <colramos@amd.com>
This commit is contained in:
colramos-amd committed 2023-06-09 10:04:32 -05:00
1 parent 5f6c776170
commit 79eecb445e
4 files changed
+36 -10

No files matched your search

+1 -1
View File
@@ -73,7 +73,7 @@ def generate_configs(config_dir, list_kernels, filter_metrics):
archConfigs[arch] = ac archConfigs[arch] = ac
return archConfigs # Note: This return comes in handy for rocScope which borrows generate_configs() in its rocomni plugin return archConfigs # Note: This return comes in handy for rocScope which borrows generate_configs() in its rocomni plugin
################################################ ################################################
+33 -8
View File
@@ -320,26 +320,47 @@ def update_normUnit_string(equation, unit):
str(equation), str(equation),
).capitalize() ).capitalize()
def gen_counter_list(formula): def gen_counter_list(formula):
function_filter = {"MIN": None, "MAX": None, "AVG": None, "ROUND": None, "TO_INT": None, "GB": None, "STD": None, "GFLOP": None, "GOP": None, "OP": None, "CU": None, "NC": None, "UC": None, "CC": None, "RW": None, "GIOP": None} function_filter = {
"MIN": None,
"MAX": None,
"AVG": None,
"ROUND": None,
"TO_INT": None,
"GB": None,
"STD": None,
"GFLOP": None,
"GOP": None,
"OP": None,
"CU": None,
"NC": None,
"UC": None,
"CC": None,
"RW": None,
"GIOP": None,
}
counters = [] counters = []
if not isinstance(formula,str): if not isinstance(formula, str):
return counters return counters
try: try:
tree = ast.parse( tree = ast.parse(
formula formula.replace("$normUnit", "SQ_WAVES")
.replace("$normUnit", "SQ_WAVES")
.replace("$denom", "SQ_WAVES") .replace("$denom", "SQ_WAVES")
.replace("$","") .replace("$", "")
) )
for node in ast.walk(tree): for node in ast.walk(tree):
if isinstance(node, ast.Name) and node.id.rstrip("_sum").isupper() and node.id not in function_filter: if (
isinstance(node, ast.Name)
and node.id.rstrip("_sum").isupper()
and node.id not in function_filter
):
counters.append(node.id.rstrip("_sum")) counters.append(node.id.rstrip("_sum"))
except: except:
pass pass
return counters return counters
def build_dfs(archConfigs, filter_metrics): def build_dfs(archConfigs, filter_metrics):
""" """
@@ -503,7 +524,11 @@ def eval_metric(dfs, dfs_type, sys_info, soc_spec, raw_pmc_df, debug):
# confirm no illogical counter values (only consider non-roofline runs) # confirm no illogical counter values (only consider non-roofline runs)
roof_only_run = sys_info.ip_blocks == "roofline" roof_only_run = sys_info.ip_blocks == "roofline"
rocscope_run = sys_info.ip_blocks == "rocscope" rocscope_run = sys_info.ip_blocks == "rocscope"
if not rocscope_run and not roof_only_run and (raw_pmc_df["pmc_perf"]["GRBM_GUI_ACTIVE"] == 0).any(): if (
not rocscope_run
and not roof_only_run
and (raw_pmc_df["pmc_perf"]["GRBM_GUI_ACTIVE"] == 0).any()
):
print("WARNING: Dectected GRBM_GUI_ACTIVE == 0\nHaulting execution.") print("WARNING: Dectected GRBM_GUI_ACTIVE == 0\nHaulting execution.")
sys.exit(1) sys.exit(1)
+1
View File
@@ -55,6 +55,7 @@ class ArchConfig:
# [Metric name: Counters] pairs # [Metric name: Counters] pairs
metric_counters: Dict[str, list] = field(default_factory=dict) metric_counters: Dict[str, list] = field(default_factory=dict)
@dataclass @dataclass
class Workload: class Workload:
sys_info: pd.DataFrame = None sys_info: pd.DataFrame = None
+1 -1
View File
@@ -135,7 +135,7 @@ def join_prof(workload_dir, join_type, log_file, verbose, out=None):
# Check for vgpr counter in ROCm >= 5.3 # Check for vgpr counter in ROCm >= 5.3
else: else:
duplicate_cols["arch_vgpr"] = [col for col in df.columns if "arch_vgpr" in col] duplicate_cols["arch_vgpr"] = [col for col in df.columns if "arch_vgpr" in col]
duplicate_cols["accum_vgpr"] = [col for col in df.columns if "accum_vgpr" in col] duplicate_cols["accum_vgpr"] = [col for col in df.columns if "accum_vgpr" in col]
for key, cols in duplicate_cols.items(): for key, cols in duplicate_cols.items():
print("Key is ", key) print("Key is ", key)
_df = df[cols] _df = df[cols]