diff --git a/CHANGELOG.md b/CHANGELOG.md index 60d1fd0528..84b52a5cbc 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,8 @@ Full documentation for ROCm Compute Profiler is available at [https://rocm.docs. ### Added +* Add support to be able to acquire from rocprofv3 every single channle on each XCD of TCC counters + * Add Docker files to package the application and dependencies into a single portable and executable standalone binary file * Analysis report based filtering @@ -45,6 +47,7 @@ Full documentation for ROCm Compute Profiler is available at [https://rocm.docs. ### Changed +* Change the rocprof version for unit tests to rocprofv3 on all SoCs except MI100 * Change normal_unit default to per_kernel * Change dependency from rocm-smi to amd-smi * Decrease profiling time by not collecting counters not used in post analysis diff --git a/tests/test_profile_general.py b/tests/test_profile_general.py index 55c5e3c5bc..944204d1d8 100644 --- a/tests/test_profile_general.py +++ b/tests/test_profile_general.py @@ -322,12 +322,17 @@ def gpu_soc(): soc = gpu_soc() # Set rocprofv2 as profiler if MI300 -if "MI300" in soc: - os.environ["ROCPROF"] = "rocprofv2" +if soc == "MI100": + os.environ["ROCPROF"] = "rocprof" -if "MI350" in soc: +else: os.environ["ROCPROF"] = "rocprofv3" + +def using_v3(): + return "ROCPROF" in os.environ.keys() and os.environ["ROCPROF"].endswith("rocprofv3") + + Baseline_dir = str(Path("tests/workloads/vcopy/" + soc).resolve()) @@ -513,9 +518,17 @@ def test_path(binary_handler_profile_rocprof_compute): if soc == "MI100": assert sorted(list(file_dict.keys())) == ALL_CSVS_MI100 elif soc == "MI200": - assert sorted(list(file_dict.keys())) == sorted(ALL_CSVS_MI200) + assert sorted(list(file_dict.keys())) == sorted( + [f for f in ALL_CSVS_MI200 if f != "timestamps.csv"] + if using_v3() + else ALL_CSVS_MI200 + ) elif "MI300" in soc: - assert sorted(list(file_dict.keys())) == sorted(ALL_CSVS_MI300) + assert sorted(list(file_dict.keys())) == sorted( + [f for f in ALL_CSVS_MI300 if f != "timestamps.csv"] + if using_v3() + else ALL_CSVS_MI300 + ) elif "MI350" in soc: assert sorted(list(file_dict.keys())) == sorted(ALL_CSVS_MI350) else: @@ -546,7 +559,12 @@ def test_roof_kernel_names(binary_handler_profile_rocprof_compute): file_dict = test_utils.check_csv_files(workload_dir, 1, num_kernels) if soc == "MI200" in soc or "MI300" in soc: assert sorted(list(file_dict.keys())) == sorted( - ROOF_ONLY_FILES + ["kernelName_legend.pdf"] + ( + [f for f in ROOF_ONLY_FILES if f != "timestamps.csv"] + if using_v3() + else ROOF_ONLY_FILES + ) + + ["kernelName_legend.pdf"] ) else: assert sorted(list(file_dict.keys())) == ALL_CSVS_MI100 @@ -570,9 +588,17 @@ def test_device_filter(binary_handler_profile_rocprof_compute): if soc == "MI100": assert sorted(list(file_dict.keys())) == ALL_CSVS_MI100 elif soc == "MI200": - assert sorted(list(file_dict.keys())) == sorted(ALL_CSVS_MI200) + assert sorted(list(file_dict.keys())) == sorted( + [f for f in ALL_CSVS_MI200 if f != "timestamps.csv"] + if using_v3() + else ALL_CSVS_MI200 + ) elif "MI300" in soc: - assert sorted(list(file_dict.keys())) == sorted(ALL_CSVS_MI300) + assert sorted(list(file_dict.keys())) == sorted( + [f for f in ALL_CSVS_MI300 if f != "timestamps.csv"] + if using_v3() + else ALL_CSVS_MI300 + ) elif "MI350" in soc: assert sorted(list(file_dict.keys())) == sorted(ALL_CSVS_MI350) else: @@ -600,9 +626,17 @@ def test_kernel(binary_handler_profile_rocprof_compute): if soc == "MI100": assert sorted(list(file_dict.keys())) == ALL_CSVS_MI100 elif soc == "MI200": - assert sorted(list(file_dict.keys())) == sorted(ALL_CSVS_MI200) + assert sorted(list(file_dict.keys())) == sorted( + [f for f in ALL_CSVS_MI200 if f != "timestamps.csv"] + if using_v3() + else ALL_CSVS_MI200 + ) elif "MI300" in soc: - assert sorted(list(file_dict.keys())) == sorted(ALL_CSVS_MI300) + assert sorted(list(file_dict.keys())) == sorted( + [f for f in ALL_CSVS_MI300 if f != "timestamps.csv"] + if using_v3() + else ALL_CSVS_MI300 + ) elif "MI350" in soc: assert sorted(list(file_dict.keys())) == sorted(ALL_CSVS_MI350) else: @@ -656,6 +690,25 @@ def test_block_SQ(binary_handler_profile_rocprof_compute): "sysinfo.csv", "timestamps.csv", ] + + if using_v3(): + expected_csvs = [ + "SQ_IFETCH_LEVEL.csv", + "SQ_INST_LEVEL_LDS.csv", + "SQ_INST_LEVEL_SMEM.csv", + "SQ_INST_LEVEL_VMEM.csv", + "SQ_LEVEL_WAVES.csv", + "pmc_perf.csv", + "pmc_perf_0.csv", + "pmc_perf_1.csv", + "pmc_perf_2.csv", + "pmc_perf_3.csv", + "pmc_perf_4.csv", + "pmc_perf_5.csv", + "pmc_perf_6.csv", + "sysinfo.csv", + ] + if soc == "MI350": expected_csvs = [ "SQ_IFETCH_LEVEL.csv", @@ -701,7 +754,7 @@ def test_block_SQC(binary_handler_profile_rocprof_compute): "sysinfo.csv", "timestamps.csv", ] - if soc == "MI350": + if using_v3() or soc == "MI350": expected_csvs.remove("timestamps.csv") assert sorted(list(file_dict.keys())) == sorted(expected_csvs) @@ -735,7 +788,7 @@ def test_block_TA(binary_handler_profile_rocprof_compute): "sysinfo.csv", "timestamps.csv", ] - if soc == "MI350": + if using_v3() or soc == "MI350": expected_csvs.remove("timestamps.csv") assert sorted(list(file_dict.keys())) == sorted(expected_csvs) @@ -774,6 +827,15 @@ def test_block_TD(binary_handler_profile_rocprof_compute): "sysinfo.csv", "timestamps.csv", ] + if using_v3(): + expected_csvs = [ + "pmc_perf.csv", + "pmc_perf_0.csv", + "pmc_perf_1.csv", + "pmc_perf_2.csv", + "pmc_perf_3.csv", + "sysinfo.csv", + ] if soc == "MI350": expected_csvs = [ "pmc_perf.csv", @@ -817,6 +879,21 @@ def test_block_TCP(binary_handler_profile_rocprof_compute): "timestamps.csv", ] + if using_v3(): + expected_csvs = [ + "pmc_perf.csv", + "pmc_perf_0.csv", + "pmc_perf_1.csv", + "pmc_perf_2.csv", + "pmc_perf_3.csv", + "pmc_perf_4.csv", + "pmc_perf_5.csv", + "pmc_perf_6.csv", + "pmc_perf_7.csv", + "pmc_perf_8.csv", + "sysinfo.csv", + ] + if soc == "MI100" or soc == "MI200": expected_csvs = [ "pmc_perf.csv", @@ -833,6 +910,23 @@ def test_block_TCP(binary_handler_profile_rocprof_compute): "sysinfo.csv", "timestamps.csv", ] + + if using_v3(): + expected_csvs = [ + "pmc_perf.csv", + "pmc_perf_0.csv", + "pmc_perf_1.csv", + "pmc_perf_2.csv", + "pmc_perf_3.csv", + "pmc_perf_4.csv", + "pmc_perf_5.csv", + "pmc_perf_6.csv", + "pmc_perf_7.csv", + "pmc_perf_8.csv", + "pmc_perf_9.csv", + "sysinfo.csv", + ] + if soc == "MI350": expected_csvs.remove("timestamps.csv") @@ -872,6 +966,24 @@ def test_block_TCC(binary_handler_profile_rocprof_compute): "timestamps.csv", ] + if using_v3(): + expected_csvs = [ + "pmc_perf.csv", + "pmc_perf_0.csv", + "pmc_perf_1.csv", + "pmc_perf_2.csv", + "pmc_perf_3.csv", + "pmc_perf_4.csv", + "pmc_perf_5.csv", + "pmc_perf_6.csv", + "pmc_perf_7.csv", + "pmc_perf_8.csv", + "pmc_perf_9.csv", + "pmc_perf_10.csv", + "pmc_perf_11.csv", + "sysinfo.csv", + ] + if soc == "MI100" or soc == "MI200": expected_csvs = [ "pmc_perf.csv", @@ -889,6 +1001,24 @@ def test_block_TCC(binary_handler_profile_rocprof_compute): "sysinfo.csv", "timestamps.csv", ] + + if using_v3(): + expected_csvs = [ + "pmc_perf.csv", + "pmc_perf_0.csv", + "pmc_perf_1.csv", + "pmc_perf_2.csv", + "pmc_perf_3.csv", + "pmc_perf_4.csv", + "pmc_perf_5.csv", + "pmc_perf_6.csv", + "pmc_perf_7.csv", + "pmc_perf_8.csv", + "pmc_perf_9.csv", + "pmc_perf_10.csv", + "sysinfo.csv", + ] + if soc == "MI350": expected_csvs.remove("timestamps.csv") @@ -923,6 +1053,21 @@ def test_block_SPI(binary_handler_profile_rocprof_compute): "sysinfo.csv", "timestamps.csv", ] + + if using_v3(): + expected_csvs = [ + "pmc_perf.csv", + "pmc_perf_0.csv", + "pmc_perf_1.csv", + "pmc_perf_2.csv", + "pmc_perf_3.csv", + "pmc_perf_4.csv", + "pmc_perf_5.csv", + "pmc_perf_6.csv", + "pmc_perf_7.csv", + "sysinfo.csv", + ] + if soc == "MI350": expected_csvs = [ "pmc_perf.csv", @@ -969,6 +1114,18 @@ def test_block_CPC(binary_handler_profile_rocprof_compute): "sysinfo.csv", "timestamps.csv", ] + + if using_v3(): + expected_csvs = [ + "pmc_perf.csv", + "pmc_perf_0.csv", + "pmc_perf_1.csv", + "pmc_perf_2.csv", + "pmc_perf_3.csv", + "pmc_perf_4.csv", + "sysinfo.csv", + ] + if soc == "MI350": expected_csvs = [ "pmc_perf.csv", @@ -1006,7 +1163,7 @@ def test_block_CPF(binary_handler_profile_rocprof_compute): "sysinfo.csv", "timestamps.csv", ] - if soc == "MI350": + if using_v3() or soc == "MI350": expected_csvs.remove("timestamps.csv") assert sorted(list(file_dict.keys())) == sorted(expected_csvs) @@ -1057,6 +1214,25 @@ def test_block_SQ_CPC(binary_handler_profile_rocprof_compute): "sysinfo.csv", "timestamps.csv", ] + + if using_v3(): + expected_csvs = [ + "SQ_IFETCH_LEVEL.csv", + "SQ_INST_LEVEL_LDS.csv", + "SQ_INST_LEVEL_SMEM.csv", + "SQ_INST_LEVEL_VMEM.csv", + "SQ_LEVEL_WAVES.csv", + "pmc_perf.csv", + "pmc_perf_0.csv", + "pmc_perf_1.csv", + "pmc_perf_2.csv", + "pmc_perf_3.csv", + "pmc_perf_4.csv", + "pmc_perf_5.csv", + "pmc_perf_6.csv", + "sysinfo.csv", + ] + if soc == "MI350": expected_csvs = [ "SQ_IFETCH_LEVEL.csv", @@ -1125,6 +1301,25 @@ def test_block_SQ_TA(binary_handler_profile_rocprof_compute): "sysinfo.csv", "timestamps.csv", ] + + if using_v3(): + expected_csvs = [ + "SQ_IFETCH_LEVEL.csv", + "SQ_INST_LEVEL_LDS.csv", + "SQ_INST_LEVEL_SMEM.csv", + "SQ_INST_LEVEL_VMEM.csv", + "SQ_LEVEL_WAVES.csv", + "pmc_perf.csv", + "pmc_perf_0.csv", + "pmc_perf_1.csv", + "pmc_perf_2.csv", + "pmc_perf_3.csv", + "pmc_perf_4.csv", + "pmc_perf_5.csv", + "pmc_perf_6.csv", + "sysinfo.csv", + ] + if soc == "MI350": expected_csvs = [ "SQ_IFETCH_LEVEL.csv", @@ -1189,6 +1384,25 @@ def test_block_SQ_SPI(binary_handler_profile_rocprof_compute): "sysinfo.csv", "timestamps.csv", ] + + if using_v3(): + expected_csvs = [ + "SQ_IFETCH_LEVEL.csv", + "SQ_INST_LEVEL_LDS.csv", + "SQ_INST_LEVEL_SMEM.csv", + "SQ_INST_LEVEL_VMEM.csv", + "SQ_LEVEL_WAVES.csv", + "pmc_perf.csv", + "pmc_perf_0.csv", + "pmc_perf_1.csv", + "pmc_perf_2.csv", + "pmc_perf_3.csv", + "pmc_perf_4.csv", + "pmc_perf_5.csv", + "pmc_perf_6.csv", + "sysinfo.csv", + ] + if soc == "MI350": expected_csvs = [ "SQ_IFETCH_LEVEL.csv", @@ -1258,6 +1472,25 @@ def test_block_SQ_SQC_TCP_CPC(binary_handler_profile_rocprof_compute): "sysinfo.csv", "timestamps.csv", ] + + if using_v3(): + expected_csvs = [ + "SQ_IFETCH_LEVEL.csv", + "SQ_INST_LEVEL_LDS.csv", + "SQ_INST_LEVEL_SMEM.csv", + "SQ_INST_LEVEL_VMEM.csv", + "SQ_LEVEL_WAVES.csv", + "pmc_perf.csv", + "pmc_perf_0.csv", + "pmc_perf_1.csv", + "pmc_perf_2.csv", + "pmc_perf_3.csv", + "pmc_perf_4.csv", + "pmc_perf_5.csv", + "pmc_perf_6.csv", + "sysinfo.csv", + ] + if soc == "MI350": expected_csvs = [ "SQ_IFETCH_LEVEL.csv", @@ -1341,6 +1574,25 @@ def test_block_SQ_SPI_TA_TCC_CPF(binary_handler_profile_rocprof_compute): "sysinfo.csv", "timestamps.csv", ] + + if using_v3(): + expected_csvs = [ + "SQ_IFETCH_LEVEL.csv", + "SQ_INST_LEVEL_LDS.csv", + "SQ_INST_LEVEL_SMEM.csv", + "SQ_INST_LEVEL_VMEM.csv", + "SQ_LEVEL_WAVES.csv", + "pmc_perf.csv", + "pmc_perf_0.csv", + "pmc_perf_1.csv", + "pmc_perf_2.csv", + "pmc_perf_3.csv", + "pmc_perf_4.csv", + "pmc_perf_5.csv", + "pmc_perf_6.csv", + "sysinfo.csv", + ] + if soc == "MI350": expected_csvs = [ "SQ_IFETCH_LEVEL.csv", @@ -1381,9 +1633,17 @@ def test_dispatch_0(binary_handler_profile_rocprof_compute): if soc == "MI100": assert sorted(list(file_dict.keys())) == ALL_CSVS_MI100 elif soc == "MI200": - assert sorted(list(file_dict.keys())) == ALL_CSVS_MI200 + assert sorted(list(file_dict.keys())) == sorted( + [f for f in ALL_CSVS_MI200 if f != "timestamps.csv"] + if using_v3() + else ALL_CSVS_MI200 + ) elif "MI300" in soc: - assert sorted(list(file_dict.keys())) == ALL_CSVS_MI300 + assert sorted(list(file_dict.keys())) == sorted( + [f for f in ALL_CSVS_MI300 if f != "timestamps.csv"] + if using_v3() + else ALL_CSVS_MI300 + ) elif "MI350" in soc: assert sorted(list(file_dict.keys())) == sorted(ALL_CSVS_MI350) else: @@ -1413,9 +1673,17 @@ def test_dispatch_0_1(binary_handler_profile_rocprof_compute): if soc == "MI100": assert sorted(list(file_dict.keys())) == ALL_CSVS_MI100 elif soc == "MI200": - assert sorted(list(file_dict.keys())) == ALL_CSVS_MI200 + assert sorted(list(file_dict.keys())) == sorted( + [f for f in ALL_CSVS_MI200 if f != "timestamps.csv"] + if using_v3() + else ALL_CSVS_MI200 + ) elif "MI300" in soc: - assert sorted(list(file_dict.keys())) == ALL_CSVS_MI300 + assert sorted(list(file_dict.keys())) == sorted( + [f for f in ALL_CSVS_MI300 if f != "timestamps.csv"] + if using_v3() + else ALL_CSVS_MI300 + ) elif "MI350" in soc: assert sorted(list(file_dict.keys())) == sorted(ALL_CSVS_MI350) else: @@ -1442,9 +1710,17 @@ def test_dispatch_2(binary_handler_profile_rocprof_compute): if soc == "MI100": assert sorted(list(file_dict.keys())) == ALL_CSVS_MI100 elif soc == "MI200": - assert sorted(list(file_dict.keys())) == ALL_CSVS_MI200 + assert sorted(list(file_dict.keys())) == sorted( + [f for f in ALL_CSVS_MI200 if f != "timestamps.csv"] + if using_v3() + else ALL_CSVS_MI200 + ) elif "MI300" in soc: - assert sorted(list(file_dict.keys())) == ALL_CSVS_MI300 + assert sorted(list(file_dict.keys())) == sorted( + [f for f in ALL_CSVS_MI300 if f != "timestamps.csv"] + if using_v3() + else ALL_CSVS_MI300 + ) elif "MI350" in soc: assert sorted(list(file_dict.keys())) == sorted(ALL_CSVS_MI350) else: @@ -1474,9 +1750,17 @@ def test_join_type_grid(binary_handler_profile_rocprof_compute): if soc == "MI100": assert sorted(list(file_dict.keys())) == ALL_CSVS_MI100 elif soc == "MI200": - assert sorted(list(file_dict.keys())) == ALL_CSVS_MI200 + assert sorted(list(file_dict.keys())) == sorted( + [f for f in ALL_CSVS_MI200 if f != "timestamps.csv"] + if using_v3() + else ALL_CSVS_MI200 + ) elif "MI300" in soc: - assert sorted(list(file_dict.keys())) == ALL_CSVS_MI300 + assert sorted(list(file_dict.keys())) == sorted( + [f for f in ALL_CSVS_MI300 if f != "timestamps.csv"] + if using_v3() + else ALL_CSVS_MI300 + ) elif "MI350" in soc: assert sorted(list(file_dict.keys())) == sorted(ALL_CSVS_MI350) else: @@ -1503,9 +1787,17 @@ def test_join_type_kernel(binary_handler_profile_rocprof_compute): if soc == "MI100": assert sorted(list(file_dict.keys())) == ALL_CSVS_MI100 elif soc == "MI200": - assert sorted(list(file_dict.keys())) == ALL_CSVS_MI200 + assert sorted(list(file_dict.keys())) == sorted( + [f for f in ALL_CSVS_MI200 if f != "timestamps.csv"] + if using_v3() + else ALL_CSVS_MI200 + ) elif "MI300" in soc: - assert sorted(list(file_dict.keys())) == ALL_CSVS_MI300 + assert sorted(list(file_dict.keys())) == sorted( + [f for f in ALL_CSVS_MI300 if f != "timestamps.csv"] + if using_v3() + else ALL_CSVS_MI300 + ) elif "MI350" in soc: assert sorted(list(file_dict.keys())) == sorted(ALL_CSVS_MI350) else: @@ -1540,7 +1832,12 @@ def test_roof_sort_dispatches(binary_handler_profile_rocprof_compute): assert returncode == 0 file_dict = test_utils.check_csv_files(workload_dir, 1, num_kernels) - assert sorted(list(file_dict.keys())) == ROOF_ONLY_FILES + assert ( + sorted(list(file_dict.keys())) + == [f for f in ROOF_ONLY_FILES if f != "timestamps.csv"] + if using_v3() + else ROOF_ONLY_FILES + ) validate( inspect.stack()[0][3], @@ -1570,7 +1867,12 @@ def test_roof_sort_kernels(binary_handler_profile_rocprof_compute): assert returncode == 0 file_dict = test_utils.check_csv_files(workload_dir, 1, num_kernels) - assert sorted(list(file_dict.keys())) == ROOF_ONLY_FILES + assert ( + sorted(list(file_dict.keys())) + == [f for f in ROOF_ONLY_FILES if f != "timestamps.csv"] + if using_v3() + else ROOF_ONLY_FILES + ) validate( inspect.stack()[0][3], @@ -1600,7 +1902,12 @@ def test_roof_mem_levels_vL1D(binary_handler_profile_rocprof_compute): assert returncode == 0 file_dict = test_utils.check_csv_files(workload_dir, 1, num_kernels) - assert sorted(list(file_dict.keys())) == ROOF_ONLY_FILES + assert ( + sorted(list(file_dict.keys())) + == [f for f in ROOF_ONLY_FILES if f != "timestamps.csv"] + if using_v3() + else ROOF_ONLY_FILES + ) validate( inspect.stack()[0][3], @@ -1630,7 +1937,12 @@ def test_roof_mem_levels_LDS(binary_handler_profile_rocprof_compute): assert returncode == 0 file_dict = test_utils.check_csv_files(workload_dir, 1, num_kernels) - assert sorted(list(file_dict.keys())) == ROOF_ONLY_FILES + assert ( + sorted(list(file_dict.keys())) + == [f for f in ROOF_ONLY_FILES if f != "timestamps.csv"] + if using_v3() + else ROOF_ONLY_FILES + ) validate( inspect.stack()[0][3],