From 48cc7855d52e0024071447aa061c65c6fa204fcd Mon Sep 17 00:00:00 2001 From: Christophe Paquot Date: Tue, 22 Jun 2021 21:12:08 -0700 Subject: [PATCH 1/6] SWDEV-282961: dependency arrows missing When building the json data flow, from_us_list has (timestamp, stream_id, thread_id). stream_id used to be interpreted as from_tid and tid as to_tid. But that's not correct. stream_id is always a destination and tid is the initiator (source). Change-Id: I2f5bb86a387b4003b17271c90bdf9de4b59a79bf --- bin/sqlitedb.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/bin/sqlitedb.py b/bin/sqlitedb.py index dc5358ff..00a7dba2 100644 --- a/bin/sqlitedb.py +++ b/bin/sqlitedb.py @@ -159,11 +159,11 @@ def flow_json(self, base_id, from_pid, from_us_list, to_pid, to_us_dict, corr_id for ind in range(len(from_us_list)): corr_id = corr_id_list[ind] if (len(corr_id_list) != 0) else ind if corr_id in to_us_dict: - (from_ts, from_tid, to_tid) = from_us_list[ind] + (from_ts, stream_id, tid) = from_us_list[ind] to_ts = to_us_dict[corr_id] if from_ts > to_ts: from_ts = to_ts - fd.write(',{"ts":%d,"ph":"s","cat":"DataFlow","id":%d,"pid":%d,"tid":%d,"name":"dep"}\n' % (from_ts, dep_id, from_pid, from_tid)) - fd.write(',{"ts":%d,"ph":"t","cat":"DataFlow","id":%d,"pid":%d,"tid":%d,"name":"dep"}\n' % (to_ts, dep_id, to_pid, to_tid)) + fd.write(',{"ts":%d,"ph":"s","cat":"DataFlow","id":%d,"pid":%d,"tid":%d,"name":"dep"}\n' % (from_ts, dep_id, from_pid, tid)) + fd.write(',{"ts":%d,"ph":"t","cat":"DataFlow","id":%d,"pid":%d,"tid":%d,"name":"dep"}\n' % (to_ts, dep_id, to_pid, stream_id)) dep_id += 1 def metadata_json(self, jsonfile, sysinfo_file): From 9f0ca101ec2286827c9b1cd8ccfa2ee3438f6a15 Mon Sep 17 00:00:00 2001 From: AMD Date: Wed, 16 Jun 2021 18:33:58 -0500 Subject: [PATCH 2/6] Add support for gfx90a Merge gfx90a support from the 'amd-npi' branch. Change-Id: I9b51711ed4a1d2f1ed42ba9b83cb12136be228b8 (cherry picked from commit 4df3e0bd9ae6e5982b43fd2fc3867cf5f0b87a53) --- src/core/metrics.h | 6 +++--- test/tool/gfx_metrics.xml | 17 +++++++++++++++++ test/tool/metrics.xml | 8 ++++++-- 3 files changed, 26 insertions(+), 5 deletions(-) diff --git a/src/core/metrics.h b/src/core/metrics.h index a221168a..6eeebee3 100644 --- a/src/core/metrics.h +++ b/src/core/metrics.h @@ -196,9 +196,9 @@ class MetricsDict { xml_->AddConst("top.const.metric", "SE_NUM", agent_info->se_num); ImportMetrics(agent_info, "const"); agent_name_ = agent_info->name; - if (std::string("gfx906") == agent_info->name) { - ImportMetrics(agent_info, agent_info->name); - } else if (std::string("gfx908") == agent_info->name) { + if (std::string("gfx906") == agent_info->name || + std::string("gfx908") == agent_info->name || + std::string("gfx90a") == agent_info->name) { ImportMetrics(agent_info, agent_info->name); } else { agent_name_ = agent_info->gfxip; diff --git a/test/tool/gfx_metrics.xml b/test/tool/gfx_metrics.xml index 698826c6..c2a79af2 100644 --- a/test/tool/gfx_metrics.xml +++ b/test/tool/gfx_metrics.xml @@ -101,3 +101,20 @@ + + + + + + + + + + + + + + + + + diff --git a/test/tool/metrics.xml b/test/tool/metrics.xml index c340a439..a920ff04 100644 --- a/test/tool/metrics.xml +++ b/test/tool/metrics.xml @@ -65,12 +65,16 @@ + + -# VG20 +# Vega20 -# MI100 +# Arcturus +# Aldebaran + # GPUBusy The percentage of time GPU was busy. From a369af3049bc3a6d2faca537f4e47d5a046f01cf Mon Sep 17 00:00:00 2001 From: rachida Date: Tue, 18 May 2021 20:11:48 -0400 Subject: [PATCH 3/6] SWDEV-282961 Skip barrier events. Process hipMemSet events Marker events inside hcc_ops_trace.txt are from barriers so they are not meant to be stored in ops_patch_data map. Added support for hipMemset events which are a kind of memory copy. Change-Id: I213fe959bcd35ff0371613ba5bffd95bc53e06b5 (cherry picked from commit caa5f323007734fd0b14b3fa49618a5d7cc7acdd) --- bin/tblextr.py | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/bin/tblextr.py b/bin/tblextr.py index 61644e2a..deafb199 100755 --- a/bin/tblextr.py +++ b/bin/tblextr.py @@ -354,7 +354,7 @@ def fill_api_db(table_name, db, indir, api_name, api_pid, dep_pid, dep_list, dep copy_index = 0 ptrn_val = re.compile(r'(\d+):(\d+) (\d+):(\d+) ([^\(]+)(\(.*)$') - hip_mcopy_ptrn = re.compile(r'hipMemcpy') + hip_mcopy_ptrn = re.compile(r'hipMemcpy|hipMemset') hip_wait_event_ptrn = re.compile(r'WaitEvent') hip_sync_event_ptrn = re.compile(r'hipStreamSynchronize') hip_sync_dev_event_ptrn = re.compile(r'hipDeviceSynchronize') @@ -430,7 +430,6 @@ def fill_api_db(table_name, db, indir, api_name, api_pid, dep_pid, dep_list, dep if corr_id == 0: corr_id = record_id rec_vals.append(corr_id) - # extracting/converting stream id (stream_id, stream_found) = get_field(record_args, 'stream') if stream_found == 0: @@ -489,9 +488,6 @@ def fill_api_db(table_name, db, indir, api_name, api_pid, dep_pid, dep_list, dep mcopy_found = 1 op_found = 1 - if op_found: - ops_patch_data[(corr_id, proc_id)] = (thread_id, stream_id, kernel_str) - # HIP WaitEvent API if wait_event_ptrn.search(record_name): op_found = 1 @@ -505,6 +501,9 @@ def fill_api_db(table_name, db, indir, api_name, api_pid, dep_pid, dep_list, dep hsa_patch_data[(copy_index, proc_id)] = thread_id copy_index += 1 + if op_found: + ops_patch_data[(corr_id, proc_id)] = (thread_id, stream_id, kernel_str) + if op_found: op_found = 0 beg_ns = int(rec_vals[0]) @@ -650,6 +649,7 @@ def fill_ops_db(kernel_table_name, mcopy_table_name, db, indir): proc_id = int(m.group(3)) # checking name for memcopy pattern + is_barrier = 0 if ptrn_mcopy.search(name): rec_table_name = mcopy_table_name table_handle = mcopy_table_handle @@ -664,6 +664,7 @@ def fill_ops_db(kernel_table_name, mcopy_table_name, db, indir): if ptrn_barrier.search(name): name = '""' + is_barrier = 1 thread_id = 0 stream_id = 0 @@ -671,7 +672,8 @@ def fill_ops_db(kernel_table_name, mcopy_table_name, db, indir): (thread_id, stream_id, name_patch) = ops_patch_data[(corr_id, proc_id)] if name_patch != '': name = name_patch else: - fatal("hcc ops data not found: '" + record + "', " + str(corr_id) + ", " + str(proc_id)) + if is_barrier: continue + else: fatal("hcc ops data not found: '" + record + "', " + str(corr_id) + ", " + str(proc_id)) # activity record rec_vals[4] = name # Name @@ -878,3 +880,4 @@ def fill_ops_db(kernel_table_name, mcopy_table_name, db, indir): sys.exit(0) ############################################################# + From 2f189791a5cf6a6beb0aea9572d8760f792f0b32 Mon Sep 17 00:00:00 2001 From: Icarus Sparry Date: Wed, 7 Jul 2021 15:49:02 +0000 Subject: [PATCH 4/6] Add dependency on rocm-core Signed-off-by: Icarus Sparry Change-Id: Icb935e9230888fd005d9ca3617e28f6173173cc8 --- CMakeLists.txt | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index c34f7cc9..e47f06df 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -204,7 +204,7 @@ else() endif() message ( "Using CPACK_DEBIAN_PACKAGE_RELEASE ${CPACK_DEBIAN_PACKAGE_RELEASE}" ) set ( CPACK_DEBIAN_FILE_NAME "DEB-DEFAULT" ) -set ( CPACK_DEBIAN_PACKAGE_DEPENDS "hsa-rocr-dev" ) +set ( CPACK_DEBIAN_PACKAGE_DEPENDS "hsa-rocr-dev, rocm-core" ) ## Process the Debian install/remove scripts to update the CPACK variables configure_file ( ${CMAKE_CURRENT_SOURCE_DIR}/DEBIAN/postinst.in DEBIAN/postinst @ONLY ) configure_file ( ${CMAKE_CURRENT_SOURCE_DIR}/DEBIAN/prerm.in DEBIAN/prerm @ONLY ) @@ -229,12 +229,17 @@ if ( PROC_RESULT EQUAL "0" AND NOT EVAL_RESULT STREQUAL "" ) string ( APPEND CPACK_RPM_PACKAGE_RELEASE "%{?dist}" ) endif() set ( CPACK_RPM_FILE_NAME "RPM-DEFAULT" ) -set ( CPACK_RPM_PACKAGE_DEPENDS "hsa-rocr-dev" ) +set ( CPACK_RPM_PACKAGE_REQUIRES "hsa-rocr-dev, rocm-core" ) ## Process the Rpm install/remove scripts to update the CPACK variables configure_file ( "${CMAKE_CURRENT_SOURCE_DIR}/RPM/post.in" RPM/post @ONLY ) configure_file ( "${CMAKE_CURRENT_SOURCE_DIR}/RPM/postun.in" RPM/postun @ONLY ) set ( CPACK_RPM_POST_INSTALL_SCRIPT_FILE "${CMAKE_CURRENT_BINARY_DIR}/RPM/post" ) set ( CPACK_RPM_POST_UNINSTALL_SCRIPT_FILE "${CMAKE_CURRENT_BINARY_DIR}/RPM/postun" ) +# Remove dependency on rocm-core if -DROCM_DEP_ROCMCORE=ON not given to cmake +if(NOT ROCM_DEP_ROCMCORE) + string(REGEX REPLACE ",? ?rocm-core" "" CPACK_RPM_PACKAGE_REQUIRES ${CPACK_RPM_PACKAGE_REQUIRES}) + string(REGEX REPLACE ",? ?rocm-core" "" CPACK_DEBIAN_PACKAGE_DEPENDS ${CPACK_DEBIAN_PACKAGE_DEPENDS}) +endif() include ( CPack ) From b71b5414d1e1d52d2dfe30b7216fc809613a0f44 Mon Sep 17 00:00:00 2001 From: Ammar ELWazir Date: Fri, 21 Jan 2022 12:05:10 -0600 Subject: [PATCH 5/6] SWDEV-318551: Adding License file for profiler Making the new License file, Adding support in the CMakeLists.txt Change-Id: I785035a780fbfc59951fc27d45f9c1869ffb4fb3 --- CMakeLists.txt | 5 +++++ LICENSE | 4 ++-- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 68f9b86a..dfb069be 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -191,6 +191,9 @@ set ( CPACK_PACKAGE_CONTACT "ROCm Profiler Support Date: Thu, 31 Mar 2022 09:04:18 +0300 Subject: [PATCH 6/6] gfx908 counts only half of memmory controlles in L2CacheHit metric --- test/tool/metrics.xml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/test/tool/metrics.xml b/test/tool/metrics.xml index a920ff04..42303bfc 100644 --- a/test/tool/metrics.xml +++ b/test/tool/metrics.xml @@ -39,6 +39,9 @@ + + + # EA1 @@ -200,7 +203,7 @@ # MemUnitBusy The percentage of GPUTime the memory unit is active. The result includes the stall time (MemUnitStalled). This is measured with all extra fetches and writes and any cache or memory effects taken into account. Value range: 0% to 100% (fetch-bound).