2
0

Unified configuration for metrics (#726)

* Show description of metrics during analysis
    * Use --include-cols Description show the Description column in analyze mode (this is hidden by default)
    * Remove tips field from analysis config

* Align metric names in analysis config and documentation

* Add unified config utils/unified_config.yaml

* Add python script utils/split_config.py to auto generate analysis configuration and documentation metrics description
   * Add test case to ensure unified config is older than auto-generated config
   * Auto generate analysis config and documentation metrics description

* Update CONTRIBUTING.md to add instructions to build documentation assets
    * Add docker image and compose file to build documentation

* Update CHANGELOG and Documentation

* Use jinja template instead of hardcoding metric tables in documentation

[ROCm/rocprofiler-compute commit: bb44e90b2d]
Este cometimento está contido em:
vedithal-amd
2025-07-25 14:01:34 -04:00
cometido por GitHub
ascendente dcdadfd37d
cometimento 354fe5f52c
232 ficheiros modificados com 44409 adições e 22480 eliminações
+110
Ver ficheiro
@@ -0,0 +1,110 @@
# AUTOGENERATED FILE. Only edit for testing purposes, not for development. Generated from utils/unified_config.yaml. Generated by utils/split_config.py
src/rocprof_compute_soc/analysis_configs/gfx908/0000_top_stats.yaml: 401770cff804c6e51b78dff61390d8b5977598a2b09c6601ac593653e912535b
src/rocprof_compute_soc/analysis_configs/gfx90a/0000_top_stats.yaml: 401770cff804c6e51b78dff61390d8b5977598a2b09c6601ac593653e912535b
src/rocprof_compute_soc/analysis_configs/gfx940/0000_top_stats.yaml: 401770cff804c6e51b78dff61390d8b5977598a2b09c6601ac593653e912535b
src/rocprof_compute_soc/analysis_configs/gfx941/0000_top_stats.yaml: 401770cff804c6e51b78dff61390d8b5977598a2b09c6601ac593653e912535b
src/rocprof_compute_soc/analysis_configs/gfx942/0000_top_stats.yaml: 401770cff804c6e51b78dff61390d8b5977598a2b09c6601ac593653e912535b
src/rocprof_compute_soc/analysis_configs/gfx950/0000_top_stats.yaml: 401770cff804c6e51b78dff61390d8b5977598a2b09c6601ac593653e912535b
src/rocprof_compute_soc/analysis_configs/gfx908/0100_system_info.yaml: 739e39e69056984c277a69c17a6866effa860f56e8b1d3ea5d625582f16228ef
src/rocprof_compute_soc/analysis_configs/gfx90a/0100_system_info.yaml: 739e39e69056984c277a69c17a6866effa860f56e8b1d3ea5d625582f16228ef
src/rocprof_compute_soc/analysis_configs/gfx940/0100_system_info.yaml: 739e39e69056984c277a69c17a6866effa860f56e8b1d3ea5d625582f16228ef
src/rocprof_compute_soc/analysis_configs/gfx941/0100_system_info.yaml: 739e39e69056984c277a69c17a6866effa860f56e8b1d3ea5d625582f16228ef
src/rocprof_compute_soc/analysis_configs/gfx942/0100_system_info.yaml: 739e39e69056984c277a69c17a6866effa860f56e8b1d3ea5d625582f16228ef
src/rocprof_compute_soc/analysis_configs/gfx950/0100_system_info.yaml: 739e39e69056984c277a69c17a6866effa860f56e8b1d3ea5d625582f16228ef
src/rocprof_compute_soc/analysis_configs/gfx908/0200_system_speed_of_light.yaml: 383f51bf243980df626dacd34c26844b397e4093988524f91e3c7a9a3b8bf063
src/rocprof_compute_soc/analysis_configs/gfx90a/0200_system_speed_of_light.yaml: e9f552ee72849dc9c4ab14fee77ecc2681f4bcf610a8649c55365ab7eea7aafc
src/rocprof_compute_soc/analysis_configs/gfx940/0200_system_speed_of_light.yaml: 70716745e727d3a7e6fa706d34c346f796c241c485516da52e0c694386b3cf57
src/rocprof_compute_soc/analysis_configs/gfx941/0200_system_speed_of_light.yaml: a1d4f1f712755f6369d3a350eadcd5b0fcd90b5c0cab8be691c24bb860d90ba5
src/rocprof_compute_soc/analysis_configs/gfx942/0200_system_speed_of_light.yaml: 70716745e727d3a7e6fa706d34c346f796c241c485516da52e0c694386b3cf57
src/rocprof_compute_soc/analysis_configs/gfx950/0200_system_speed_of_light.yaml: a2cb003c74c0a75b9fe690da4e21b46e78fdb2f3233fc4753bca9276e93d60b0
src/rocprof_compute_soc/analysis_configs/gfx908/0300_memory_chart.yaml: 6e008d397d9f364d6cb5fdd5a7974e4d372654a583d3e30d8bb8796f97b9b211
src/rocprof_compute_soc/analysis_configs/gfx90a/0300_memory_chart.yaml: cbb3c841b1ad8cbb23a071fcc145dedabb5341d36054c188c9f61878632fd664
src/rocprof_compute_soc/analysis_configs/gfx940/0300_memory_chart.yaml: f3c235b5c9ef06c837c04689fc1f413d1137360795ffccfc0256b40769c926c6
src/rocprof_compute_soc/analysis_configs/gfx941/0300_memory_chart.yaml: f3c235b5c9ef06c837c04689fc1f413d1137360795ffccfc0256b40769c926c6
src/rocprof_compute_soc/analysis_configs/gfx942/0300_memory_chart.yaml: f3c235b5c9ef06c837c04689fc1f413d1137360795ffccfc0256b40769c926c6
src/rocprof_compute_soc/analysis_configs/gfx950/0300_memory_chart.yaml: deeb8671c4628aaad3046391975c9c62547460dcf18eb179ef7dc6b2729919e2
src/rocprof_compute_soc/analysis_configs/gfx908/0400_roofline.yaml: 57f95dcd487dfcdf24e1c2d8eb16d14dc3462df83d11a08e7de2b06343b48c3e
src/rocprof_compute_soc/analysis_configs/gfx90a/0400_roofline.yaml: 57f95dcd487dfcdf24e1c2d8eb16d14dc3462df83d11a08e7de2b06343b48c3e
src/rocprof_compute_soc/analysis_configs/gfx940/0400_roofline.yaml: 57f95dcd487dfcdf24e1c2d8eb16d14dc3462df83d11a08e7de2b06343b48c3e
src/rocprof_compute_soc/analysis_configs/gfx941/0400_roofline.yaml: 57f95dcd487dfcdf24e1c2d8eb16d14dc3462df83d11a08e7de2b06343b48c3e
src/rocprof_compute_soc/analysis_configs/gfx942/0400_roofline.yaml: 57f95dcd487dfcdf24e1c2d8eb16d14dc3462df83d11a08e7de2b06343b48c3e
src/rocprof_compute_soc/analysis_configs/gfx950/0400_roofline.yaml: 57f95dcd487dfcdf24e1c2d8eb16d14dc3462df83d11a08e7de2b06343b48c3e
src/rocprof_compute_soc/analysis_configs/gfx908/0500_command_processor_cpc_cpf.yaml: da1c2997d42d66da2aa069caa741cf9eade124357c56e4290333de2f3e0412bb
src/rocprof_compute_soc/analysis_configs/gfx90a/0500_command_processor_cpc_cpf.yaml: da1c2997d42d66da2aa069caa741cf9eade124357c56e4290333de2f3e0412bb
src/rocprof_compute_soc/analysis_configs/gfx940/0500_command_processor_cpc_cpf.yaml: da1c2997d42d66da2aa069caa741cf9eade124357c56e4290333de2f3e0412bb
src/rocprof_compute_soc/analysis_configs/gfx941/0500_command_processor_cpc_cpf.yaml: da1c2997d42d66da2aa069caa741cf9eade124357c56e4290333de2f3e0412bb
src/rocprof_compute_soc/analysis_configs/gfx942/0500_command_processor_cpc_cpf.yaml: da1c2997d42d66da2aa069caa741cf9eade124357c56e4290333de2f3e0412bb
src/rocprof_compute_soc/analysis_configs/gfx950/0500_command_processor_cpc_cpf.yaml: 6eb8acab3abb4183868470a4bd8ee97bf8a426f5faeca46aab0d9000c1700f76
src/rocprof_compute_soc/analysis_configs/gfx908/0600_workgroup_manager_spi.yaml: a866f2dc5e30404a914f0cfa10f73fc2463007ae553c4655b8e47bcdbd76f8ac
src/rocprof_compute_soc/analysis_configs/gfx90a/0600_workgroup_manager_spi.yaml: a866f2dc5e30404a914f0cfa10f73fc2463007ae553c4655b8e47bcdbd76f8ac
src/rocprof_compute_soc/analysis_configs/gfx940/0600_workgroup_manager_spi.yaml: a866f2dc5e30404a914f0cfa10f73fc2463007ae553c4655b8e47bcdbd76f8ac
src/rocprof_compute_soc/analysis_configs/gfx941/0600_workgroup_manager_spi.yaml: a866f2dc5e30404a914f0cfa10f73fc2463007ae553c4655b8e47bcdbd76f8ac
src/rocprof_compute_soc/analysis_configs/gfx942/0600_workgroup_manager_spi.yaml: a866f2dc5e30404a914f0cfa10f73fc2463007ae553c4655b8e47bcdbd76f8ac
src/rocprof_compute_soc/analysis_configs/gfx950/0600_workgroup_manager_spi.yaml: 7fe5d39165fd1100de7f89639cf6b8b1ffdcba46f86063d2040bee3bc14dc032
src/rocprof_compute_soc/analysis_configs/gfx908/0700_wavefront.yaml: 1d22ca4540dbc884ede6d9071e7a2e0a1cd831d4eb2da6f29ad8a582907df848
src/rocprof_compute_soc/analysis_configs/gfx90a/0700_wavefront.yaml: 1d22ca4540dbc884ede6d9071e7a2e0a1cd831d4eb2da6f29ad8a582907df848
src/rocprof_compute_soc/analysis_configs/gfx940/0700_wavefront.yaml: 1d22ca4540dbc884ede6d9071e7a2e0a1cd831d4eb2da6f29ad8a582907df848
src/rocprof_compute_soc/analysis_configs/gfx941/0700_wavefront.yaml: 1d22ca4540dbc884ede6d9071e7a2e0a1cd831d4eb2da6f29ad8a582907df848
src/rocprof_compute_soc/analysis_configs/gfx942/0700_wavefront.yaml: 1d22ca4540dbc884ede6d9071e7a2e0a1cd831d4eb2da6f29ad8a582907df848
src/rocprof_compute_soc/analysis_configs/gfx950/0700_wavefront.yaml: 9ce451e4e9099bb5e43e6e41e5621b469d849f1e4900a74f156337eed95b644d
src/rocprof_compute_soc/analysis_configs/gfx908/1000_compute_units_instruction_mix.yaml: 4f70eb28dad079098fcc97813c59b02dc1bda06ceb5f7806a94b3b26184e47af
src/rocprof_compute_soc/analysis_configs/gfx90a/1000_compute_units_instruction_mix.yaml: 84eee8712ebd101e593598098bd6f9e281b36f116d0f3eba6a415c418dbbb647
src/rocprof_compute_soc/analysis_configs/gfx940/1000_compute_units_instruction_mix.yaml: 7d9ae6b30157645b0461abaf84aa9c793c87ed630a8a6611a34ae043cbcc4c5d
src/rocprof_compute_soc/analysis_configs/gfx941/1000_compute_units_instruction_mix.yaml: 7d9ae6b30157645b0461abaf84aa9c793c87ed630a8a6611a34ae043cbcc4c5d
src/rocprof_compute_soc/analysis_configs/gfx942/1000_compute_units_instruction_mix.yaml: 7d9ae6b30157645b0461abaf84aa9c793c87ed630a8a6611a34ae043cbcc4c5d
src/rocprof_compute_soc/analysis_configs/gfx950/1000_compute_units_instruction_mix.yaml: a34553f977577980312b27005bfcd9c1e4c79f77c0c3dc4e023a17bf86169373
src/rocprof_compute_soc/analysis_configs/gfx908/1100_compute_units_compute_pipeline.yaml: 472d6f872fb9f545940899824f87f88d4f7f7544ae11addd10da08ced0110f49
src/rocprof_compute_soc/analysis_configs/gfx90a/1100_compute_units_compute_pipeline.yaml: 2eeac2474dce7ff3b03650575dd7ce92458db8f70a7958536ada892119d33c69
src/rocprof_compute_soc/analysis_configs/gfx940/1100_compute_units_compute_pipeline.yaml: 4a25b6abf24f4a622fde1a3cfe65fe7236cf1e626fc2444667883997564cea1e
src/rocprof_compute_soc/analysis_configs/gfx941/1100_compute_units_compute_pipeline.yaml: 4a25b6abf24f4a622fde1a3cfe65fe7236cf1e626fc2444667883997564cea1e
src/rocprof_compute_soc/analysis_configs/gfx942/1100_compute_units_compute_pipeline.yaml: 4a25b6abf24f4a622fde1a3cfe65fe7236cf1e626fc2444667883997564cea1e
src/rocprof_compute_soc/analysis_configs/gfx950/1100_compute_units_compute_pipeline.yaml: 4ef656938f8a9667ae872db522855856469accff9cb42bc0444b469346760dfd
src/rocprof_compute_soc/analysis_configs/gfx908/1200_local_data_share_lds.yaml: 80f3ca3ea15de009c5278ea20566d8c08d62e0087971e5f9aeae1c89df1dd898
src/rocprof_compute_soc/analysis_configs/gfx90a/1200_local_data_share_lds.yaml: 80f3ca3ea15de009c5278ea20566d8c08d62e0087971e5f9aeae1c89df1dd898
src/rocprof_compute_soc/analysis_configs/gfx940/1200_local_data_share_lds.yaml: 3bbf3928288990863cfe72fd00a28785fde0a36f103f5381df578aae2eb28be0
src/rocprof_compute_soc/analysis_configs/gfx941/1200_local_data_share_lds.yaml: 3bbf3928288990863cfe72fd00a28785fde0a36f103f5381df578aae2eb28be0
src/rocprof_compute_soc/analysis_configs/gfx942/1200_local_data_share_lds.yaml: 3bbf3928288990863cfe72fd00a28785fde0a36f103f5381df578aae2eb28be0
src/rocprof_compute_soc/analysis_configs/gfx950/1200_local_data_share_lds.yaml: 505163510a3b0132ee487f9e024188de2deb97d0f72e3d729b95f86e7c3434b3
src/rocprof_compute_soc/analysis_configs/gfx908/1300_instruction_cache.yaml: 2437e2f8191675c4116d0da1db291f3ad2715281ea812e9fdd6506cf213e5d1b
src/rocprof_compute_soc/analysis_configs/gfx90a/1300_instruction_cache.yaml: 2437e2f8191675c4116d0da1db291f3ad2715281ea812e9fdd6506cf213e5d1b
src/rocprof_compute_soc/analysis_configs/gfx940/1300_instruction_cache.yaml: 2437e2f8191675c4116d0da1db291f3ad2715281ea812e9fdd6506cf213e5d1b
src/rocprof_compute_soc/analysis_configs/gfx941/1300_instruction_cache.yaml: 2437e2f8191675c4116d0da1db291f3ad2715281ea812e9fdd6506cf213e5d1b
src/rocprof_compute_soc/analysis_configs/gfx942/1300_instruction_cache.yaml: 2437e2f8191675c4116d0da1db291f3ad2715281ea812e9fdd6506cf213e5d1b
src/rocprof_compute_soc/analysis_configs/gfx950/1300_instruction_cache.yaml: 2437e2f8191675c4116d0da1db291f3ad2715281ea812e9fdd6506cf213e5d1b
src/rocprof_compute_soc/analysis_configs/gfx908/1400_scalar_l1_data_cache.yaml: 8871e3b65132321cb3880a48f894d8c3b2c56a3936d382c3c2b02723ed5c8ec5
src/rocprof_compute_soc/analysis_configs/gfx90a/1400_scalar_l1_data_cache.yaml: 8871e3b65132321cb3880a48f894d8c3b2c56a3936d382c3c2b02723ed5c8ec5
src/rocprof_compute_soc/analysis_configs/gfx940/1400_scalar_l1_data_cache.yaml: 8871e3b65132321cb3880a48f894d8c3b2c56a3936d382c3c2b02723ed5c8ec5
src/rocprof_compute_soc/analysis_configs/gfx941/1400_scalar_l1_data_cache.yaml: 8871e3b65132321cb3880a48f894d8c3b2c56a3936d382c3c2b02723ed5c8ec5
src/rocprof_compute_soc/analysis_configs/gfx942/1400_scalar_l1_data_cache.yaml: 8871e3b65132321cb3880a48f894d8c3b2c56a3936d382c3c2b02723ed5c8ec5
src/rocprof_compute_soc/analysis_configs/gfx950/1400_scalar_l1_data_cache.yaml: 8871e3b65132321cb3880a48f894d8c3b2c56a3936d382c3c2b02723ed5c8ec5
src/rocprof_compute_soc/analysis_configs/gfx908/1500_address_processing_unit_and_data_return_path_ta_td.yaml: 231f9b7c09266c4aac50ac4db1b055c36eb6e563ba713c5f3aa30508d03b9170
src/rocprof_compute_soc/analysis_configs/gfx90a/1500_address_processing_unit_and_data_return_path_ta_td.yaml: eb1ec287cc1f9f133b80fdde072a2b86e819f96ccdf4c305e721f3466d37b156
src/rocprof_compute_soc/analysis_configs/gfx940/1500_address_processing_unit_and_data_return_path_ta_td.yaml: 52ae21cec4ce4990e966d7fb438ac02b7e63ad4bc428f9770cd2c08d80f712da
src/rocprof_compute_soc/analysis_configs/gfx941/1500_address_processing_unit_and_data_return_path_ta_td.yaml: 52ae21cec4ce4990e966d7fb438ac02b7e63ad4bc428f9770cd2c08d80f712da
src/rocprof_compute_soc/analysis_configs/gfx942/1500_address_processing_unit_and_data_return_path_ta_td.yaml: 52ae21cec4ce4990e966d7fb438ac02b7e63ad4bc428f9770cd2c08d80f712da
src/rocprof_compute_soc/analysis_configs/gfx950/1500_address_processing_unit_and_data_return_path_ta_td.yaml: f7b032202e1aea6befda0d62e3d9f04b846f473218bd62e90d59a34678b62a77
src/rocprof_compute_soc/analysis_configs/gfx908/1600_vector_l1_data_cache.yaml: e6ec43014ce7b7cc072385d4eba072dd187b5de14979c169a3c1e9b8fc4c2762
src/rocprof_compute_soc/analysis_configs/gfx90a/1600_vector_l1_data_cache.yaml: e6ec43014ce7b7cc072385d4eba072dd187b5de14979c169a3c1e9b8fc4c2762
src/rocprof_compute_soc/analysis_configs/gfx940/1600_vector_l1_data_cache.yaml: 0e53921cc8d87a9adade250b9632fa42d33c825565152e37d6e56f45f83a3a28
src/rocprof_compute_soc/analysis_configs/gfx941/1600_vector_l1_data_cache.yaml: 0e53921cc8d87a9adade250b9632fa42d33c825565152e37d6e56f45f83a3a28
src/rocprof_compute_soc/analysis_configs/gfx942/1600_vector_l1_data_cache.yaml: 0e53921cc8d87a9adade250b9632fa42d33c825565152e37d6e56f45f83a3a28
src/rocprof_compute_soc/analysis_configs/gfx950/1600_vector_l1_data_cache.yaml: cd21327c193d2af8c18066b9c13f67e3d5dfb44731777bc5a1b6a7738c902dd1
src/rocprof_compute_soc/analysis_configs/gfx908/1700_l2_cache.yaml: 6aeda249093c666000b104f8631b4a85698e083dd55e77e1e1f095f222054742
src/rocprof_compute_soc/analysis_configs/gfx90a/1700_l2_cache.yaml: a4ec667e0b827c046de207416d185dd528f030f29bdee162a2634e579bb31846
src/rocprof_compute_soc/analysis_configs/gfx940/1700_l2_cache.yaml: a9ac811e491fce354aef029b11a96edb589535e84224fa2e2b323623e9fd6e00
src/rocprof_compute_soc/analysis_configs/gfx941/1700_l2_cache.yaml: 7d925c3369b366c23e638ca2b3d074672324a5b9fd0fa586a3e71dee458743a6
src/rocprof_compute_soc/analysis_configs/gfx942/1700_l2_cache.yaml: 7532dc55c28c809f435f5edae98632a2d99adc898b2b71a661e2c9696f674f4a
src/rocprof_compute_soc/analysis_configs/gfx950/1700_l2_cache.yaml: a9f3146a99e74eaba5327be3cdf9361fb8b69d1640751fb05519e44dd2ec7292
src/rocprof_compute_soc/analysis_configs/gfx908/1800_l2_cache_per_channel.yaml: a0c53202fe9f68d5e1fa689ce0643c471ced7d47e007d8ccc68fba294f7f6a05
src/rocprof_compute_soc/analysis_configs/gfx90a/1800_l2_cache_per_channel.yaml: a0c53202fe9f68d5e1fa689ce0643c471ced7d47e007d8ccc68fba294f7f6a05
src/rocprof_compute_soc/analysis_configs/gfx940/1800_l2_cache_per_channel.yaml: e184e3692eb0d641fb2e37fada0e58a6c4958553931d7c038b884e1e6986093f
src/rocprof_compute_soc/analysis_configs/gfx941/1800_l2_cache_per_channel.yaml: e184e3692eb0d641fb2e37fada0e58a6c4958553931d7c038b884e1e6986093f
src/rocprof_compute_soc/analysis_configs/gfx942/1800_l2_cache_per_channel.yaml: e184e3692eb0d641fb2e37fada0e58a6c4958553931d7c038b884e1e6986093f
src/rocprof_compute_soc/analysis_configs/gfx950/1800_l2_cache_per_channel.yaml: 896d9af08778c5ecddc6d6961ae96b972a739c913ed9143e3f5fb2f7e878cb5e
src/rocprof_compute_soc/analysis_configs/gfx908/2100_pc_sampling.yaml: 4f3af55040c40bee5f1fd88d83e2324d06e5dc462c0adc3e6d5b19b3f31af5e7
src/rocprof_compute_soc/analysis_configs/gfx90a/2100_pc_sampling.yaml: 4f3af55040c40bee5f1fd88d83e2324d06e5dc462c0adc3e6d5b19b3f31af5e7
src/rocprof_compute_soc/analysis_configs/gfx940/2100_pc_sampling.yaml: 4f3af55040c40bee5f1fd88d83e2324d06e5dc462c0adc3e6d5b19b3f31af5e7
src/rocprof_compute_soc/analysis_configs/gfx941/2100_pc_sampling.yaml: 4f3af55040c40bee5f1fd88d83e2324d06e5dc462c0adc3e6d5b19b3f31af5e7
src/rocprof_compute_soc/analysis_configs/gfx942/2100_pc_sampling.yaml: 4f3af55040c40bee5f1fd88d83e2324d06e5dc462c0adc3e6d5b19b3f31af5e7
src/rocprof_compute_soc/analysis_configs/gfx950/2100_pc_sampling.yaml: 4f3af55040c40bee5f1fd88d83e2324d06e5dc462c0adc3e6d5b19b3f31af5e7
docs/data/metrics_description.yaml: 69bd9c4121e13bdda6af2dead3129a46569f37fd1c59b20f45c85593824522d2
+160
Ver ficheiro
@@ -0,0 +1,160 @@
# NOTES
#
# Read utils/unified_config.yaml and split it into per gfx architecture per panel config files
# WARNING: This script will overwrite existing files under per gfx architecture folders under src/rocprof_compute_soc/analysis_configs
#
# Read utils/unified_config.yaml and split it into metric tables per documentation section
# WARNING: This script will overwrite existing docs/data/metrics_description.yaml
import hashlib
import re
import copy
from pathlib import Path
import yaml
# Get root directory of the project
ROOT_DIR = Path(__file__).parent.parent
SOURCE_DIR = ROOT_DIR.joinpath("utils")
TARGET_DIR = ROOT_DIR.joinpath("src", "rocprof_compute_soc", "analysis_configs")
DOC_TARGET_DIR = ROOT_DIR.joinpath("docs", "data")
AUTOGEN_TEXT = "# AUTOGENERATED FILE. Only edit for testing purposes, not for development. Generated from utils/unified_config.yaml. Generated by utils/split_config.py\n"
HASH_FILE = ROOT_DIR.joinpath("utils", "autogen_hash.yaml")
HASH_FILE_MAP = {}
GFX_VERSIONS = ["gfx908", "gfx90a", "gfx940", "gfx941", "gfx942", "gfx950"]
def update_analysis_config():
# Read the unified config file
with open(SOURCE_DIR.joinpath("unified_config.yaml")) as file:
unified_config = yaml.safe_load(file)
# Create per panel config file
for panel_config in unified_config["panels"]:
new_panel_config = {"Panel Config": {}}
new_panel_config["Panel Config"]["id"] = panel_config["id"]
new_panel_config["Panel Config"]["title"] = panel_config["title"]
new_panel_config["Panel Config"]["metrics_description"] = {key: value["plain"] for key, value in panel_config.get("metrics_description", {}).items()}
# Convert int into str with 4 digits
panel_id = str(panel_config["id"]).zfill(4)
# Replace parentehsis, hyphen, slash and space with underscore
# Remove duplicate underscore
# Convert to lower case
panel_title = re.sub(r"[()\-/ ]+", "_", panel_config["title"])
panel_title = "_".join(filter(None, panel_title.split("_")))
panel_title = panel_title.lower()
for gfx_version in GFX_VERSIONS:
# Create per gfx architecture folder
gfx_dir = TARGET_DIR.joinpath(gfx_version)
# Create directory if it doesn't exist
if not gfx_dir.exists():
gfx_dir.mkdir()
print(f"Created directory: {gfx_dir}")
# Select metrics from current gfx arch
new_panel_config["Panel Config"]["data source"] = []
for data_source_config in panel_config["data source"]:
data_source_config = copy.deepcopy(data_source_config)
if "metric_table" in data_source_config:
data_source_config["metric_table"]["metric"] = data_source_config["metric_table"]["metric"][gfx_version]
new_panel_config["Panel Config"]["data source"].append(data_source_config)
# Write panel config to file
filename = Path(
TARGET_DIR.joinpath(gfx_version, f"{panel_id}_{panel_title}.yaml")
)
with open(filename, "w") as file:
file.write(AUTOGEN_TEXT)
yaml.dump(new_panel_config, file, sort_keys=False)
print(f"File write: {filename}")
# Calculate hash of filename
HASH_FILE_MAP[str(filename.relative_to(ROOT_DIR))] = hashlib.sha256(
filename.read_bytes()
).hexdigest()
def update_documentation():
# Documentation sections
section_panel_map = {
"Wavefront launch stats": 701,
"Wavefront runtime stats": 702,
"Overall instruction mix": 1001,
"VALU arithmetic instruction mix": 1002,
"MFMA instruction mix": 1004,
"Compute Speed-of-Light": 1101,
"Pipeline statistics": 1102,
"Arithmetic operations": 1103,
"LDS Speed-of-Light": 1201,
"LDS Statistics": 1202,
"vL1D Speed-of-Light": 1601,
"Busy / stall metrics": 1501,
"Instruction counts": 1502,
"Spill / stack metrics": 1503,
"L1 Unified Translation Cache (UTCL1)": 1605,
"vL1D cache stall metrics": 1602,
"vL1D cache access metrics": 1603,
"Vector L1 data-return path or Texture Data (TD)": 1504,
"L2 Speed-of-Light": 1701,
"L2 cache accesses": 1703,
"L2-Fabric interface metrics": 1702,
"L2 - Fabric interface detailed metrics": 1706,
"L2 - Fabric Interface stalls": 1705,
"Scalar L1D Speed-of-Light": 1401,
"Scalar L1D cache accesses": 1402,
"Scalar L1D Cache - L2 Interface": 1403,
"L1I Speed-of-Light": 1301,
"L1I cache accesses": 1302,
"L1I <-> L2 interface": 1303,
"Workgroup manager utilizations": 601,
"Workgroup Manager - Resource Allocation": 602,
"Command processor fetcher (CPF)": 501,
"Command processor packet processor (CPC)": 502,
"System Speed-of-Light": 201,
}
# Read the unified config file
with open(SOURCE_DIR.joinpath("unified_config.yaml")) as file:
unified_config = yaml.safe_load(file)
panel_metric_map = {}
for panel_config in unified_config["panels"]:
for data_source in panel_config["data source"]:
if "metric_table" in data_source:
metrics_info = {}
for key in panel_config["metrics_description"]:
metrics_info[key] = {
"rst": panel_config["metrics_description"][key]["rst"],
"unit": panel_config["metrics_description"][key]["unit"],
}
panel_metric_map[data_source["metric_table"]["id"]] = metrics_info
# Merge panel_metric_map with section_panel_map
section_metric_map = {}
for section, panel_id in section_panel_map.items():
if panel_id in panel_metric_map:
section_metric_map[section] = panel_metric_map[panel_id]
# Write documentation metrics description file
filename = Path(DOC_TARGET_DIR.joinpath("metrics_description.yaml"))
with open(filename, "w") as file:
file.write(AUTOGEN_TEXT)
yaml.dump(section_metric_map, file, sort_keys=False)
print(f"File write: {filename}")
# Calculate hash of filename
HASH_FILE_MAP[str(filename.relative_to(ROOT_DIR))] = hashlib.sha256(
filename.read_bytes()
).hexdigest()
def update_hash():
# Write hash file
with open(HASH_FILE, "w") as file:
file.write(AUTOGEN_TEXT)
yaml.dump(HASH_FILE_MAP, file, sort_keys=False)
print(f"File write: {HASH_FILE}")
if __name__ == "__main__":
update_analysis_config()
update_documentation()
update_hash()
A apresentação das diferenças no ficheiro foi suprimida por ser demasiado grande Carregar diff