Skip to content

Commit

Permalink
change stubbed values to hbm bw
Browse files Browse the repository at this point in the history
Signed-off-by: Jose Santos <josantos@amd.com>
  • Loading branch information
JoseSantosAMD committed Mar 5, 2024
1 parent 994aea9 commit ef19dd5
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 14 deletions.
15 changes: 9 additions & 6 deletions src/omniperf_analyze/analysis_webui.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
##############################################################################el

from omniperf_analyze.analysis_base import OmniAnalyze_Base
from utils.utils import demarcate, error
from utils.utils import demarcate
from utils import file_io, parser
from utils.gui import build_bar_chart, build_table_chart

Expand Down Expand Up @@ -103,6 +103,8 @@ def generate_from_filter(
logging.debug("[analysis] gui normalization is %s" % norm_filt)

base_data = self.initalize_runs() # Re-initalizes everything
hbm_bw =base_data[base_run].sys_info["hbm_bw"][0]

panel_configs = copy.deepcopy(arch_configs.panel_configs)
# Generate original raw df
base_data[base_run].raw_pmc = file_io.create_df_pmc(
Expand Down Expand Up @@ -163,7 +165,7 @@ def generate_from_filter(
# update roofline for visualization in GUI
self.get_socs()[self.arch].analysis_setup(
roofline_parameters={
"workload_dir": self.dest_dir,
"path_to_dir": self.dest_dir,
"device_id": 0,
"sort_type": "kernels",
"mem_level": "ALL",
Expand Down Expand Up @@ -213,6 +215,7 @@ def generate_from_filter(
norm_filt=norm_filt,
comparable_columns=comparable_columns,
decimal=self.get_args().decimal,
hbm_bw=base_data[base_run].sys_info["hbm_bw"][0],
)

# Update content for this section
Expand Down Expand Up @@ -284,7 +287,7 @@ def pre_processing(self):
# create the loaded kernel stats
parser.load_kernel_top(self._runs[self.dest_dir], self.dest_dir)
# set architecture
self.arch = self._runs[self.dest_dir].sys_info.iloc[0]["gpu_arch"]
self.arch = self._runs[self.dest_dir].sys_info.iloc[0]["gpu_soc"]

else:
self.error(
Expand All @@ -308,7 +311,6 @@ def run_analysis(self):
input_filters,
self._arch_configs[self.arch],
)
# Here I expect that self._runs[<path>].raw_pmc will no longer be populated
if args.random_port:
self.app.run_server(
debug=False, host="0.0.0.0", port=random.randint(1024, 49151)
Expand All @@ -326,6 +328,7 @@ def determine_chart_type(
norm_filt,
comparable_columns,
decimal,
hbm_bw
):
content = []

Expand All @@ -339,7 +342,7 @@ def determine_chart_type(
# Determine chart type:
# a) Barchart
if table_config["id"] in [x for i in barchart_elements.values() for x in i]:
d_figs = build_bar_chart(display_df, table_config, barchart_elements, norm_filt)
d_figs = build_bar_chart(display_df, table_config, barchart_elements, norm_filt, hbm_bw)
# Smaller formatting if barchart yeilds several graphs
if (
len(d_figs)
Expand Down Expand Up @@ -391,4 +394,4 @@ def determine_chart_type(
style={"color": "white"},
),
)
return content
return content
13 changes: 5 additions & 8 deletions src/utils/gui.py
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ def discrete_background_color_bins(df, n_bins=5, columns="all"):
####################
# GRAPHICAL ELEMENTS
####################
def build_bar_chart(display_df, table_config, barchart_elements, norm_filt):
def build_bar_chart(display_df, table_config, barchart_elements, norm_filt, hbm_bw ):
"""
Read data into a bar chart. ID will determine which subtype of barchart.
"""
Expand Down Expand Up @@ -220,20 +220,17 @@ def build_bar_chart(display_df, table_config, barchart_elements, norm_filt):
x="Avg",
y="Metric",
color="Avg",
range_color=[0, 1638],
range_color=[0, hbm_bw],
labels={"Avg": "GB/s"},
height=220,
orientation="h",
).update_xaxes(range=[0, 1638])
).update_xaxes(range=[0, hbm_bw])
) # append second GB/s chart
else:
key = "Avg"
if table_config["id"] in [1101]:
key = "Pct of Peak"
d_figs.append(
px.bar(
display_df,
x=key,
x="Avg",
y="Metric",
color="Avg",
range_color=[0, 100],
Expand Down Expand Up @@ -388,4 +385,4 @@ def build_table_chart(
# print("DATA: \n", display_df.to_dict('records'))
d_figs.append(d_t)
return d_figs
# print(d_t.columns)
# print(d_t.columns)

0 comments on commit ef19dd5

Please sign in to comment.