Reduce default content in GUI #9
Signed-off-by: colramos-amd <colramos@amd.com>
[ROCm/rocprofiler-compute commit: d4bf9d1c16]
This commit is contained in:
@@ -175,9 +175,7 @@ def omniperf_cli(args):
|
|||||||
args.path[0][0]
|
args.path[0][0]
|
||||||
) # create mega df
|
) # create mega df
|
||||||
is_gui = False
|
is_gui = False
|
||||||
# parser.load_table_data(
|
parser.load_kernel_top(runs[args.path[0][0]], args.path[0][0])
|
||||||
# runs[args.path[0][0]], args.path[0][0], is_gui, args.g
|
|
||||||
# ) # create the loaded table
|
|
||||||
|
|
||||||
input_filters = {
|
input_filters = {
|
||||||
"kernel": runs[args.path[0][0]].filter_kernel_ids,
|
"kernel": runs[args.path[0][0]].filter_kernel_ids,
|
||||||
|
|||||||
@@ -308,9 +308,7 @@ def build_layout(
|
|||||||
Build gui layout
|
Build gui layout
|
||||||
"""
|
"""
|
||||||
comparable_columns = parser.build_comparable_columns(time_unit)
|
comparable_columns = parser.build_comparable_columns(time_unit)
|
||||||
|
|
||||||
base_run, base_data = next(iter(runs.items()))
|
base_run, base_data = next(iter(runs.items()))
|
||||||
|
|
||||||
app.layout = html.Div(style={"backgroundColor": "rgb(50, 50, 50)" if IS_DARK else ""})
|
app.layout = html.Div(style={"backgroundColor": "rgb(50, 50, 50)" if IS_DARK else ""})
|
||||||
|
|
||||||
filt_kernel_names = []
|
filt_kernel_names = []
|
||||||
@@ -343,6 +341,7 @@ def build_layout(
|
|||||||
)
|
)
|
||||||
def generate_from_filter(disp_filt, kernel_filter, gcd_filter, div_children):
|
def generate_from_filter(disp_filt, kernel_filter, gcd_filter, div_children):
|
||||||
runs[path_to_dir].dfs = copy.deepcopy(archConfigs.dfs) # reset the equations
|
runs[path_to_dir].dfs = copy.deepcopy(archConfigs.dfs) # reset the equations
|
||||||
|
panel_configs = copy.deepcopy(archConfigs.panel_configs)
|
||||||
# Generate original raw df
|
# Generate original raw df
|
||||||
runs[path_to_dir].raw_pmc = file_io.create_df_pmc(path_to_dir)
|
runs[path_to_dir].raw_pmc = file_io.create_df_pmc(path_to_dir)
|
||||||
if verbose >= 1:
|
if verbose >= 1:
|
||||||
@@ -361,11 +360,27 @@ def build_layout(
|
|||||||
time_unit,
|
time_unit,
|
||||||
num_results,
|
num_results,
|
||||||
)
|
)
|
||||||
# Evaluate metrics and table data from the raw df
|
|
||||||
is_gui = True
|
is_gui = True
|
||||||
|
# Only display basic metrics if no filters are applied
|
||||||
|
if not (disp_filt or kernel_filter or gcd_filter):
|
||||||
|
temp = {}
|
||||||
|
keep = [1, 201, 101, 1901]
|
||||||
|
for key in runs[path_to_dir].dfs:
|
||||||
|
if keep.count(key) != 0:
|
||||||
|
temp[key] = runs[path_to_dir].dfs[key]
|
||||||
|
|
||||||
|
runs[path_to_dir].dfs = temp
|
||||||
|
temp = {}
|
||||||
|
keep = [0, 100, 200, 1900]
|
||||||
|
for key in panel_configs:
|
||||||
|
if keep.count(key) != 0:
|
||||||
|
temp[key] = panel_configs[key]
|
||||||
|
panel_configs = temp
|
||||||
|
|
||||||
parser.load_table_data(
|
parser.load_table_data(
|
||||||
runs[path_to_dir], path_to_dir, True, debug
|
runs[path_to_dir], path_to_dir, True, debug
|
||||||
) # Note: All the filtering happens in this function
|
) # Note: All the filtering happens in this function
|
||||||
|
|
||||||
div_children = []
|
div_children = []
|
||||||
div_children.append(
|
div_children.append(
|
||||||
get_memchart(archConfigs.panel_configs[1900]["data source"], base_data)
|
get_memchart(archConfigs.panel_configs[1900]["data source"], base_data)
|
||||||
@@ -379,7 +394,7 @@ def build_layout(
|
|||||||
)
|
)
|
||||||
)
|
)
|
||||||
# Iterate over each section as defined in panel configs
|
# Iterate over each section as defined in panel configs
|
||||||
for panel_id, panel in archConfigs.panel_configs.items():
|
for panel_id, panel in panel_configs.items():
|
||||||
title = str(panel_id // 100) + ". " + panel["title"]
|
title = str(panel_id // 100) + ". " + panel["title"]
|
||||||
section_title = (
|
section_title = (
|
||||||
panel["title"]
|
panel["title"]
|
||||||
|
|||||||
@@ -650,7 +650,6 @@ def apply_filters(workload, is_gui, debug):
|
|||||||
# NB: support ignoring the 1st n dispatched execution by '> n'
|
# NB: support ignoring the 1st n dispatched execution by '> n'
|
||||||
# The better way may be parsing python slice string
|
# The better way may be parsing python slice string
|
||||||
for d in workload.filter_dispatch_ids:
|
for d in workload.filter_dispatch_ids:
|
||||||
print("len of ret_df is ", len(ret_df))
|
|
||||||
if int(d) > len(ret_df) - 2: # subtract 2 bc of the two header rows
|
if int(d) > len(ret_df) - 2: # subtract 2 bc of the two header rows
|
||||||
print("{} is an invalid dispatch id.".format(d))
|
print("{} is an invalid dispatch id.".format(d))
|
||||||
sys.exit(1)
|
sys.exit(1)
|
||||||
@@ -674,12 +673,7 @@ def apply_filters(workload, is_gui, debug):
|
|||||||
return ret_df
|
return ret_df
|
||||||
|
|
||||||
|
|
||||||
def load_table_data(workload, dir, is_gui, debug):
|
def load_kernel_top(workload, dir):
|
||||||
"""
|
|
||||||
Load data for all "raw_csv_table".
|
|
||||||
Calculate mertric value for all "metric_table".
|
|
||||||
"""
|
|
||||||
|
|
||||||
# NB:
|
# NB:
|
||||||
# - Do pmc_kernel_top.csv loading before eval_metric because we need the kernel names.
|
# - Do pmc_kernel_top.csv loading before eval_metric because we need the kernel names.
|
||||||
# - There might be a better way/timing to load raw_csv_table.
|
# - There might be a better way/timing to load raw_csv_table.
|
||||||
@@ -698,9 +692,16 @@ def load_table_data(workload, dir, is_gui, debug):
|
|||||||
# All transposed columns should be marked with a general header,
|
# All transposed columns should be marked with a general header,
|
||||||
# so tty could detect them and show them correctly in comparison.
|
# so tty could detect them and show them correctly in comparison.
|
||||||
tmp[id].columns = ["Info"]
|
tmp[id].columns = ["Info"]
|
||||||
|
|
||||||
workload.dfs.update(tmp)
|
workload.dfs.update(tmp)
|
||||||
|
|
||||||
|
|
||||||
|
def load_table_data(workload, dir, is_gui, debug):
|
||||||
|
"""
|
||||||
|
Load data for all "raw_csv_table".
|
||||||
|
Calculate mertric value for all "metric_table".
|
||||||
|
"""
|
||||||
|
load_kernel_top(workload, dir)
|
||||||
|
|
||||||
eval_metric(
|
eval_metric(
|
||||||
workload.dfs,
|
workload.dfs,
|
||||||
workload.dfs_type,
|
workload.dfs_type,
|
||||||
|
|||||||
Reference in New Issue
Block a user