Add F4 F6 to roofline for MI350 series (#709)

Add roofline bins with FP4 FP6 datatypes enabled for gfx950 arch

---------

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

[ROCm/rocprofiler-compute commit: cb2d928ecf]
Этот коммит содержится в:
cfallows-amd
2025-05-26 18:36:31 -04:00
коммит произвёл GitHub
родитель ba61cc36f5
Коммит 689746e2cd
7 изменённых файлов: 144 добавлений и 66 удалений
+78 -21
Просмотреть файл
@@ -44,15 +44,61 @@ FONT_WEIGHT = "bold"
# SUPPORTED_DATATYPES table is based on datatype support in rocm-amdgpu-bench repository
# Indicates which datatypes per gpu arch can be generated by the roofline binary
SUPPORTED_DATATYPES = {
"gfx90a": ["FP16", "BF16", "FP32", "FP64", "I8", "I32", "I64"], # Unsupported: F8
"gfx940": ["FP8", "FP16", "BF16", "FP32", "FP64", "I8", "I32", "I64"], # Unsupported:
"gfx941": ["FP8", "FP16", "BF16", "FP32", "FP64", "I8", "I32", "I64"], # Unsupported:
"gfx942": ["FP8", "FP16", "BF16", "FP32", "FP64", "I8", "I32", "I64"], # Unsupported:
"gfx950": ["FP8", "FP16", "BF16", "FP32", "FP64", "I8", "I32", "I64"], # Unsupported:
"gfx90a": [
"FP16",
"BF16",
"FP32",
"FP64",
"I8",
"I32",
"I64",
], # Unsupported: F4, F6, F8
"gfx940": [
"FP8",
"FP16",
"BF16",
"FP32",
"FP64",
"I8",
"I32",
"I64",
], # Unsupported: F4, F6
"gfx941": [
"FP8",
"FP16",
"BF16",
"FP32",
"FP64",
"I8",
"I32",
"I64",
], # Unsupported: F4, F6
"gfx942": [
"FP8",
"FP16",
"BF16",
"FP32",
"FP64",
"I8",
"I32",
"I64",
], # Unsupported: F4, F6
"gfx950": [
"FP4",
"FP6",
"FP8",
"FP16",
"BF16",
"FP32",
"FP64",
"I8",
"I32",
"I64",
], # Unsupported:
}
PEAK_OPS_DATATYPES = ["FP8", "FP16", "BF16", "FP32", "FP64", "I8", "I32", "I64"]
MFMA_DATATYPES = ["FP8", "FP16", "BF16", "FP32", "FP64", "I8"]
MFMA_DATATYPES = ["FP4", "FP6", "FP8", "FP16", "BF16", "FP32", "FP64", "I8"]
TOP_N = 10
@@ -67,6 +113,7 @@ class AI_Data:
total_flops: float
valu_flops: float
mfma_flops_f6f4: float
mfma_flops_f8: float
mfma_flops_f16: float
mfma_flops_bf16: float
@@ -212,11 +259,11 @@ def calc_ai(mspec, sort_type, ret_df):
df = df.sort_values(by=["Kernel_Name"])
df = df.reset_index(drop=True)
total_flops = valu_flops = mfma_flops_f8 = mfma_flops_bf16 = mfma_flops_f16 = (
mfma_iops_i8
) = mfma_flops_f32 = mfma_flops_f64 = lds_data = L1cache_data = L2cache_data = (
hbm_data
) = calls = totalDuration = avgDuration = 0.0
total_flops = valu_flops = mfma_flops_f6f4 = mfma_flops_f8 = mfma_flops_bf16 = (
mfma_flops_f16
) = mfma_iops_i8 = mfma_flops_f32 = mfma_flops_f64 = lds_data = L1cache_data = (
L2cache_data
) = hbm_data = calls = totalDuration = avgDuration = 0.0
kernelName = ""
@@ -273,6 +320,8 @@ def calc_ai(mspec, sort_type, ret_df):
)
if "FP8" in supported_dt:
total_flops += df["SQ_INSTS_VALU_MFMA_MOPS_F8"][idx] * 512
if ("FP4" in supported_dt) or ("FP6" in supported_dt):
total_flops += df["SQ_INSTS_VALU_MFMA_MOPS_F6F4"][idx] * 512
except KeyError:
console_debug(
"roofline",
@@ -313,6 +362,8 @@ def calc_ai(mspec, sort_type, ret_df):
try:
if "FP8" in supported_dt:
mfma_flops_f8 += df["SQ_INSTS_VALU_MFMA_MOPS_F8"][idx] * 512
if ("FP4" in supported_dt) or ("FP6" in supported_dt):
mfma_flops_f6f4 += df["SQ_INSTS_VALU_MFMA_MOPS_F6F4"][idx] * 512
mfma_flops_f16 += df["SQ_INSTS_VALU_MFMA_MOPS_F16"][idx] * 512
mfma_flops_bf16 += df["SQ_INSTS_VALU_MFMA_MOPS_BF16"][idx] * 512
mfma_flops_f32 += df["SQ_INSTS_VALU_MFMA_MOPS_F32"][idx] * 512
@@ -413,6 +464,7 @@ def calc_ai(mspec, sort_type, ret_df):
calls,
total_flops / calls,
valu_flops / calls,
mfma_flops_f6f4 / calls,
mfma_flops_f8 / calls,
mfma_flops_f16 / calls,
mfma_flops_bf16 / calls,
@@ -432,11 +484,13 @@ def calc_ai(mspec, sort_type, ret_df):
kernelName, idx, calls
)
)
total_flops = valu_flops = mfma_flops_f8 = mfma_flops_bf16 = (
mfma_flops_f16
) = mfma_iops_i8 = mfma_flops_f32 = mfma_flops_f64 = lds_data = (
L1cache_data
) = L2cache_data = hbm_data = calls = totalDuration = avgDuration = 0.0
total_flops = valu_flops = mfma_flops_f6f4 = mfma_flops_f8 = (
mfma_flops_bf16
) = mfma_flops_f16 = mfma_iops_i8 = mfma_flops_f32 = mfma_flops_f64 = (
lds_data
) = L1cache_data = L2cache_data = hbm_data = calls = totalDuration = (
avgDuration
) = 0.0
if sort_type == "dispatches":
myList.append(
@@ -445,6 +499,7 @@ def calc_ai(mspec, sort_type, ret_df):
calls,
total_flops,
valu_flops,
mfma_flops_f6f4,
mfma_flops_f8,
mfma_flops_f16,
mfma_flops_bf16,
@@ -459,11 +514,13 @@ def calc_ai(mspec, sort_type, ret_df):
avgDuration,
)
)
total_flops = valu_flops = mfma_flops_f8 = mfma_flops_bf16 = (
mfma_flops_f16
) = mfma_iops_i8 = mfma_flops_f32 = mfma_flops_f64 = lds_data = (
L1cache_data
) = L2cache_data = hbm_data = calls = totalDuration = avgDuration = 0.0
total_flops = valu_flops = mfma_flops_f6f4 = mfma_flops_f8 = (
mfma_flops_bf16
) = mfma_flops_f16 = mfma_iops_i8 = mfma_flops_f32 = mfma_flops_f64 = (
lds_data
) = L1cache_data = L2cache_data = hbm_data = calls = totalDuration = (
avgDuration
) = 0.0
myList.sort(key=lambda x: x.totalDuration, reverse=True)
Двоичный файл не отображается.
Двоичный файл не отображается.
Двоичный файл не отображается.