Fix HIP Streams Duplication Error (#313)

* Fix stream duplication and fixed tests

* Added comments to explain stream.cpp code, change stream nullptr check to occur in update table to prevent readding null stream, simplified hip-streams bin file code, add destroyStreams to hip-streams bin file code

* Removed roctx from CMakeLists.txt

* Updated documentation

* Fix documentation

* Removed update_table for HIP compiler table and updated stream.cpp to remove support for HIP compiler table

* Added runtime initialization check for HIP

* Changed tool name, working on fixing memory management

* Added context for counter collection kernel rename combination

* Changed name from map to set and changed description

* Fix documentation description for group-by-queue

* Merged memory copy and kernel operations onto a single track when on the same stream

* Updated perfetto output to remove hardware information from track name to merge all memory copy and kernel operations on the same stream to the same track:

* Most pr comments addressed

* Added filter for counter collection and removed kernel buffer tracing hack

* Added PR comment fixes

---------

Co-authored-by: Madsen, Jonathan <Jonathan.Madsen@amd.com>
This commit is contained in:
Trowbridge, Ian
2025-05-01 00:56:15 -05:00
committed by GitHub
parent 4f03ebc360
commit e626df43eb
26 changed files with 465 additions and 287 deletions
+11 -7
View File
@@ -54,15 +54,17 @@ def test_stream_trace(json_data):
buffer_records = data["buffer_records"]
kernel_dispatch_data = buffer_records["kernel_dispatch"]
memory_copies_data = buffer_records["memory_copies"]
memory_copies_data = buffer_records["memory_copy"]
assert len(kernel_dispatch_data) > 0
assert len(memory_copies_data) > 0
# Expect stream ids to be set to 1 or 2 for transpose executable
expected_stream_ids = set((1, 2))
# Expect stream ids to be set between 1 and 8 inclusive for transpose executable
expected_stream_ids = set([i for i in range(1, 9)])
# check buffering data
for titr in (kernel_dispatch_data, memory_copies_data):
for node in rocdecode_data:
stream_id_set = set()
for node in titr:
assert "size" in node
assert "kind" in node
assert "operation" in node
@@ -70,7 +72,7 @@ def test_stream_trace(json_data):
assert "end_timestamp" in node
assert "start_timestamp" in node
assert "thread_id" in node
assert "_stream_id" in node
assert "stream_id" in node
assert node.size > 0
assert node.thread_id > 0
@@ -78,13 +80,15 @@ def test_stream_trace(json_data):
assert node.end_timestamp > 0
assert node.start_timestamp < node.end_timestamp
assert node._stream_id.handle in expected_stream_ids
stream_id = node.stream_id.handle
stream_id_set.add(stream_id)
assert stream_id_set == expected_stream_ids
def test_perfetto_data(pftrace_data, json_data):
import rocprofiler_sdk.tests.rocprofv3 as rocprofv3
assert pftrace_data != None
assert pftrace_data.empty == False
rocprofv3.test_perfetto_data(
pftrace_data,
json_data,