Skip to content
Merged
Show file tree
Hide file tree
Changes from 13 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions projects/rocprofiler-compute/.pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ default_stages: [pre-commit]
fail_fast: true
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v5.0.0
rev: v6.0.0
hooks:
- id: check-yaml
- id: end-of-file-fixer
Expand All @@ -12,7 +12,7 @@ repos:
- repo: https://github.com/astral-sh/ruff-pre-commit
# Ruff version. Check https://github.com/astral-sh/ruff-pre-commit#version-compatibility
# for the latest ruff version supported by the hook.
rev: v0.12.12
rev: v0.14.11
hooks:
- id: ruff-check
args: [--fix]
Expand Down
2 changes: 2 additions & 0 deletions projects/rocprofiler-compute/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,8 @@ Full documentation for ROCm Compute Profiler is available at [https://rocm.docs.

* Fix issue where counter collection data was empty when profiling workload which spawn multiple child processes

* Fix issue where dispatch filtering in a range (e.g. >2) was not working

* Fix redundant warnings for compute/memory partition not found for < MI 300 series GPUs by skipping partition checks

### Removed
Expand Down
5 changes: 3 additions & 2 deletions projects/rocprofiler-compute/docs/how-to/analyze/cli.rst
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ This section provides an overview of ROCm Compute Profiler's CLI analysis featur
* :ref:`Metric customization <cli-analysis-options>`: Isolate a subset of built-in metrics or build your own profiling configuration.

* :ref:`Filtering <cli-analysis-options>`: Hone in on a particular kernel, GPU ID, or dispatch ID via post-process filtering.

* :ref:`Per-kernel roofline analysis <per-kernel-roofline>`: Detailed arithmetic intensity and performance analysis for individual kernels.

Run ``rocprof-compute analyze -h`` for more details.
Expand Down Expand Up @@ -346,6 +346,7 @@ Show System Speed-of-Light and CS_Busy blocks only
this case, ``1`` is the ID for System Speed-of-Light and ``5.1.0`` the ID for
GPU Busy Cycles metric.


Filter kernels
First, list the top kernels in your application using `--list-stats`.

Expand Down Expand Up @@ -566,4 +567,4 @@ Analysis database example
DEBUG [analysis] generating analysis
DEBUG SQLite database initialized with name: test.db
DEBUG Initialized database: test.db
DEBUG Completed writing database
DEBUG Completed writing database
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,9 @@ Launch the standalone GUI analyzer
----------------------------------

To launch the ROCm Compute Profiler GUI analyzer, include the ``--gui`` flag with your
desired analysis command. For example:
desired analysis command.

For example:

.. code-block:: shell-session

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -386,26 +386,24 @@ def sanitize(self) -> None:
sys.exit(0)

# Ensure analysis output does not overwrite existing files
if not args.output_name:
return

if not re.match(r"^[A-Za-z0-9_-]+$", args.output_name):
console_error(
"analysis",
"Analysis output file/folder name must "
"contain only alphanumeric characters "
"or underscores (_), hyphens (-).",
)
if args.output_name:
if not re.match(r"^[A-Za-z0-9_-]+$", args.output_name):
console_error(
"analysis",
"Analysis output file/folder name must "
"contain only alphanumeric characters "
"or underscores (_), hyphens (-).",
)

path_to_check = args.output_name
if args.output_format in ("txt", "db"):
path_to_check += f".{args.output_format}"
path_to_check = args.output_name
if args.output_format in ("txt", "db"):
path_to_check += f".{args.output_format}"

if Path(path_to_check).exists():
console_error(
f"Analysis output file/folder {path_to_check} already exists. "
"Please choose a different name."
)
if Path(path_to_check).exists():
console_error(
f"Analysis output file/folder {path_to_check} already exists. "
"Please choose a different name."
)

# Check if any kernel's counters are missing due to iteration multiplexing
if (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,6 @@ def __init__(
self.app = dash.Dash(
__name__, title=PROJECT_NAME, external_stylesheets=[dbc.themes.CYBORG]
)
self.dest_dir = str(Path(args.path[0][0]).absolute().resolve())
self.arch: Optional[str] = None

self.__hidden_sections = ["Memory Chart"]
Expand Down Expand Up @@ -90,6 +89,7 @@ def build_layout(
kernel_top_df = base_data.dfs[1]
for kernel_id in base_data.filter_kernel_ids:
filt_kernel_names.append(str(kernel_top_df.loc[kernel_id, "Kernel_Name"]))
input_filters["kernel"] = filt_kernel_names

# setup app layout
from utils.gui_components.header import get_header
Expand Down Expand Up @@ -338,6 +338,7 @@ def pre_processing(self) -> None:
)

args = self.get_args()
self.dest_dir = str(Path(args.path[0][0]).absolute().resolve())

# create 'mega dataframe'
self._runs[self.dest_dir].raw_pmc = file_io.create_df_pmc(
Expand Down
10 changes: 6 additions & 4 deletions projects/rocprofiler-compute/src/utils/gui.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ def multi_bar_chart(

def create_instruction_mix_bar_chart(display_df: pd.DataFrame, df_unit: str) -> px.bar:
display_df = display_df.copy()
display_df["Avg"] = display_df["Avg"].apply(lambda x: int(x) if x != "" else 0)
display_df["Avg"] = display_df["Avg"].apply(lambda x: int(x) if x != "N/A" else 0)

return px.bar(
display_df,
Expand All @@ -78,7 +78,7 @@ def create_multi_bar_charts(
display_df: pd.DataFrame, table_id: int, df_unit: str
) -> list[px.bar]:
display_df = display_df.copy()
display_df["Avg"] = display_df["Avg"].apply(lambda x: int(x) if x != "" else 0)
display_df["Avg"] = display_df["Avg"].apply(lambda x: int(x) if x != "N/A" else 0)

nested_bar = multi_bar_chart(table_id, display_df)
charts = []
Expand All @@ -103,7 +103,9 @@ def create_multi_bar_charts(

def create_sol_charts(display_df: pd.DataFrame, table_id: int) -> list[px.bar]:
display_df = display_df.copy()
display_df["Avg"] = display_df["Avg"].apply(lambda x: float(x) if x != "" else 0.0)
display_df["Avg"] = display_df["Avg"].apply(
lambda x: float(x) if x != "N/A" else 0.0
)

charts = []

Expand Down Expand Up @@ -144,7 +146,7 @@ def create_sol_charts(display_df: pd.DataFrame, table_id: int) -> list[px.bar]:
elif table_id == 1101:
# Special formatting reference 'Pct of Peak' value
display_df["Pct of Peak"] = display_df["Pct of Peak"].apply(
lambda x: float(x) if x != "" else 0.0
lambda x: float(x) if x != "N/A" else 0.0
)
charts.append(
px.bar(
Expand Down
4 changes: 3 additions & 1 deletion projects/rocprofiler-compute/src/utils/parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -1290,14 +1290,16 @@ def apply_dispatch_filter(df: pd.DataFrame, workload: schema.Workload) -> pd.Dat
# NB: support ignoring the 1st n dispatched execution by '> n'
# The better way may be parsing python slice string
for dispatch_id in workload.filter_dispatch_ids:
if isinstance(dispatch_id, str) and ">" in dispatch_id:
dispatch_id = re.match(r"\>\s*(\d+)", dispatch_id).group(1)
if int(dispatch_id) >= len(df): # subtract 2 bc of the two header rows
console_error("analysis", f"{dispatch_id} is an invalid dispatch id.")

if (
isinstance(workload.filter_dispatch_ids[0], str)
and ">" in workload.filter_dispatch_ids[0]
):
dispatch_match = re.match(r"\> (\d+)", workload.filter_dispatch_ids[0])
dispatch_match = re.match(r"\>\s*(\d+)", workload.filter_dispatch_ids[0])
df = df[
df[schema.PMC_PERF_FILE_PREFIX]["Dispatch_ID"]
> int(dispatch_match.group(1))
Expand Down
Loading