Skip to content

Commit

Permalink
Enable kokkos trace/features from rocprofv3 in rocprof-compute. (#545)
Browse files Browse the repository at this point in the history
Signed-off-by: Xuan Chen <xuchen@amd.com>
  • Loading branch information
xuchen-amd authored Jan 29, 2025
1 parent 0a52e6f commit da1bd04
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 1 deletion.
16 changes: 16 additions & 0 deletions src/argparser.py
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,22 @@ def omniarg_parser(
required=False,
help="\t\t\tSpecify the type of subpath to save workload: node_name, gpu_model.",
)
profile_group.add_argument(
"--hip-trace",
dest="hip_trace",
required=False,
default=False,
action="store_true",
help="\t\t\tHIP trace, execturion trace for the entire application at the HIP level.",
)
profile_group.add_argument(
"--kokkos-trace",
dest="kokkos_trace",
required=False,
default=False,
action="store_true",
help="\t\t\tKokkos trace, traces Kokkos API calls.",
)
profile_group.add_argument(
"-k",
"--kernel",
Expand Down
10 changes: 9 additions & 1 deletion src/rocprof_compute_profile/profiler_rocprof_v3.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,17 @@ def __init__(self, profiling_args, profiler_mode, soc):

def get_profiler_options(self, fname):
app_cmd = shlex.split(self.get_args().remaining)
trace_option = "--kernel-trace"
rocprof_out_format = "json"

if self.get_args().format_rocprof_output == "csv":
rocprof_out_format = "csv"

if self.get_args().hip_trace:
trace_option += " " + "--hip-trace"
if self.get_args().kokkos_trace:
trace_option += " " + "--kokkos-trace"

args = [
"-E",
os.path.join(
Expand All @@ -56,7 +64,7 @@ def get_profiler_options(self, fname):
# v3 requires output directory argument
"-d",
self.get_args().path + "/" + "out",
"--kernel-trace",
trace_option,
"--output-format",
rocprof_out_format,
"--",
Expand Down

0 comments on commit da1bd04

Please sign in to comment.