Upgrade python formatting module
Signed-off-by: coleramos425 <colramos@amd.com>
[ROCm/rocprofiler-compute commit: 48df0d6db4]
This commit is contained in:
@@ -141,6 +141,7 @@ for pref in preferences:
|
||||
|
||||
from recommonmark.transform import AutoStructify
|
||||
|
||||
|
||||
# app setup hook
|
||||
def setup(app):
|
||||
app.add_config_value(
|
||||
|
||||
@@ -26,7 +26,6 @@ import re
|
||||
import sys
|
||||
|
||||
if __name__ == "__main__":
|
||||
|
||||
with open(sys.argv[1], "r") as file:
|
||||
s = file.read()
|
||||
|
||||
|
||||
@@ -26,7 +26,6 @@ import re
|
||||
import sys
|
||||
|
||||
if __name__ == "__main__":
|
||||
|
||||
with open(sys.argv[1], "r") as file:
|
||||
s = file.read()
|
||||
|
||||
|
||||
@@ -217,7 +217,6 @@ def collect_wave_occu_per_cu(in_dir, out_dir, numSE):
|
||||
for i in range(numSE):
|
||||
p = Path(in_dir, "wave_occu_se" + str(i) + ".csv")
|
||||
if p.exists():
|
||||
|
||||
tmp_df = pd.read_csv(p)
|
||||
SE_idx = "SE" + str(tmp_df.loc[0, "SE"])
|
||||
tmp_df.rename(
|
||||
|
||||
@@ -59,6 +59,7 @@ barchart_elements = {
|
||||
"l2_cache_per_chan": [1801, 1802],
|
||||
}
|
||||
|
||||
|
||||
##################
|
||||
# HELPER FUNCTIONS
|
||||
##################
|
||||
@@ -83,7 +84,6 @@ def multi_bar_chart(table_id, display_df):
|
||||
|
||||
|
||||
def discrete_background_color_bins(df, n_bins=5, columns="all"):
|
||||
|
||||
bounds = [i * (1.0 / n_bins) for i in range(n_bins + 1)]
|
||||
if columns == "all":
|
||||
if "id" in df:
|
||||
@@ -191,7 +191,7 @@ def build_bar_chart(display_df, table_config, norm_filt):
|
||||
elif table_config["id"] in barchart_elements["l2_cache_per_chan"]:
|
||||
nested_bar = {}
|
||||
channels = []
|
||||
for (colName, colData) in display_df.items():
|
||||
for colName, colData in display_df.items():
|
||||
if colName == "Channel":
|
||||
channels = list(colData.values)
|
||||
else:
|
||||
|
||||
@@ -27,6 +27,7 @@ from omniperf_analyze.utils import schema
|
||||
|
||||
avail_normalizations = ["per_wave", "per_cycle", "per_second", "per_kernel"]
|
||||
|
||||
|
||||
# List all the unique column values for desired column in df, 'target_col'
|
||||
def list_unique(orig_list, is_numeric):
|
||||
list_set = set(orig_list)
|
||||
|
||||
@@ -346,7 +346,6 @@ def build_dfs(archConfigs, filter_metrics):
|
||||
|
||||
i = 0
|
||||
for key, entries in data_cofig["metric"].items():
|
||||
|
||||
data_source_idx = (
|
||||
str(data_cofig["id"] // 100)
|
||||
+ "."
|
||||
@@ -365,7 +364,6 @@ def build_dfs(archConfigs, filter_metrics):
|
||||
# the whole IP block in filter
|
||||
(str(panel_id // 100) in filter_metrics)
|
||||
):
|
||||
|
||||
values.append(metric_idx)
|
||||
values.append(key)
|
||||
for k, v in entries.items():
|
||||
@@ -401,7 +399,6 @@ def build_dfs(archConfigs, filter_metrics):
|
||||
or (data_source_idx == "0") # no filter
|
||||
or (data_source_idx in filter_metrics)
|
||||
):
|
||||
|
||||
if (
|
||||
"columnwise" in data_cofig
|
||||
and data_cofig["columnwise"] == True
|
||||
|
||||
@@ -42,6 +42,7 @@ FONT_WEIGHT = "bold"
|
||||
|
||||
SUPPORTED_SOC = ["mi200"]
|
||||
|
||||
|
||||
################################################
|
||||
# Helper funcs
|
||||
################################################
|
||||
@@ -181,7 +182,6 @@ def plot_roof(roof_details, roof_data, mem_level, verbose):
|
||||
# -------------------------------------------------------------------------------------
|
||||
# Calculate relevent metrics for ai calculation
|
||||
def plot_application(sortType, ret_df, verbose):
|
||||
|
||||
df = ret_df["pmc_perf"]
|
||||
# Sort by top kernels or top dispatches?
|
||||
df = df.sort_values(by=["KernelName"])
|
||||
@@ -472,7 +472,6 @@ def plot_application(sortType, ret_df, verbose):
|
||||
|
||||
|
||||
def empirical_roof(roof_info, mem_level, verbose):
|
||||
|
||||
roofPath = roof_info["path"] + "/roofline.csv"
|
||||
# -----------------------------------------------------
|
||||
# Initialize roofline data dictionary from roofline.csv
|
||||
|
||||
@@ -33,7 +33,6 @@ from collections import OrderedDict
|
||||
|
||||
@dataclass
|
||||
class ArchConfig:
|
||||
|
||||
# [id: panel_config] pairs
|
||||
panel_configs: OrderedDict = field(default=dict)
|
||||
|
||||
|
||||
@@ -74,11 +74,9 @@ def show_all(runs, archConfigs, output, decimal, time_unit, selected_cols, verbo
|
||||
)
|
||||
or (type == "raw_csv_table")
|
||||
):
|
||||
|
||||
if header in hidden_columns:
|
||||
pass
|
||||
elif header not in comparable_columns:
|
||||
|
||||
if (
|
||||
type == "raw_csv_table"
|
||||
and table_config["source"] == "pmc_kernel_top.csv"
|
||||
|
||||
@@ -33,7 +33,6 @@ from common import getVersion, getVersionDisplay
|
||||
|
||||
|
||||
def parse(my_parser):
|
||||
|
||||
# versioning info
|
||||
vData = getVersion()
|
||||
versionString = getVersionDisplay(vData["version"], vData["sha"], vData["mode"])
|
||||
|
||||
@@ -37,7 +37,6 @@ MAX_SERVER_SEL_DELAY = 5000 # 5 sec connection timeout
|
||||
|
||||
|
||||
def kernel_name_shortener(df, cache, level):
|
||||
|
||||
if level >= 5:
|
||||
return df
|
||||
|
||||
@@ -50,7 +49,6 @@ def kernel_name_shortener(df, cache, level):
|
||||
if columnName == "KernelName" or columnName == "Name":
|
||||
# loop through all indices
|
||||
for index in df.index:
|
||||
|
||||
original_name = df.loc[index, columnName]
|
||||
if original_name in cache:
|
||||
continue
|
||||
|
||||
@@ -163,7 +163,6 @@ class mainWindow(QMainWindow):
|
||||
self.exportPMCCounters(fileName)
|
||||
|
||||
def exportPMCCounters(self, fileName):
|
||||
|
||||
f = open(fileName, "w")
|
||||
|
||||
total_IP_blocks = len(list(self.perfmon_config.keys()))
|
||||
@@ -188,7 +187,6 @@ class mainWindow(QMainWindow):
|
||||
return
|
||||
|
||||
def pmc_metric_selected(self, metric_name, col):
|
||||
|
||||
# check if the metric already exists
|
||||
metric_selected = False
|
||||
|
||||
@@ -314,7 +312,6 @@ class mainWindow(QMainWindow):
|
||||
self.table.setItem(row, col, QTableWidgetItem(metric_name))
|
||||
|
||||
def pmc_select(self, item):
|
||||
|
||||
metric_name = item.data()
|
||||
if (
|
||||
not metric_name in self.nodes_dict
|
||||
@@ -334,13 +331,11 @@ class mainWindow(QMainWindow):
|
||||
|
||||
# Function to save populate treeview with a dictionary
|
||||
def importData(self, xmlparsed, root=None):
|
||||
|
||||
self.model.setRowCount(0)
|
||||
if root is None:
|
||||
root = self.model.invisibleRootItem()
|
||||
|
||||
for x in xmlparsed.getiterator():
|
||||
|
||||
# Add SoC node to Root
|
||||
if x.tag in self.soc_arch_list:
|
||||
parent = root
|
||||
@@ -349,10 +344,8 @@ class mainWindow(QMainWindow):
|
||||
|
||||
# check all metrics in an SoC family
|
||||
if x.tag == "metric" and x.getparent().tag in self.soc_arch_list:
|
||||
|
||||
# New IP block (e.g., SQ), detected, create a new hierarchy for the block
|
||||
if not x.attrib["block"] in self.block_list:
|
||||
|
||||
self.block_list.append(x.attrib["block"])
|
||||
parent = self.nodes_dict[x.getparent().tag] # the SoC node
|
||||
parent.appendRow(
|
||||
@@ -386,7 +379,6 @@ class mainWindow(QMainWindow):
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
|
||||
app = QApplication(sys.argv)
|
||||
app.setStyle("Fusion")
|
||||
|
||||
|
||||
@@ -85,7 +85,6 @@ perfmon_config = {
|
||||
|
||||
|
||||
def perfmon_coalesce(pmc_files_list, workload_dir, soc):
|
||||
|
||||
workload_perfmon_dir = workload_dir + "/perfmon"
|
||||
|
||||
# match pattern for pmc counters
|
||||
@@ -110,7 +109,6 @@ def perfmon_coalesce(pmc_files_list, workload_dir, soc):
|
||||
|
||||
# Extract all PMC counters and store in separate buckets
|
||||
for fname in pmc_files_list:
|
||||
|
||||
lines = open(fname, "r").read().splitlines()
|
||||
|
||||
for line in lines:
|
||||
@@ -183,7 +181,6 @@ def perfmon_coalesce(pmc_files_list, workload_dir, soc):
|
||||
|
||||
|
||||
def perfmon_emit(pmc_list, workload_dir, soc):
|
||||
|
||||
workload_perfmon_dir = workload_dir + "/perfmon"
|
||||
|
||||
# Calculate the minimum number of iteration to save the pmc counters
|
||||
@@ -246,7 +243,6 @@ def perfmon_emit(pmc_list, workload_dir, soc):
|
||||
|
||||
|
||||
def perfmon_filter(workload_dir, perfmon_dir, args):
|
||||
|
||||
workload_perfmon_dir = workload_dir + "/perfmon"
|
||||
soc = args.target
|
||||
|
||||
@@ -288,7 +284,6 @@ def perfmon_filter(workload_dir, perfmon_dir, args):
|
||||
|
||||
|
||||
def pmc_filter(workload_dir, perfmon_dir, soc):
|
||||
|
||||
workload_perfmon_dir = workload_dir + "/perfmon"
|
||||
|
||||
if not os.path.isdir(workload_perfmon_dir):
|
||||
|
||||
@@ -26,6 +26,7 @@ import argparse
|
||||
import getpass
|
||||
from pymongo import MongoClient
|
||||
|
||||
|
||||
# Verify target directory and setup connection
|
||||
def remove_workload(args):
|
||||
# parser = argparse.ArgumentParser(description='Remove a workload from an Omniperf Instance')
|
||||
|
||||
@@ -84,7 +84,6 @@ class MachineSpecs:
|
||||
|
||||
|
||||
def gpuinfo():
|
||||
|
||||
rocminfo = run(["rocminfo"]).split("\n")
|
||||
|
||||
for idx1, linetext in enumerate(rocminfo):
|
||||
@@ -97,7 +96,6 @@ def gpuinfo():
|
||||
|
||||
L1, L2 = "", ""
|
||||
for idx2, linetext in enumerate(rocminfo[idx1 + 1 :]):
|
||||
|
||||
key = search(r"^\s*L1:\s+ ([a-zA-Z0-9]+)\s*", linetext)
|
||||
if key != None:
|
||||
L1 = key
|
||||
@@ -159,7 +157,6 @@ def search(pattern, string):
|
||||
|
||||
|
||||
def get_machine_specs(devicenum):
|
||||
|
||||
cpuinfo = path("/proc/cpuinfo").read_text()
|
||||
meminfo = path("/proc/meminfo").read_text()
|
||||
version = path("/proc/version").read_text()
|
||||
|
||||
Reference in New Issue
Block a user