Fixes for roofline datatype plot outputs (#659)

Profile mode:
Fix roofline plots for datatypes that have peakVALU only. Check for highest roofline to plot the bandwidth lines to proper height, don't rely on existence of peakMFMA for every datatype.
Analyze mode:
Add roofline-data-type option for viewing pdfs in standalone gui. Default is same as profile mode, FP32.

---------

Signed-off-by: Carrie Fallows <Carrie.Fallows@amd.com>

[ROCm/rocprofiler-compute commit: c45e20f325]
Цей коміт міститься в:
cfallows-amd authored and GitHub committed 2025-04-07 12:10:37 -04:00
1 джерело 27585a8a2b
коміт 04919c13e0
5 files changed
+37 -7

No files matched your search

+5
Переглянути файл
@@ -75,6 +75,11 @@ application's profiling data:
#. Memory Chart Analysis
#. Empirical Roofline Analysis
Use ``--roofline-data-type`` option to specify which datatype(s) you would like displayed on the roofline PDFs in the standalone analysis GUI.
Datatypes can be stacked- for example, "--roofline-data-type FP32 FP64 I32" would display one PDF with FP32 and FP64 stacked, and one PDF with INT32.
Default roofline datatype plotted is FP32.
#. Top Stats (Top Kernel Statistics)
#. System Info
#. System Speed-of-Light
+14 -1
Переглянути файл
@@ -386,7 +386,7 @@ Examples:
nargs="+",
type=str,
default=["FP32"],
help="\t\t\tChoose datatypes to generate plotted roofline PDFs for: (DEFAULT: FP32)\n\t\t\t FP8\n\t\t\t FP16\n\t\t\t BF16\n\t\t\t FP32\n\t\t\t FP64\n\t\t\t I8",
help="\t\t\tChoose datatypes to view roofline PDFs for: (DEFAULT: FP32)\n\t\t\t FP8\n\t\t\t FP16\n\t\t\t BF16\n\t\t\t FP32\n\t\t\t FP64\n\t\t\t I8\n\t\t\t I32\n\t\t\t I64\n\t\t\t ",
)
# roofline_group.add_argument('-w', '--workgroups', required=False, default=-1, type=int, help="\t\t\tNumber of kernel workgroups (DEFAULT: 1024)")
@@ -591,6 +591,19 @@ Examples:
const=8050,
help="\t\tActivate a GUI to interate with rocprofiler-compute metrics.\n\t\tOptionally, specify port to launch application (DEFAULT: 8050)",
)
analyze_group.add_argument(
"-R",
"--roofline-data-type",
required=False,
choices=["FP8", "FP16", "BF16", "FP32", "FP64", "I8", "I32", "I64"],
metavar="",
nargs="+",
type=str,
default=["FP32"],
help="\t\t\tChoose datatypes to view roofline PDFs for: (DEFAULT: FP32)\n\t\t\t FP8\n\t\t\t FP16\n\t\t\t BF16\n\t\t\t FP32\n\t\t\t FP64\n\t\t\t I8\n\t\t\t I32\n\t\t\t I64\n\t\t\t ",
)
analyze_advanced_group.add_argument(
"--random-port",
action="store_true",
+4
Переглянути файл
@@ -61,6 +61,9 @@ class webui_analysis(OmniAnalyze_Base):
# define any elements which will have full width
self.__full_width_elements = {1801}
if hasattr(args, "roofline_data_type") and args.roofline_data_type != ["FP32"]:
self.__roofline_data_type = args.roofline_data_type
@demarcate
def build_layout(self, input_filters, arch_configs):
"""
@@ -186,6 +189,7 @@ class webui_analysis(OmniAnalyze_Base):
"mem_level": "ALL",
"include_kernel_names": False,
"is_standalone": False,
"roofline_data_type": self.__roofline_data_type,
}
)
roof_obj = self.get_socs()[self.arch].roofline_obj
+1 -1
Переглянути файл
@@ -302,7 +302,7 @@ class Roofline:
None
if self.__run_parameters["is_standalone"]
else "{} G{}/s".format(
to_int(self.__ceiling_data["valu"][2], ops_flops)
to_int(self.__ceiling_data["valu"][2]), ops_flops
)
),
"{} G{}/s".format(
+13 -5
Переглянути файл
@@ -153,13 +153,21 @@ def calc_ceilings(roofline_parameters, dtype, benchmark_data):
x2_mfma = peakMFMA / peakBw
y2_mfma = peakMFMA
# Check which peak is higher for formatting bandwidth lines
if y2_mfma > y1_mfma: # peakMFMA
peakX = x2_mfma
peakY = y2_mfma
else: # peakVALU
peakX = x1_mfma
peakY = y1_mfma
# These are the points to use:
console_debug("roofline", "coordinate points:")
console_debug("x = [{}, {}]".format(x1, x2_mfma))
console_debug("y = [{}, {}]".format(y1, y2_mfma))
console_debug("x = [{}, {}]".format(x1, peakX))
console_debug("y = [{}, {}]".format(y1, peakY))
graphPoints[cacheHierarchy[i].lower()].append([x1, x2_mfma])
graphPoints[cacheHierarchy[i].lower()].append([y1, y2_mfma])
graphPoints[cacheHierarchy[i].lower()].append([x1, peakX])
graphPoints[cacheHierarchy[i].lower()].append([y1, peakY])
graphPoints[cacheHierarchy[i].lower()].append(peakBw)
# -------------------------------------------------------------------------------------
@@ -177,7 +185,7 @@ def calc_ceilings(roofline_parameters, dtype, benchmark_data):
graphPoints["valu"].append(peakOps)
# Plot MFMA roof
if x1_mfma != -1 and (dtype in MFMA_DATATYPES): # assert that mfma has been assigned
if dtype in MFMA_DATATYPES: # assert that mfma has been assigned
x0_mfma = XMAX
if x2_mfma < x0_mfma:
x0_mfma = x2_mfma