Skip to content

Commit

Permalink
Comply to Python formatting
Browse files Browse the repository at this point in the history
Signed-off-by: coleramos425 <colramos@amd.com>
  • Loading branch information
coleramos425 committed Jun 17, 2024
1 parent 2686c92 commit a13b9e6
Show file tree
Hide file tree
Showing 5 changed files with 813 additions and 372 deletions.
1 change: 0 additions & 1 deletion src/argparser.py
Original file line number Diff line number Diff line change
Expand Up @@ -461,7 +461,6 @@ def omniarg_parser(parser, omniperf_home, supported_archs, omniperf_version):
required=False,
metavar="",
help="\t\tSpecify path to Omnitrace (.proto) output to be used in bottleneck characterization.",

)
analyze_advanced_group.add_argument(
"--random-port",
Expand Down
7 changes: 6 additions & 1 deletion src/omniperf_analyze/analysis_webui.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,12 @@ def build_layout(self, input_filters, arch_configs):
children=[
dbc.Spinner(
children=[
get_header(base_data.raw_pmc, input_filters, self.get_args().path, filt_kernel_names),
get_header(
base_data.raw_pmc,
input_filters,
self.get_args().path,
filt_kernel_names,
),
html.Div(id="container", children=[]),
],
fullscreen=True,
Expand Down
49 changes: 30 additions & 19 deletions src/utils/gui_components/header.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,34 +44,41 @@ def list_unique(orig_list, is_numeric):
def create_span(input):
return {"label": html.Span(str(input), title=str(input)), "value": str(input)}


def get_bottleneck_section(input_filters, omniperf_dir):
if not input_filters["bottleneck_trace"]:
return html.H3(
children=["Include the '--bottleneck-trace' option to load a bottleneck classification for your workload."],
children=[
"Include the '--bottleneck-trace' option to load a bottleneck classification for your workload."
],
style={"color": "white"},
)
else:
# Instantiate the Bottleneck Classification object
bc = Bottleneck_Classification(
omniperf_dir=omniperf_dir,
omnitrace_dir=input_filters["bottleneck_trace"],
treshold_ratio=0.8
treshold_ratio=0.8,
)
# make sure that the gpu ids match between omnitrace and omniperf
if not (list(bc.omnitrace_data['gpu_ids']).sort() == list(bc.omniperf_data['gpu_bounds_time'].keys()).sort()):
console_error("Bottleneck Characterization", "GPU ids in omnitrace and omniperf do not match")
if not (
list(bc.omnitrace_data["gpu_ids"]).sort()
== list(bc.omniperf_data["gpu_bounds_time"].keys()).sort()
):
console_error(
"Bottleneck Characterization",
"GPU ids in omnitrace and omniperf do not match",
)
plt1, plt2 = bc.create_output_plots()
return html.Div(
className="float-container",
children=[
children=[
html.Div(
className="float-child",
children=[
html.H3(
"E2E Runtime Classification: CPU, GPU, Communication"
),
html.H3("E2E Runtime Classification: CPU, GPU, Communication"),
dcc.Graph(figure=plt1),
]
],
),
html.Div(
className="float-child",
Expand All @@ -80,23 +87,27 @@ def get_bottleneck_section(input_filters, omniperf_dir):
"GPU Kernel Runtime Breakdowns by Bottlenecks and Performance"
),
dcc.Graph(figure=plt2),
]
],
),
html.Div(
className="disclaimer",
children=[
html.P([
"Note: Bottleneck Classification is still an experimental feature and may exhibit some inaccuracies. Please see ",
html.A('https://github.com/ROCm/omniperf/discussions/378', href='https://github.com/ROCm/omniperf/discussions/378'),
" for known issues and workarounds."
])
]
)
]
html.P(
[
"Note: Bottleneck Classification is still an experimental feature and may exhibit some inaccuracies. Please see ",
html.A(
"https://github.com/ROCm/omniperf/discussions/378",
href="https://github.com/ROCm/omniperf/discussions/378",
),
" for known issues and workarounds.",
]
)
],
),
],
)



def get_header(raw_pmc, input_filters, omniperf_dir, kernel_names):
kernel_names = list(
map(
Expand Down
Loading

0 comments on commit a13b9e6

Please sign in to comment.