Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

change stubbed values to hbm bw #302

Merged
merged 6 commits into from
Mar 12, 2024
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 11 additions & 5 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 @@ -68,6 +68,7 @@ def build_layout(self, input_filters, arch_configs):
comparable_columns = parser.build_comparable_columns(self.get_args().time_unit)
base_run, base_data = next(iter(self._runs.items()))
self.app.layout = html.Div(style={"backgroundColor": "rgb(50, 50, 50)"})
# hbm_bw = base_data.sys_info["hbm_bw"]

filt_kernel_names = []
kernel_top_df = base_data.dfs[1]
Expand Down Expand Up @@ -103,6 +104,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]
print(hbm_bw)
coleramos425 marked this conversation as resolved.
Show resolved Hide resolved
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 +166,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,
JoseSantosAMD marked this conversation as resolved.
Show resolved Hide resolved
"device_id": 0,
"sort_type": "kernels",
"mem_level": "ALL",
Expand Down Expand Up @@ -213,6 +216,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 +288,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"]
JoseSantosAMD marked this conversation as resolved.
Show resolved Hide resolved

else:
self.error(
Expand All @@ -308,7 +312,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 +329,7 @@ def determine_chart_type(
norm_filt,
comparable_columns,
decimal,
hbm_bw,
):
content = []

Expand All @@ -339,7 +343,9 @@ 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
11 changes: 4 additions & 7 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
Loading