Comply to Python formatting

Signed-off-by: colramos-amd <colramos@amd.com>
Tá an tiomantas seo le fáil i:
colramos-amd
2023-06-09 10:04:32 -05:00
tuismitheoir 5f6c776170
tiomantas 79eecb445e
D'athraigh 4 comhad le 36 breiseanna agus 10 scriosta
+1 -1
Féach ar an gComhad
@@ -73,7 +73,7 @@ def generate_configs(config_dir, list_kernels, filter_metrics):
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
Féach ar an gComhad
@@ -320,26 +320,47 @@ def update_normUnit_string(equation, unit):
str(equation),
).capitalize()
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 = []
if not isinstance(formula,str):
if not isinstance(formula, str):
return counters
try:
tree = ast.parse(
formula
.replace("$normUnit", "SQ_WAVES")
formula.replace("$normUnit", "SQ_WAVES")
.replace("$denom", "SQ_WAVES")
.replace("$","")
.replace("$", "")
)
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"))
except:
pass
return counters
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)
roof_only_run = sys_info.ip_blocks == "roofline"
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.")
sys.exit(1)
+1
Féach ar an gComhad
@@ -55,6 +55,7 @@ class ArchConfig:
# [Metric name: Counters] pairs
metric_counters: Dict[str, list] = field(default_factory=dict)
@dataclass
class Workload:
sys_info: pd.DataFrame = None
+1 -1
Féach ar an gComhad
@@ -135,7 +135,7 @@ def join_prof(workload_dir, join_type, log_file, verbose, out=None):
# Check for vgpr counter in ROCm >= 5.3
else:
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():
print("Key is ", key)
_df = df[cols]