Skip to content

Commit

Permalink
Inital commit of the rocprof-compute rebrand process. This commit ren…
Browse files Browse the repository at this point in the history
…ames omniperf to rocprof-compute in places highly visible to an average external user, i.e., renaming in commands, usage messages, logs, and other command line outputs.
  • Loading branch information
xuchen-amd committed Sep 24, 2024
1 parent e6747da commit 9bbacd7
Show file tree
Hide file tree
Showing 15 changed files with 846 additions and 386 deletions.
34 changes: 17 additions & 17 deletions src/argparser.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,15 +79,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",
Expand Down Expand Up @@ -272,14 +272,14 @@ def omniarg_parser(parser, omniperf_home, supported_archs, omniperf_version):
## ----------------------------
db_parser = subparsers.add_parser(
"database",
help="Interact with Omniperf database",
help="Interact with rocprof-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 rocprof-compute_asw_sample_mi200
\n-------------------------------------------------------------------------------\n
""",
prog="tool",
Expand All @@ -300,15 +300,15 @@ def omniarg_parser(parser, omniperf_home, supported_archs, omniperf_version):
required=False,
dest="upload",
action="store_true",
help="\t\t\t\tImport workload to Omniperf DB",
help="\t\t\t\tImport workload to rocprof-compute DB",
)
interaction_group.add_argument(
"-r",
"--remove",
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 rocprof-compute DB",
)

connection_group.add_argument(
Expand Down Expand Up @@ -366,13 +366,13 @@ def omniarg_parser(parser, omniperf_home, supported_archs, omniperf_version):
"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",
Expand Down Expand Up @@ -454,7 +454,7 @@ def omniarg_parser(parser, omniperf_home, supported_archs, omniperf_version):
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 rocprof-compute metrics.\n\t\tOptionally, specify port to launch application (DEFAULT: 8050)",
)
analyze_advanced_group.add_argument(
"--random-port",
Expand Down
2 changes: 1 addition & 1 deletion src/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,4 +26,4 @@

# NB: Creating a new module to share global vars across modules
omniperf_home = Path(__file__).resolve().parent
prog = "omniperf"
prog = "rocprof-compute"
2 changes: 1 addition & 1 deletion src/omniperf_analyze/analysis_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,7 @@ def sanitize(self):
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 rocprof-compute metrics...")
# initalize output file
self._output = (
open(self.__args.output_file, "w+") if self.__args.output_file else sys.stdout
Expand Down
20 changes: 11 additions & 9 deletions src/omniperf_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -92,12 +92,12 @@ def __init__(self):
def print_graphic(self):
"""Log program name as ascii art to terminal."""
ascii_art = r"""
___ _ __
/ _ \ _ __ ___ _ __ (_)_ __ ___ _ __ / _|
| | | | '_ ` _ \| '_ \| | '_ \ / _ \ '__| |_
| |_| | | | | | | | | | | |_) | __/ | | _|
\___/|_| |_| |_|_| |_|_| .__/ \___|_| |_|
|_|
__ _
_ __ ___ ___ _ __ _ __ ___ / _| ___ ___ _ __ ___ _ __ _ _| |_ ___
| '__/ _ \ / __| '_ \| '__/ _ \| |_ _____ / __/ _ \| '_ ` _ \| '_ \| | | | __/ _ \
| | | (_) | (__| |_) | | | (_) | _|_____| (_| (_) | | | | | | |_) | |_| | || __/
|_| \___/ \___| .__/|_| \___/|_| \___\___/|_| |_| |_| .__/ \__,_|\__\___|
|_| |_|
"""
print(ascii_art)

Expand Down Expand Up @@ -163,12 +163,12 @@ def load_soc_specs(self, sysinfo: dict = None):

def parse_args(self):
parser = argparse.ArgumentParser(
description="Command line interface for AMD's GPU profiler, Omniperf",
description="Command line interface for AMD's GPU profiler, rocprof-compute",
prog="tool",
formatter_class=lambda prog: argparse.RawTextHelpFormatter(
prog, max_help_position=30
),
usage="omniperf [mode] [options]",
usage="rocprof-compute [mode] [options]",
)
omniarg_parser(
parser, config.omniperf_home, self.__supported_archs, self.__version
Expand All @@ -180,7 +180,9 @@ def parse_args(self):
print(generate_machine_specs(self.__args))
sys.exit(0)
parser.print_help(sys.stderr)
console_error("Omniperf requires you pass a valid mode. Detected None.")
console_error(
"rocprof-compute requires you pass a valid mode. Detected None."
)
return

@demarcate
Expand Down
2 changes: 1 addition & 1 deletion src/omniperf_profile/profiler_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -266,7 +266,7 @@ def pre_processing(self):
self.__args.remaining = " ".join(self.__args.remaining)
else:
console_error(
"Profiling command required. Pass application executable after -- at the end of options.\n\t\ti.e. omniperf profile -n vcopy -- ./vcopy -n 1048576 -b 256"
"Profiling command required. Pass application executable after -- at the end of options.\n\t\ti.e. rocprof-compute profile -n vcopy -- ./vcopy -n 1048576 -b 256"
)

# verify name meets MongoDB length requirements and no illegal chars
Expand Down
6 changes: 3 additions & 3 deletions src/omniperf_soc/soc_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -101,8 +101,8 @@ def get_profiler_options(self):
return []

def check_arch_override(self):
if "OMNIPERF_ARCH_OVERRIDE" in os.environ.keys():
return os.environ["OMNIPERF_ARCH_OVERRIDE"]
if "ROCPROFCOMPUTE_ARCH_OVERRIDE" in os.environ.keys():
return os.environ["ROCPROFCOMPUTE_ARCH_OVERRIDE"]
return ""

@demarcate
Expand Down Expand Up @@ -201,7 +201,7 @@ def populate_mspec(self):
else:
console_error(
"Cannot parse MI300 details from rocminfo. Please verify output or set the arch using (e.g.,) "
'export OMNIPERF_ARCH_OVERRIDE="MI300A"'
'export ROCPROFCOMPUTE_ARCH_OVERRIDE="MI300A"'
)

self._mspec.num_xcd = str(
Expand Down
2 changes: 1 addition & 1 deletion src/roofline.py
Original file line number Diff line number Diff line change
Expand Up @@ -418,7 +418,7 @@ def profile(self):
if not self.__args.remaining:
console_error(
"profiling"
"An <app_cmd> is required to run.\nomniperf profile -n test -- <app_cmd>"
"An <app_cmd> is required to run.\nrocprof-compute profile -n test -- <app_cmd>"
)
# TODO: Add an equivelent of characterize_app() to run profiling directly out of this module

Expand Down
4 changes: 2 additions & 2 deletions src/utils/db_connector.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ def prep_import(self):
)

self.connection_info["db"] = (
"omniperf_" + str(self.args.team) + "_" + str(name) + "_" + str(soc)
"rocprof-compute_" + str(self.args.team) + "_" + str(name) + "_" + str(soc)
)

@demarcate
Expand Down Expand Up @@ -157,7 +157,7 @@ def pre_processing(self):
is_full_workload_name = self.args.workload.count("_") >= 3
if not is_full_workload_name:
console_error(
"-w/--workload is not valid. Please use full workload name as seen in GUI when removing (i.e. omniperf_asw_vcopy_mi200)"
"-w/--workload is not valid. Please use full workload name as seen in GUI when removing (i.e. rocprof-compute_asw_vcopy_mi200)"
)
if (
self.connection_info["host"] == None
Expand Down
2 changes: 1 addition & 1 deletion src/utils/gui_components/header.py
Original file line number Diff line number Diff line change
Expand Up @@ -299,7 +299,7 @@ def get_header(raw_pmc, input_filters, kernel_names):
children=[
# Report bug button
html.A(
href="https://github.com/ROCm/omniperf/issues",
href="https://github.com/ROCm/rocprofiler-compute/issues",
children=[
html.Button(
className="report",
Expand Down
12 changes: 6 additions & 6 deletions src/utils/logger.py
Original file line number Diff line number Diff line change
Expand Up @@ -83,8 +83,8 @@ def setup_console_handler():
setattr(logging, "trace", trace_logger)

color_setting = 1
if "OMNIPERF_COLOR" in os.environ.keys():
color_setting = int(os.environ["OMNIPERF_COLOR"])
if "ROCPROFCOMPUTE_COLOR" in os.environ.keys():
color_setting = int(os.environ["ROCPROFCOMPUTE_COLOR"])

if color_setting == 0:
# non-colored
Expand All @@ -99,7 +99,7 @@ def setup_console_handler():
# no color or levelname for INFO, other log messages entirely in color
formatter = ColoredFormatterAll()
else:
print("Unsupported setting for OMNIPERF_COLOR - set to 0, 1, 2 or 3.")
print("Unsupported setting for ROCPROFCOMPUTE_COLOR - set to 0, 1, 2 or 3.")
sys.exit(1)

console_handler = logging.StreamHandler(sys.stdout)
Expand Down Expand Up @@ -130,8 +130,8 @@ def setup_logging_priority(verbosity, quietmode, appmode):
loglevel = levels[min(verbosity, len(levels) - 1)] # cap to last level index

# optional: override of default loglevel via env variable which takes precedence
if "OMNIPERF_LOGLEVEL" in os.environ.keys():
loglevel = os.environ["OMNIPERF_LOGLEVEL"]
if "ROCPROFCOMPUTE_LOGLEVEL" in os.environ.keys():
loglevel = os.environ["ROCPROFCOMPUTE_LOGLEVEL"]
if loglevel in {"DEBUG", "debug"}:
loglevel = logging.DEBUG
elif loglevel in {"TRACE", "trace"}:
Expand All @@ -141,7 +141,7 @@ def setup_logging_priority(verbosity, quietmode, appmode):
elif loglevel in {"ERROR", "error"}:
loglevel = logging.ERROR
else:
print("Ignoring unsupported OMNIPERF_LOGLEVEL setting (%s)" % loglevel)
print("Ignoring unsupported ROCPROFCOMPUTE_LOGLEVEL setting (%s)" % loglevel)
sys.exit(1)

# update console loglevel based on command-line args/env settings
Expand Down
2 changes: 1 addition & 1 deletion src/utils/specs.py
Original file line number Diff line number Diff line change
Expand Up @@ -540,7 +540,7 @@ def get_class_members(self):
return pd.DataFrame(data, index=[0])

def __repr__(self):
topstr = "Machine Specifications: describing the state of the machine that Omniperf data was collected on.\n"
topstr = "Machine Specifications: describing the state of the machine that rocprof-compute data was collected on.\n"
data = []
for field in fields(self):
name = field.name
Expand Down
2 changes: 1 addition & 1 deletion tests/generate_test_analyze_workloads.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
+ arch
+ "():"
+ "\n\twith pytest.raises(SystemExit) as e:"
+ "\n\t\twith patch('sys.argv',['omniperf', 'analyze', '--path', '"
+ "\n\t\twith patch('sys.argv',['rocprof-compute', 'analyze', '--path', '"
+ workload
+ "/"
+ arch
Expand Down
Loading

0 comments on commit 9bbacd7

Please sign in to comment.