Skip to content

Commit

Permalink
Merge pull request #157 from JoseSantosAMD/kernel_name_mappings
Browse files Browse the repository at this point in the history
Kernel name demangle
  • Loading branch information
coleramos425 authored Aug 15, 2023
2 parents c809346 + dc849b2 commit b79b4d3
Show file tree
Hide file tree
Showing 5 changed files with 148 additions and 134 deletions.
18 changes: 13 additions & 5 deletions src/omniperf
Original file line number Diff line number Diff line change
Expand Up @@ -260,7 +260,6 @@ def mongo_import(args, profileAndImport):
csv_converter.convert_folder(connectionInfo, Extractionlvl)
print("-- Complete! --")


################################################
# Roofline Helpers
################################################
Expand Down Expand Up @@ -442,11 +441,12 @@ def characterize_app(args, VER):
# Update timestamps
replace_timestamps(workload_dir, log)

# Manually join each pmc_perf*.csv output
if args.use_rocscope == False:
# Manually join each pmc_perf*.csv output
join_prof(workload_dir, args.join_type, log, args.verbose)

# Close log
# Demangle and overwrite original KernelNames
csv_converter.kernel_name_shortener(workload_dir, args.kernelVerbose)

log.close()


Expand Down Expand Up @@ -543,6 +543,10 @@ def omniperf_profile(args, VER):
print("IP Blocks: All")
else:
print("IP Blocks: ", args.ipblocks)
if args.kernelVerbose > 5:
print("KernelName verbose level: DISABLED")
else:
print("KernelName verbose level: ", str(args.kernelVerbose))

# Set up directories
workload_dir = args.path + "/" + args.name + "/" + args.target
Expand Down Expand Up @@ -659,13 +663,16 @@ def omniperf_profile(args, VER):
run_rocscope(args, fname)
else:
run_prof(fname, workload_dir, perfmon_dir, args.remaining, args.target, log, args.verbose)


# Update timestamps
replace_timestamps(workload_dir, log)

# Manually join each pmc_perf*.csv output
if args.use_rocscope == False:
# Manually join each pmc_perf*.csv output
join_prof(workload_dir, args.join_type, log, args.verbose)
# Demangle and overwrite original KernelNames
csv_converter.kernel_name_shortener(workload_dir, args.kernelVerbose)

# Generate sysinfo
gen_sysinfo(args.name, workload_dir, args.ipblocks, args.remaining, args.no_roof)
Expand Down Expand Up @@ -738,6 +745,7 @@ def main():
# PROFILE MODE
##############
if args.mode == "profile":
Extractionlvl = args.kernelVerbose
print("Resolving rocprof")
resolve_rocprof()
# Cannot access parent directories
Expand Down
9 changes: 9 additions & 0 deletions src/omniperf_analyze/assets/layout.css
Original file line number Diff line number Diff line change
Expand Up @@ -213,6 +213,15 @@ ul#nav li {
font-size: 14px;
text-align: left;
}

.dash-dropdown input{
color: black;
}

.dash-dropdown .Select-placeholder{
color: black;
}

.VirtualizedSelectOption {
overflow: hidden;
}
Expand Down
4 changes: 4 additions & 0 deletions src/omniperf_analyze/omniperf_analyze.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@
from pathlib import Path
from omniperf_analyze.utils import parser, file_io
from omniperf_analyze.utils.gui_components.roofline import get_roofline
from utils import csv_converter

archConfigs = {}

Expand Down Expand Up @@ -221,6 +222,9 @@ def run_cli(args, runs):
# which archConfig passed into show_all function.
# After decide to how to manage kernels display patterns, we can revisit it.
for d in args.path:
# Demangle and overwrite original KernelNames
csv_converter.kernel_name_shortener(d[0], args.kernelVerbose)

file_io.create_df_kernel_top_stats(
d[0],
runs[d[0]].filter_gpu_ids,
Expand Down
25 changes: 16 additions & 9 deletions src/parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -204,6 +204,14 @@ def parse(my_parser):
nargs=argparse.REMAINDER,
help="\t\t\tProvide command for profiling after double dash.",
)
profile_group.add_argument(
"--kernelVerbose",
required=False,
metavar="",
help="\t\t\tSpecify Kernel Name verbose level 1-5. Lower the level, shorter the kernel name. (DEFAULT: 2) (DISABLE: 5)",
default=2,
type=int,
)

## Roofline Command Line Options
roofline_group.add_argument(
Expand Down Expand Up @@ -342,15 +350,6 @@ def parse(my_parser):
dest="workload",
help="\t\t\t\tSpecify name of workload (to remove) or path to workload (to import)",
)
connection_group.add_argument(
"-k",
"--kernelVerbose",
required=False,
metavar="",
help="\t\t\t\tSpecify Kernel Name verbose level 1-5. Lower the level, shorter the kernel name. (DEFAULT: 2) (DISABLE: 5)",
default=2,
type=int,
)

## Analyze Command Line Options
## ----------------------------
Expand Down Expand Up @@ -514,3 +513,11 @@ def parse(my_parser):
action="store_true",
help="\t\tRandomly generate a port to launch GUI application.\n\t\tRegistered Ports range inclusive (1024-49151).",
)
analyze_group.add_argument(
"--kernelVerbose",
required=False,
metavar="",
help="\t\tSpecify Kernel Name verbose level 1-5. Lower the level, shorter the kernel name. (DEFAULT: 5) (DISABLE: 5)",
default=5,
type=int,
)
Loading

0 comments on commit b79b4d3

Please sign in to comment.