Rename Omniperf to ROCm Compute Profiler (#428)

- Update filenames.
- Update executable to `rocprof-compute` 
- Update update package to `rocprofiler-compute`
- Update name in application output and logs
- Update name in README files
- Update testing and workflows

---------

Signed-off-by: Xuan Chen <xuchen@amd.com>
This commit is contained in:
xuchen-amd authored and GitHub committed 2024-11-01 12:20:21 -04:00
1 parent 2de2faf944
commit 31b4de1a38
379 files changed
+1976 -1843

No files matched your search

+4 -4
View File
@@ -1,6 +1,6 @@
This directory contains all the source code files for the Omniperf project.
The top-level `omniperf` executable is the entry point and defines the flow for subsequent execution modes.
This directory contains all the source code files for the ROCm Compute Profiler project.
The top-level `rocprof-compute` executable is the entry point and defines the flow for subsequent execution modes.
To build Omniperf as a developer (from source) please add this directory to `PATH`.
You will find utilities and logic specific to Omniperf's different execution modes in their
To build ROCm Compute Profiler as a developer (from source) please add this directory to `PATH`.
You will find utilities and logic specific to ROCm Compute Profiler's different execution modes in their
respective subdirectories.
+37 -27
View File
@@ -34,11 +34,14 @@ def print_avail_arch(avail_arch: list):
return ret_str
def add_general_group(parser, omniperf_version):
def add_general_group(parser, rocprof_compute_version):
general_group = parser.add_argument_group("General Options")
general_group.add_argument(
"-v", "--version", action="version", version=omniperf_version["ver_pretty"]
"-v",
"--version",
action="version",
version=rocprof_compute_version["ver_pretty"],
)
general_group.add_argument(
"-V",
@@ -57,14 +60,16 @@ def add_general_group(parser, omniperf_version):
)
def omniarg_parser(parser, omniperf_home, supported_archs, omniperf_version):
def omniarg_parser(
parser, rocprof_compute_home, supported_archs, rocprof_compute_version
):
# -----------------------------------------
# Parse arguments (dependent on mode)
# -----------------------------------------
## General Command Line Options
## ----------------------------
add_general_group(parser, omniperf_version)
add_general_group(parser, rocprof_compute_version)
parser._positionals.title = "Modes"
parser._optionals.title = "Help"
@@ -79,15 +84,15 @@ def omniarg_parser(parser, omniperf_home, supported_archs, omniperf_version):
help="Profile the target application",
usage="""
omniperf profile --name <workload_name> [profile options] [roofline options] -- <profile_cmd>
rocprof-compute profile --name <workload_name> [profile options] [roofline options] -- <profile_cmd>
---------------------------------------------------------------------------------
Examples:
\tomniperf profile -n vcopy_all -- ./vcopy -n 1048576 -b 256
\tomniperf profile -n vcopy_SPI_TCC -b SQ TCC -- ./vcopy -n 1048576 -b 256
\tomniperf profile -n vcopy_kernel -k vecCopy -- ./vcopy -n 1048576 -b 256
\tomniperf profile -n vcopy_disp -d 0 -- ./vcopy -n 1048576 -b 256
\tomniperf profile -n vcopy_roof --roof-only -- ./vcopy -n 1048576 -b 256
\trocprof-compute profile -n vcopy_all -- ./vcopy -n 1048576 -b 256
\trocprof-compute profile -n vcopy_SPI_TCC -b SQ TCC -- ./vcopy -n 1048576 -b 256
\trocprof-compute profile -n vcopy_kernel -k vecCopy -- ./vcopy -n 1048576 -b 256
\trocprof-compute profile -n vcopy_disp -d 0 -- ./vcopy -n 1048576 -b 256
\trocprof-compute profile -n vcopy_roof --roof-only -- ./vcopy -n 1048576 -b 256
---------------------------------------------------------------------------------
""",
prog="tool",
@@ -98,7 +103,7 @@ Examples:
)
profile_parser._optionals.title = "Help"
add_general_group(profile_parser, omniperf_version)
add_general_group(profile_parser, rocprof_compute_version)
profile_group = profile_parser.add_argument_group("Profile Options")
roofline_group = profile_parser.add_argument_group("Standalone Roofline Options")
@@ -194,7 +199,10 @@ Examples:
"--use-rocscope", default=False, dest="use_rocscope", help=argparse.SUPPRESS
)
profile_group.add_argument(
"--kernel-summaries", default=False, dest="summaries", help=argparse.SUPPRESS
"--kernel-summaries",
default=False,
dest="summaries",
help=argparse.SUPPRESS,
)
profile_group.add_argument(
"--join-type",
@@ -272,14 +280,14 @@ Examples:
## ----------------------------
db_parser = subparsers.add_parser(
"database",
help="Interact with Omniperf database",
help="Interact with rocprofiler-compute database",
usage="""
\nomniperf database <interaction type> [connection options]
\nrocprof-compute database <interaction type> [connection options]
\n\n-------------------------------------------------------------------------------
\nExamples:
\n\tomniperf database --import -H pavii1 -u temp -t asw -w workloads/vcopy/mi200/
\n\tomniperf database --remove -H pavii1 -u temp -w omniperf_asw_sample_mi200
\n\trocprof-compute database --import -H pavii1 -u temp -t asw -w workloads/vcopy/mi200/
\n\trocprof-compute database --remove -H pavii1 -u temp -w rocprofiler-compute_asw_sample_mi200
\n-------------------------------------------------------------------------------\n
""",
prog="tool",
@@ -290,7 +298,7 @@ Examples:
)
db_parser._optionals.title = "Help"
add_general_group(db_parser, omniperf_version)
add_general_group(db_parser, rocprof_compute_version)
interaction_group = db_parser.add_argument_group("Interaction Type")
connection_group = db_parser.add_argument_group("Connection Options")
@@ -300,7 +308,7 @@ Examples:
required=False,
dest="upload",
action="store_true",
help="\t\t\t\tImport workload to Omniperf DB",
help="\t\t\t\tImport workload to rocprofiler-compute DB",
)
interaction_group.add_argument(
"-r",
@@ -308,7 +316,7 @@ Examples:
required=False,
dest="remove",
action="store_true",
help="\t\t\t\tRemove a workload from Omniperf DB",
help="\t\t\t\tRemove a workload from rocprofiler-compute DB",
)
connection_group.add_argument(
@@ -366,13 +374,13 @@ Examples:
"analyze",
help="Analyze existing profiling results at command line",
usage="""
omniperf analyze --path <workload_path> [analyze options]
rocprof-compute analyze --path <workload_path> [analyze options]
-----------------------------------------------------------------------------------
Examples:
\tomniperf analyze -p workloads/vcopy/mi200/ --list-metrics gfx90a
\tomniperf analyze -p workloads/mixbench/mi200/ --dispatch 12 34 --decimal 3
\tomniperf analyze -p workloads/mixbench/mi200/ --gui
\trocprof-compute analyze -p workloads/vcopy/mi200/ --list-metrics gfx90a
\trocprof-compute analyze -p workloads/mixbench/mi200/ --dispatch 12 34 --decimal 3
\trocprof-compute analyze -p workloads/mixbench/mi200/ --gui
-----------------------------------------------------------------------------------
""",
prog="tool",
@@ -383,7 +391,7 @@ Examples:
)
analyze_parser._optionals.title = "Help"
add_general_group(analyze_parser, omniperf_version)
add_general_group(analyze_parser, rocprof_compute_version)
analyze_group = analyze_parser.add_argument_group("Analyze Options")
analyze_advanced_group = analyze_parser.add_argument_group("Advanced Options")
@@ -454,7 +462,7 @@ Examples:
type=int,
nargs="?",
const=8050,
help="\t\tActivate a GUI to interate with Omniperf metrics.\n\t\tOptionally, specify port to launch application (DEFAULT: 8050)",
help="\t\tActivate a GUI to interate with rocprofiler-compute metrics.\n\t\tOptionally, specify port to launch application (DEFAULT: 8050)",
)
analyze_advanced_group.add_argument(
"--random-port",
@@ -499,7 +507,7 @@ Examples:
dest="config_dir",
metavar="",
help="\t\tSpecify the directory of customized configs.",
default=omniperf_home.joinpath("omniperf_soc/analysis_configs/"),
default=rocprof_compute_home.joinpath("rocprof_compute_soc/analysis_configs/"),
)
analyze_advanced_group.add_argument(
"--save-dfs",
@@ -519,7 +527,9 @@ Examples:
"-g", dest="debug", action="store_true", help="\t\tDebug single metric."
)
analyze_advanced_group.add_argument(
"--dependency", action="store_true", help="\t\tList the installation dependency."
"--dependency",
action="store_true",
help="\t\tList the installation dependency.",
)
analyze_advanced_group.add_argument(
"--kernel-verbose",
+2 -2
View File
@@ -25,5 +25,5 @@
from pathlib import Path
# NB: Creating a new module to share global vars across modules
omniperf_home = Path(__file__).resolve().parent
prog = "omniperf"
rocprof_compute_home = Path(__file__).resolve().parent
prog = "rocprofiler-compute"
+12 -12
View File
@@ -1,6 +1,6 @@
#!/usr/bin/env python3
"""Main entry point for omniperf"""
"""Main entry point for rocprof-compute"""
##############################################################################bl
# MIT License
@@ -34,7 +34,7 @@ import re
try:
from pathlib import Path
from importlib import metadata
from omniperf_base import Omniperf
from rocprof_compute_base import RocProfCompute
from utils.utils import console_error
except ImportError as e:
# print("Failed to import required modules: " + str(e))
@@ -61,12 +61,12 @@ def verify_deps_version(localVer, desiredVer, operator):
def verify_deps():
"""Utility to read library dependencies from requirements.txt and endeavor
to load them within current execution environment.
Used in top-level omniperf to provide error messages if necessary
Used in top-level rocprofiler-compute to provide error messages if necessary
dependencies are not available."""
# Check which version of python is being used
if sys.version_info[0] < 3 or (sys.version_info[0] == 3 and sys.version_info[1] < 8):
print("[ERROR] Python 3.8 or higher is required to run omniperf."
print("[ERROR] Python 3.8 or higher is required to run rocprofiler-compute."
f" The current version is {sys.version_info[0]}.{sys.version_info[1]}.")
sys.exit(1)
@@ -108,7 +108,7 @@ def verify_deps():
):
print(
f"[ERROR] the '{dependency}' distribution does "
"not meet version requirements to use omniperf."
"not meet version requirements to use rocprofiler-compute."
)
print(" --> version installed :", localVersion)
error = True
@@ -119,7 +119,7 @@ def verify_deps():
"Please verify all of the python dependencies called out "
"in the requirements file"
)
print("are installed locally prior to running omniperf.")
print("are installed locally prior to running rocprofiler-compute.")
print("")
print(f"See: {checkFile}")
sys.exit(1)
@@ -132,17 +132,17 @@ def main():
# verify required python dependencies
verify_deps()
omniperf = Omniperf()
rocprof_compute = RocProfCompute()
mode = omniperf.get_mode()
mode = rocprof_compute.get_mode()
# major omniperf execution modes
# major rocprofiler-compute execution modes
if mode == "profile":
omniperf.run_profiler()
rocprof_compute.run_profiler()
elif mode == "database":
omniperf.update_db()
rocprof_compute.update_db()
elif mode == "analyze":
omniperf.run_analysis()
rocprof_compute.run_analysis()
else:
console_error("Unsupported execution mode")
@@ -151,7 +151,7 @@ class OmniAnalyze_Base:
self.load_options(normalization_filter)
for i, d in enumerate(self.__args.path):
for d in self.__args.path:
w = schema.Workload()
w.sys_info = file_io.load_sys_info(Path(d[0], "sysinfo.csv"))
arch = w.sys_info.iloc[0]["gpu_arch"]
@@ -161,7 +161,7 @@ class OmniAnalyze_Base:
w.avail_ips = w.sys_info["ip_blocks"].item().split("|")
w.dfs = copy.deepcopy(self._arch_configs[arch].dfs)
w.dfs_type = self._arch_configs[arch].dfs_type
self._runs[i] = w
self._runs[d[0]] = w
return self._runs
@@ -184,6 +184,15 @@ class OmniAnalyze_Base:
# validate profiling data
is_workload_empty(dir[0])
# no using same paths
occurances = set()
for dir in self.__args.path:
dir = dir[0]
if dir in occurances:
console_error("You cannot provide the same path twice.")
else:
occurances.add(dir)
# ----------------------------------------------------
# Required methods to be implemented by child classes
# ----------------------------------------------------
@@ -191,7 +200,7 @@ class OmniAnalyze_Base:
def pre_processing(self):
"""Perform initialization prior to analysis."""
console_debug("analysis", "prepping to do some analysis")
console_log("analysis", "deriving Omniperf metrics...")
console_log("analysis", "deriving rocprofiler-compute metrics...")
# initalize output file
self._output = (
open(self.__args.output_file, "w+") if self.__args.output_file else sys.stdout
@@ -202,20 +211,20 @@ class OmniAnalyze_Base:
# set filters
if self.__args.gpu_kernel:
for i, gk in enumerate(self.__args.gpu_kernel):
self._runs[i].filter_kernel_ids = gk
for d, gk in zip(self.__args.path, self.__args.gpu_kernel):
self._runs[d[0]].filter_kernel_ids = gk
if self.__args.gpu_id:
if len(self.__args.gpu_id) == 1 and len(self.__args.path) != 1:
for i in range(len(self.__args.path) - 1):
self.__args.gpu_id.extend(self.__args.gpu_id)
for i, gi in enumerate(self.__args.gpu_id):
self._runs[i].filter_gpu_ids = gi
for d, gi in zip(self.__args.path, self.__args.gpu_id):
self._runs[d[0]].filter_gpu_ids = gi
if self.__args.gpu_dispatch_id:
if len(self.__args.gpu_dispatch_id) == 1 and len(self.__args.path) != 1:
for i in range(len(self.__args.path) - 1):
self.__args.gpu_dispatch_id.extend(self.__args.gpu_dispatch_id)
for i, gd in enumerate(self.__args.gpu_dispatch_id):
self._runs[i].filter_dispatch_ids = gd
for d, gd in zip(self.__args.path, self.__args.gpu_dispatch_id):
self._runs[d[0]].filter_dispatch_ids = gd
@abstractmethod
def run_analysis(self):
@@ -22,7 +22,7 @@
# SOFTWARE.
##############################################################################el
from omniperf_analyze.analysis_base import OmniAnalyze_Base
from rocprof_compute_analyze.analysis_base import OmniAnalyze_Base
from utils.utils import demarcate, console_error
from utils import file_io, parser, tty
from utils.kernel_name_shortener import kernel_name_shortener
@@ -38,25 +38,27 @@ class cli_analysis(OmniAnalyze_Base):
super().pre_processing()
if self.get_args().random_port:
console_error("--gui flag is required to enable --random-port")
for i, d in enumerate(self.get_args().path):
for d in self.get_args().path:
file_io.create_df_kernel_top_stats(
raw_data_dir=d[0],
filter_gpu_ids=self._runs[i].filter_gpu_ids,
filter_dispatch_ids=self._runs[i].filter_dispatch_ids,
filter_gpu_ids=self._runs[d[0]].filter_gpu_ids,
filter_dispatch_ids=self._runs[d[0]].filter_dispatch_ids,
time_unit=self.get_args().time_unit,
max_stat_num=self.get_args().max_stat_num,
kernel_verbose=self.get_args().kernel_verbose,
)
# create 'mega dataframe'
self._runs[i].raw_pmc = file_io.create_df_pmc(
self._runs[d[0]].raw_pmc = file_io.create_df_pmc(
d[0], self.get_args().kernel_verbose, self.get_args().verbose
)
# demangle and overwrite original 'Kernel_Name'
kernel_name_shortener(self._runs[i].raw_pmc, self.get_args().kernel_verbose)
kernel_name_shortener(
self._runs[d[0]].raw_pmc, self.get_args().kernel_verbose
)
# create the loaded table
parser.load_table_data(
workload=self._runs[i],
workload=self._runs[d[0]],
dir=d[0],
is_gui=False,
debug=self.get_args().debug,
@@ -71,13 +73,17 @@ class cli_analysis(OmniAnalyze_Base):
tty.show_kernel_stats(
self.get_args(),
self._runs,
self._arch_configs[self._runs[0].sys_info.iloc[0]["gpu_arch"]],
self._arch_configs[
self._runs[self.get_args().path[0][0]].sys_info.iloc[0]["gpu_arch"]
],
self._output,
)
else:
tty.show_all(
self.get_args(),
self._runs,
self._arch_configs[self._runs[0].sys_info.iloc[0]["gpu_arch"]],
self._arch_configs[
self._runs[self.get_args().path[0][0]].sys_info.iloc[0]["gpu_arch"]
],
self._output,
)
@@ -22,7 +22,7 @@
# SOFTWARE.
##############################################################################el
from omniperf_analyze.analysis_base import OmniAnalyze_Base
from rocprof_compute_analyze.analysis_base import OmniAnalyze_Base
from utils.utils import demarcate, console_debug, console_error
from utils import file_io, parser
from utils.gui import build_bar_chart, build_table_chart
@@ -274,20 +274,20 @@ class webui_analysis(OmniAnalyze_Base):
args = self.get_args()
file_io.create_df_kernel_top_stats(
raw_data_dir=self.dest_dir,
filter_gpu_ids=self._runs[0].filter_gpu_ids,
filter_dispatch_ids=self._runs[0].filter_dispatch_ids,
filter_gpu_ids=self._runs[self.dest_dir].filter_gpu_ids,
filter_dispatch_ids=self._runs[self.dest_dir].filter_dispatch_ids,
time_unit=args.time_unit,
max_stat_num=args.max_stat_num,
kernel_verbose=self.get_args().kernel_verbose,
)
# create 'mega dataframe'
self._runs[0].raw_pmc = file_io.create_df_pmc(
self._runs[self.dest_dir].raw_pmc = file_io.create_df_pmc(
self.dest_dir, self.get_args().kernel_verbose, args.verbose
)
# create the loaded kernel stats
parser.load_kernel_top(self._runs[0], self.dest_dir)
parser.load_kernel_top(self._runs[self.dest_dir], self.dest_dir)
# set architecture
self.arch = self._runs[0].sys_info.iloc[0]["gpu_arch"]
self.arch = self._runs[self.dest_dir].sys_info.iloc[0]["gpu_arch"]
else:
console_error(
@@ -300,9 +300,9 @@ class webui_analysis(OmniAnalyze_Base):
super().run_analysis()
args = self.get_args()
input_filters = {
"kernel": self._runs[0].filter_kernel_ids,
"gpu": self._runs[0].filter_gpu_ids,
"dispatch": self._runs[0].filter_dispatch_ids,
"kernel": self._runs[self.dest_dir].filter_kernel_ids,
"gpu": self._runs[self.dest_dir].filter_gpu_ids,
"dispatch": self._runs[self.dest_dir].filter_dispatch_ids,
"normalization": args.normal_unit,
"top_n": args.max_stat_num,
}
Loaded 100 of 379 files, more files were not shown because too many files have changed in this diff. Show more