Skip to content

Commit

Permalink
Merge branch 'develop' into spatial-multiplexing
Browse files Browse the repository at this point in the history
  • Loading branch information
ywang103-amd authored Feb 11, 2025
2 parents c8e6f26 + c03cbf2 commit eae2f74
Show file tree
Hide file tree
Showing 11 changed files with 48 additions and 30 deletions.
12 changes: 12 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,18 @@

Full documentation for ROCm Compute Profiler is available at [https://rocm.docs.amd.com/projects/rocprofiler-compute/en/latest/](https://rocm.docs.amd.com/projects/rocprofiler-compute/en/latest/).

## (Unreleased) ROCm Compute Profiler 3.1.0 for ROCm 6.4.0

### Added

* Roofline support for Ubuntu 24.04 (#541)

## ROCm Compute Profiler 3.0.0 for ROCm 6.3.0

### Changed

* Renamed Omniperf to ROCm Compute Profiler (#475)

## Omniperf 2.0.1 for ROCm 6.2.1

### Changed
Expand Down
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -72,11 +72,11 @@ style reference is provided below for convenience:
Keith Lowery and
Nicholas Curtis and
Cristian Di Pietrantonio},
title = {ROCm/rocprofiler-compute: v3.0.0 (01 November 2024)},
month = November,
year = 2024,
title = {ROCm/rocprofiler-compute: v3.1.0 (12 February 2025)},
month = February,
year = 2025,
publisher = {Zenodo},
version = {v3.0.0},
version = {v3.1.0},
doi = {10.5281/zenodo.7314631},
url = {https://doi.org/10.5281/zenodo.7314631}
}
Expand Down
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
3.0.0
3.1.0
2 changes: 1 addition & 1 deletion docs/what-is-rocprof-compute.rst
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ high level.
* :ref:`Memory Chart Analysis panel <grafana-panel-memory-chart-analysis>`

* :ref:`Roofline Analysis panel <grafana-panel-roofline-analysis>`
(*Supported on MI200 only, Ubuntu 20.04, SLES 15 SP3 or RHEL8*)
(*Supported on MI200 and MI300 only, Ubuntu 20.04/22.04/24.04, SLES 15 SP3 or RHEL8*)

* :ref:`Command Processor (CP) panel <grafana-panel-cp>`

Expand Down
6 changes: 2 additions & 4 deletions src/rocprof_compute_profile/profiler_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ def __init__(self, args, profiler_mode, soc):
def get_args(self):
return self.__args

def get_profiler_options(self, fname):
def get_profiler_options(self, fname, soc):
"""Fetch any version specific arguments required by profiler"""
# assume no SoC specific options and return empty list by default
return []
Expand Down Expand Up @@ -361,9 +361,7 @@ def run_profiling(self, version: str, prog: str):
console_debug(output)
console_log("profiling", "Current input file: %s" % fname)

# Fetch any SoC/profiler specific profiling options
options = self._soc.get_profiler_options()
options += self.get_profiler_options(fname)
options = self.get_profiler_options(fname, self._soc)
if (
self.__profiler == "rocprofv1"
or self.__profiler == "rocprofv2"
Expand Down
10 changes: 8 additions & 2 deletions src/rocprof_compute_profile/profiler_rocprof_v1.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,16 @@ def __init__(self, profiling_args, profiler_mode, soc):
or not self.get_args().roof_only
)

def get_profiler_options(self, fname):
def get_profiler_options(self, fname, soc):
fbase = Path(fname).stem
app_cmd = self.get_args().remaining
args = [

args = []
# can be removed in the future. It supports gfx908 + v1
if soc.get_arch() == "gfx908":
args += ["-m", soc.get_workload_perfmon_dir() + "/" + "metrics.xml"]

args += [
# v1 requires request for timestamps
"--timestamp",
"on",
Expand Down
10 changes: 8 additions & 2 deletions src/rocprof_compute_profile/profiler_rocprof_v2.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,10 +39,16 @@ def __init__(self, profiling_args, profiler_mode, soc):
or not self.get_args().roof_only
)

def get_profiler_options(self, fname):
def get_profiler_options(self, fname, soc):
fbase = Path(fname).stem
app_cmd = shlex.split(self.get_args().remaining)
args = [

args = []
# can be removed in the future. It supports gfx908 + v2
if soc.get_arch() == "gfx908":
args += ["-m", soc.get_workload_perfmon_dir() + "/" + "metrics.xml"]

args += [
# v2 requires output directory argument
"-d",
self.get_args().path + "/" + "out",
Expand Down
8 changes: 4 additions & 4 deletions src/rocprof_compute_profile/profiler_rocprof_v3.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,18 +40,18 @@ def __init__(self, profiling_args, profiler_mode, soc):
or not self.get_args().roof_only
)

def get_profiler_options(self, fname):
def get_profiler_options(self, fname, soc):
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"
trace_option = "--kokkos-trace"
if self.get_args().hip_trace:
trace_option = "--hip-trace"

args = [
"-E",
Expand Down
6 changes: 0 additions & 6 deletions src/rocprof_compute_soc/soc_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -97,12 +97,6 @@ def set_compatible_profilers(self, profiler_names: list):
def get_compatible_profilers(self):
return self.__compatible_profilers

@demarcate
def get_profiler_options(self):
"""Fetch any SoC specific arguments required by the profiler"""
# assume no SoC specific options and return empty list by default
return []

@demarcate
def populate_mspec(self):
from utils.specs import run, search, total_sqc, total_xcds
Expand Down
5 changes: 0 additions & 5 deletions src/rocprof_compute_soc/soc_gfx908.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,11 +69,6 @@ def __init__(self, args, mspec):
self._mspec.max_mclk = 1200
self._mspec.cur_mclk = 1200

@demarcate
def get_profiler_options(self):
# Mi100 requires a custom xml config
return ["-m", self.get_workload_perfmon_dir() + "/" + "metrics.xml"]

# -----------------------
# Required child methods
# -----------------------
Expand Down
9 changes: 8 additions & 1 deletion src/utils/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -596,6 +596,9 @@ def run_prof(
new_env = os.environ.copy()
new_env["ROCPROFILER_INDIVIDUAL_XCC_MODE"] = "1"

is_timestamps = False
if path(fname).name == "timestamps.txt":
is_timestamps = True
time_1 = time.time()

# profile the app
Expand Down Expand Up @@ -686,10 +689,14 @@ def run_prof(
results_files_csv = glob.glob(
workload_dir + "/out/pmc_1/*/*_converted.csv"
)
else:
elif is_timestamps:
# when the input is timestamps, we know counter csv file is not generated and will instead parse kernel trace file
results_files_csv = glob.glob(
workload_dir + "/out/pmc_1/*/*_kernel_trace.csv"
)
else:
# when the input is not for timestamps, and counter csv file is not generated, we assume failed rocprof run and will completely bypass the file generation and merging for current pmc
return

else:
console_error("The output file of rocprofv3 can only support json or csv!!!")
Expand Down

0 comments on commit eae2f74

Please sign in to comment.