Skip to content

Commit 48c9904

Browse files
Disable MIOpen for fp8 configs in perfRunner (#1817)
Avoid invoking MIOpenDriver with unsupported types.
1 parent bb38761 commit 48c9904

1 file changed

Lines changed: 11 additions & 2 deletions

File tree

mlir/utils/performance/perfRunner.py

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -480,7 +480,7 @@ def get_conv_configurations(filename, arch, num_cu, num_chiplets):
480480

481481
# Skip unsupported datatypes
482482
if datatype == 'convfp8':
483-
unsupported_chips = {'gfx908', 'gfx90a', 'gfx942', 'gfx1030', 'gfx1101'}
483+
unsupported_chips = {'gfx908', 'gfx90a', 'gfx1030', 'gfx1101'}
484484
if get_chip() in unsupported_chips:
485485
continue
486486

@@ -526,6 +526,9 @@ class ConvConfiguration(PerfConfiguration):
526526
TABLE_COLUMNS = reportUtils.CONV_TEST_PARAMETERS + ['LDSBankConflict'] + ['TFlops']
527527
EXTERNAL_NAME = "MIOpen"
528528

529+
# MIOpenDriver only supports these conv datatypes as base arguments.
530+
MIOPEN_SUPPORTED_DTYPES = {'f32', 'f16', 'bf16', 'i8'}
531+
529532
def compute_tflops(self, ns):
530533
# NaN will propagate as expected
531534
# Repeats are handled by the fact that we're using avarageNs
@@ -741,6 +744,9 @@ def benchmark_external(cls, commandline, paths: Paths, arch, num_cu, num_chiplet
741744
if os.path.exists(get_profiler_output_path(arch, BENCHMARKING_METRICS_FILE_NAME)):
742745
os.remove(get_profiler_output_path(arch, BENCHMARKING_METRICS_FILE_NAME))
743746
config = cls.from_command_line(commandline, arch, num_cu, num_chiplets)
747+
if config.datatype not in cls.MIOPEN_SUPPORTED_DTYPES:
748+
print(f"Skipping MIOpen benchmark for unsupported datatype: {config.datatype}")
749+
return config.table_entry(np.nan)
744750
miopen_driver_cmd = [MIOPENDRIVER, *commandline, '-V', '0', '-t', '1']
745751
print("Running MIOpen Benchmark: ", ' '.join(commandline))
746752
# invoke MIOpenDriver.
@@ -790,7 +796,7 @@ def get_gemm_configurations(filename,
790796
continue
791797

792798
if datatype == 'fp8':
793-
unsupported_chips = {'gfx908', 'gfx90a', 'gfx942', 'gfx1030', 'gfx1101'}
799+
unsupported_chips = {'gfx908', 'gfx90a', 'gfx1030', 'gfx1101'}
794800
if get_chip() in unsupported_chips:
795801
continue
796802

@@ -2251,6 +2257,9 @@ def tune_mlir_kernels(configs, arch, num_cu, num_chiplets):
22512257
envs['MIOPEN_DEBUG_FIND_ONLY_SOLVER'] = solver_names[test_vector]
22522258
commandline = test_vector.split(sep=' ')
22532259
config = ConvConfiguration.from_command_line(commandline, arch, num_cu, num_chiplets)
2260+
if config.datatype not in ConvConfiguration.MIOPEN_SUPPORTED_DTYPES:
2261+
print(f"Skipping MIOpen tuning for unsupported datatype: {config.datatype}")
2262+
continue
22542263
if config.input_layout == 'nchw':
22552264
miopen_driver_cmd = [MIOPENDRIVER, *commandline, '-V', '0']
22562265
print(' '.join(miopen_driver_cmd))

0 commit comments

Comments
 (0)