Enable rocpd output format with rocprofiler sdk (#790)
* Add `rocpd` choice for `--format-rocprof-output` option * Add rocpd_data.py which defines SQL queries to extract data from rocpd database * Use sqlite3 package to read the database * Add `--retain-rocpd-output` option in profile mode to retain raw rocpd database * Add warning notice to say `--format-rocprof-output rocpd` will be default in future release For rocpd output: * Use only `pmc_perf.csv` instead of reading individual coll_level results csv files * Post process csv files using pandas in analysis mode instead of profile mode * Use ACCUM counters instead of SQ_ACCUM_PREV_HIRES * Add test cases for rocpd output format * Fix code formatting issues * Update CHANGELOG
此提交包含在:
@@ -572,6 +572,21 @@ def test_path(binary_handler_profile_rocprof_compute):
|
||||
test_utils.clean_output_dir(config["cleanup"], workload_dir)
|
||||
|
||||
|
||||
@pytest.mark.misc
|
||||
def test_path_rocpd(binary_handler_profile_rocprof_compute):
|
||||
workload_dir = test_utils.get_output_dir()
|
||||
options = ["--format-rocprof-output", "rocpd"]
|
||||
binary_handler_profile_rocprof_compute(config, workload_dir, options)
|
||||
|
||||
assert (Path(workload_dir) / "pmc_perf.csv").exists()
|
||||
assert test_utils.check_file_pattern(
|
||||
"format_rocprof_output: rocpd", f"{workload_dir}/profiling_config.yaml"
|
||||
)
|
||||
assert test_utils.check_file_pattern("Counter_Name", f"{workload_dir}/pmc_perf.csv")
|
||||
|
||||
test_utils.clean_output_dir(config["cleanup"], workload_dir)
|
||||
|
||||
|
||||
@pytest.mark.misc
|
||||
def test_roof_kernel_names(binary_handler_profile_rocprof_compute):
|
||||
if soc in ("MI100"):
|
||||
@@ -711,6 +726,45 @@ def test_roof_file_validation(binary_handler_profile_rocprof_compute):
|
||||
test_utils.clean_output_dir(config["cleanup"], workload_dir)
|
||||
|
||||
|
||||
@pytest.mark.misc
|
||||
def test_roof_rocpd(binary_handler_profile_rocprof_compute):
|
||||
workload_dir = test_utils.get_output_dir()
|
||||
options = ["--device", "0", "--roof-only", "--format-rocprof-output", "rocpd"]
|
||||
binary_handler_profile_rocprof_compute(config, workload_dir, options, roof=True)
|
||||
|
||||
assert (Path(workload_dir) / "pmc_perf.csv").exists()
|
||||
assert (Path(workload_dir) / "roofline.csv").exists()
|
||||
assert test_utils.check_file_pattern(
|
||||
"format_rocprof_output: rocpd", f"{workload_dir}/profiling_config.yaml"
|
||||
)
|
||||
assert test_utils.check_file_pattern("Counter_Name", f"{workload_dir}/pmc_perf.csv")
|
||||
|
||||
test_utils.clean_output_dir(config["cleanup"], workload_dir)
|
||||
|
||||
|
||||
@pytest.mark.misc
|
||||
def test_roofline_kernel_names_validation_error(binary_handler_profile_rocprof_compute):
|
||||
"""
|
||||
Test validate_parameters() error: --roof-only is required for --kernel-names
|
||||
This should trigger console_error("--roof-only is required for --kernel-names")
|
||||
"""
|
||||
if soc in ("MI100"):
|
||||
# roofline is not supported on MI100
|
||||
pytest.skip("Skipping roofline test for MI100")
|
||||
return
|
||||
|
||||
options = ["--device", "0", "--kernel-names"] # missing --roof-only
|
||||
workload_dir = test_utils.get_output_dir()
|
||||
|
||||
returncode = binary_handler_profile_rocprof_compute(
|
||||
config, workload_dir, options, check_success=False, roof=True
|
||||
)
|
||||
|
||||
assert returncode != 0
|
||||
|
||||
test_utils.clean_output_dir(config["cleanup"], workload_dir)
|
||||
|
||||
|
||||
@pytest.mark.misc
|
||||
def test_roofline_workload_dir_not_set_error():
|
||||
"""
|
||||
@@ -1612,7 +1666,7 @@ def test_comprehensive_error_paths():
|
||||
assert result == 16
|
||||
|
||||
try:
|
||||
build_eval_string("test", None)
|
||||
build_eval_string("test", None, config={})
|
||||
assert False, "Should raise exception for None coll_level"
|
||||
except Exception as e:
|
||||
assert "coll_level can not be None" in str(e)
|
||||
|
||||
新增問題並參考
封鎖使用者