Format source code to PEP8 using Ruff (#36)
* added ruff docs * style: Run ruff and black before yapf pass * yapf -r -i (23 fixes) * fixed conf.py and ran ruff format . * fixed conf.py 2 * formatted argparser.py * formatted src/rocprof_compute_analyze * formatted src/rocprof_compute_profile * formatted soc_base.py * formatted rocprof_compute_tui * formatted gui_components * formatted src/utils * formatted tests/ * format extra files * cleanup * fix test_utils.py * fixed typos * Update pyproject.toml * Update README.md * Update test_utils.py --------- Signed-off-by: jamessiddeley-amd <James.Siddeley@amd.com> Co-authored-by: James Siddeley <James.Siddeley@amd.com> Co-authored-by: systems-assistant[bot] <systems-assistant[bot]@users.noreply.github.com>
This commit is contained in:
committed by
GitHub
parent
d3f9ab25eb
commit
58d2a016ce
@@ -23,7 +23,6 @@
|
||||
|
||||
##############################################################################
|
||||
|
||||
|
||||
import argparse
|
||||
import importlib
|
||||
import os
|
||||
@@ -159,7 +158,9 @@ class RocProfCompute:
|
||||
|
||||
def parse_args(self):
|
||||
parser = argparse.ArgumentParser(
|
||||
description="Command line interface for AMD's GPU profiler, ROCm Compute Profiler",
|
||||
description=(
|
||||
"Command line interface for AMD's GPU profiler, ROCm Compute Profiler"
|
||||
),
|
||||
prog="tool",
|
||||
formatter_class=lambda prog: argparse.RawTextHelpFormatter(
|
||||
prog, max_help_position=30
|
||||
@@ -176,7 +177,11 @@ class RocProfCompute:
|
||||
and self.__args.format_rocprof_output != "rocpd"
|
||||
):
|
||||
console_warning(
|
||||
f"The option --format-rocprof-output currently set to {self.__args.format_rocprof_output} will default to rocpd in a future release."
|
||||
(
|
||||
f"The option --format-rocprof-output currently set to "
|
||||
f"{self.__args.format_rocprof_output} will default to rocpd "
|
||||
"in a future release."
|
||||
)
|
||||
)
|
||||
|
||||
if self.__args.mode == None:
|
||||
@@ -188,7 +193,6 @@ class RocProfCompute:
|
||||
"rocprof-compute requires you to pass a valid mode. Detected None."
|
||||
)
|
||||
elif self.__args.mode == "profile":
|
||||
|
||||
# FIXME:
|
||||
# Might want to get host name from detected spec
|
||||
if self.__args.subpath == "node_name":
|
||||
@@ -312,7 +316,9 @@ class RocProfCompute:
|
||||
# Update default path
|
||||
if self.__args.path == str(Path(os.getcwd()).joinpath("workloads")):
|
||||
self.__args.path = str(
|
||||
Path(self.__args.path).joinpath(self.__args.name, self.__mspec.gpu_model)
|
||||
Path(self.__args.path).joinpath(
|
||||
self.__args.name, self.__mspec.gpu_model
|
||||
)
|
||||
)
|
||||
|
||||
# instantiate desired profiler
|
||||
@@ -376,7 +382,10 @@ class RocProfCompute:
|
||||
profiler.run_profiling(self.__version["ver"], config.PROJECT_NAME)
|
||||
time_end_prof = time.time()
|
||||
console_debug(
|
||||
'finished "run_profiling" and finished rocprof\'s workload, time taken was {} m {} sec'.format(
|
||||
(
|
||||
'finished "run_profiling" and finished rocprof\'s workload, '
|
||||
"time taken was {} m {} sec"
|
||||
).format(
|
||||
int((time_end_prof - time_start_prof) / 60),
|
||||
str((time_end_prof - time_start_prof) % 60),
|
||||
)
|
||||
@@ -385,8 +394,7 @@ class RocProfCompute:
|
||||
time_end_post = time.time()
|
||||
console_debug(
|
||||
'time taken for "post_processing" was {} seconds'.format(
|
||||
int((time_end_post - time_end_prof) / 60),
|
||||
str((time_end_post - time_end_prof) % 60),
|
||||
int(time_end_post - time_end_prof)
|
||||
)
|
||||
)
|
||||
self.__soc[self.__mspec.gpu_arch].post_profiling()
|
||||
@@ -398,7 +406,8 @@ class RocProfCompute:
|
||||
self.print_graphic()
|
||||
|
||||
console_warning(
|
||||
"Database update mode is deprecated and will be removed in a future release "
|
||||
"Database update mode is deprecated and will "
|
||||
"be removed in a future release "
|
||||
"and no fixes will be made for this mode."
|
||||
)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user